Difference between revisions of "F16: Wireless Tilt Controlled Camera Arm"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Parts List & Cost)
(Board-to-Board Wireless Communication)
Line 187: Line 187:
 
===== Board-to-Board Wireless Communication =====
 
===== Board-to-Board Wireless Communication =====
 
Initialization of the SJOne boards' wireless features was mostly handled by the default wireless task. For wireless communication, the wireless channel number used by both boards must be the same. The two boards used in this project each had their own wireless node address, which was used to uniquely identify each of the boards during the wireless communication. Both tasks were set to HIGH priority to ensure that they were running all of the time.
 
Initialization of the SJOne boards' wireless features was mostly handled by the default wireless task. For wireless communication, the wireless channel number used by both boards must be the same. The two boards used in this project each had their own wireless node address, which was used to uniquely identify each of the boards during the wireless communication. Both tasks were set to HIGH priority to ensure that they were running all of the time.
 +
 +
File:F16 cmpe146 wtcca tasks diagram.png
  
 
== Testing & Technical Challenges ==
 
== Testing & Technical Challenges ==

Revision as of 08:59, 20 December 2016

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Wireless Tilt Controlled Camera Arm

Abstract

For this camera system, the camera moves along a track according to user’s controls. The controller, which will be one of the SJOne boards, will control the direction of movement of the camera along the track. The camera will be mounted on a track and will be connected to the second SJOne board. The camera’s movement speed is set. However, the camera’s direction will be determined by the angle in which the controller is tilted. The camera’s tilt speed will be tracked using the attached SJOne board’s accelerometer and used in the movement of the camera’s vision. Similar to the movement of the human eye, the camera in this camera system will be able see 180 degrees in all directions in forward vision. The camera can look at an angle in any direction such as left, right, up, and down. The camera can be stopped or turned off by pressing a button on the controller. If the controller is tilted 90 degrees vertically, then the camera will start moving in that tilted direction. If there is an error, the user can press a button on the controller that will stop receiving accelerometer data from the controller board and the camera will reset back to the center position of the track and the camera will be back to facing the correct orientation. Data is transferred through wireless communication between the two SJOne boards.

Objectives & Introduction

The objective for this project was to learn how to use motors and use them to implement a project. Here, a camera arm was designed in order to take acceleration sensor data from one board and and through wireless communication, receive information on how to move the arms with respect to how the control board would move. The following objectives were set for the project:

1. Design an arm in CAD software to hold all the motors that will do all the movements.

2. Research the proper hardware needed for the expectations for the project, which would be high precision motors that are capable of fine movement.

3. Write Software to control motors, establish wireless communication across 2 devices.

Team Members & Responsibilities

  • Kevin Lai
    • Acceleration Sensor and Wireless Communication Software Developer
    • Document Writer
  • Alex Reyna
    • Arm and Track Designer, and Motor Driving Software Developer
    • Document Writer

Schedule

Week# Start Date End Date Task Status Actual Completion Date
1 10/8 10/14 Write Project Proposal Completed 10/14
2 10/14 10/21 Finalize Project Design Completed 10/21
3 10/21 10/28 Research and Determine Necessary Components Completed 10/28
4 10/28 11/11 Purchase Parts Completed 11/15
5 11/11 11/18 Generate Schematics and Begin Prototyping Completed 11/18
6 11/18 11/25 Program First Microcontroller to Act as Wireless Remote Controller of Camera Arm Completed 11/23
7 11/25 12/2 Create Movable Camera Arm Completed 12/9
8 12/2 12/9 Program Second Microcontroller to Interface with the Camera Arm Completed 12/16
9 12/9 12/16 Perform Final Tests, Generate Final Report, and Prepare for Demo Completed 12/19

Parts List & Cost

A part list for our project.

Part Name Model Number Quantity Cost (Total) Notes
Microcontroller SJOne Board 2 $160 One for Main Wireless Controller and One for Camera Motion Controller
2.4GHz 6dBi Indoor Omni-directional Antenna Antenna 2 $9 Used for wireless communications between the boards
Osoyoo Micro Servo Motor SG90 10 $20 Used for the motor control for the arm
High Torque Metal Gear Feather Servo Motor HS-5065MG 2 $54 Used for the motor control for the arm
5V Step-Up/Step-Down Voltage Regulator S18V20F5 1 $15 Used for regulating power to the SJOne Board
6V Step-Up/Step-Down Voltage Regulator S18V20F6 1 $15 Used for regulating power to the motors
3d printed Arm SCE 1 $0 3D printed at SJSU's SCE Club Room, free of charge with club membership

Design & Implementation

The Wireless Tilt Control Camera Arm design was broken up across two boards, both hardware and software. One board was going to be used to get data from the on-board acceleration sensor, interpret it and send it wireless over to a second board to that would receive the information transmitted and move the motors accordingly.

Hardware Design

The hardware design mainly focused on the motor control board. No additional hardware was implemented to the board that was sending the acceleration sensor data. Three motors were used in the arm design. 2 high precision servos, the HS 5065MG micro servos. These servos were chosen for the ability to have fine control and movement. They are not typical servos that they move in that they need a certain amount of pulse to trigger or needing a certain length to the duty cycle. Rather, the servo rotates bases on the duration of the pulse. The motor had a workable range of 750 - 2250 microseconds. The servo had a workable range of of 120 degrees. These were the more expensive motors and had metal gears. The third motor was the Osoyoo SG90 micro servo, which had a duty cycle of 50 hz, or 20 ms. It required a pulse of 1-2ms to rotate the motor 90 degrees, either to the left or to the right. These motors were much simpler and had plastic gears. These were not able to provide fine control. In order to power all the devices, 2 voltage regulators were purchased. A 5v Step Up/Step Down voltage regulator from Pololu was purchased to power the SG90 servo and the SJOne board. A 6V Step Up/Step Down voltage regulator from Pololu was used to power the precision servos. The 6 volts to the motors guaranteed highest efficiency and precision. All the hardware was housed in arm design in CAD tools. The design can be seen in Figure 2 and Figure 3. The schematic and hardware layout can be seen in Figure One.

Figure 1. Camera Arm Hardware Design

Hardware Interface

The motors received pulse width modulation (PWM) signals from the 2.0-2.4 GPIO pins boards on the SJ One board. All devices had to share a common ground port to work efficiently. The onboard PWM API was used to control the motors. They had to be slightly tuned in that inputting a value of 50 into the initialization of the PWM . Setting the value of 4 in turn actually generated a duty cycle of 20 ms. This was verified using an oscilloscope. The percentage of the duty cycle was calculated to measure to correct duration of pulse needed to move the motors.

Software Design

Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.

Board-to-Board Wireless Communication

The board-to-board wireless communication utilizes Nordic Wireless on the SJOne board. Two additional tasks were created to perform the intended operations needed in this project: one task for wireless data transmission and one task for wireless data reception. The main wireless controller performs the task that transmits data while the camera motion controller performs the task that receives data. The transmit task first interprets and uses the acceleration data captured by the SJOne board's acceleration sensor to generate the appropriate instructions to send to the camera motion controller. Then, after the instructions have been generated, the transmit task packages the instructions into a packet and sends the packet wirelessly to the other board. The receive task receives the wireless packet and unpackages the packet to obtain the instruction data. Then, the receive task uses the instruction data to control the movement of the motors.

Figure 2. Project Tasks Software Design

Implementation

This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.

Board-to-Board Wireless Communication

Initialization of the SJOne boards' wireless features was mostly handled by the default wireless task. For wireless communication, the wireless channel number used by both boards must be the same. The two boards used in this project each had their own wireless node address, which was used to uniquely identify each of the boards during the wireless communication. Both tasks were set to HIGH priority to ensure that they were running all of the time.

File:F16 cmpe146 wtcca tasks diagram.png

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

Wireless Stability

Issue

Initially, as we were testing the board-to-board wireless communication, many packets would often be lost during the transmission.

Solution:

In order to resolve this issue, we reduced the air kbps rate down to provide a more stable signal. Although reducing the air kbps rate did reduce the loss of packets, the data transmission rate became much slower.

Getting Motors to Work Properly

Issue

Motors were acting sporadically and not as expected.

Solution:

By connecting every component in the design to common ground, we were able to resolve this issue.

My Issue #3

Discuss the issue and resolution.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.