









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










April 21, 2008
Name: Charles Shupard Name: Nic Fisher Email: [email protected] Email: [email protected] Phone: (352) 275-9041 Phone: (727) 430-
This project will control four separate servos that will move four individual control surfaces, two rudders and two elevators, on the exterior of the UF Human Powered Submarine (UFHPS). The submarine is powered by a single propeller; the rotation of the propeller causes a right rolling motion that needs to be compensated for. This roll will be detected and all four servos will be moved to counteract the roll. At the same time the pilot will be able to maneuver the sub with the elevators and rudders. Additionally the depth will be displayed on an LCD so that the pilot can maintain constant depth; the depth sensor will be used to autonomously control the depth.
Electrical & Computer Engineering
Objectives........................................………………………………………………………
Competitive Products……….............................................……………………………….
Concept/Technology Selection.…………………………………………………………...
Project Architecture..……………………………………………………………………...
Timeline………………………………………………………………………………….
Bill of Materials………………………………………………………………………….
Appendix A Schematic Diagram………………………………………………………...
Appendix B Waterproofing Techniques…………………………………………………
Electrical & Computer Engineering
Our project will provide three axis control of the UF Human Powered Submarine similar to a fly by wire control system used in civil and military aircraft. The following is a list of features.
Interface a Hall Effect joystick to the microprocessor to provide an input from the pilot. This will be used to determine the desired direction of movement. Provide a roll indication using an accelerometer. Given these joystick and roll commands the microprocessor will give a single command to each of the four servos, roll and rudder to each rudder and roll and pitch to each elevator. A fifth servo will release a “Dead Man” buoy if a momentary switch is released by the pilot. Using a pressure sensor report the depth to the pilot. Using the same pressure sensor, have the microprocessor provide automatic depth control.
Electrical & Computer Engineering
The Human Powered Submarine (HPS) Races are a small but very competitive. Most teams use a mechanical type control system. The major disadvantage to this is that there are no autonomous systems, roll compensation or directional control. Several teams have experimented with electronic control systems but the major downfall is usually the waterproofing. One team, Omer from Ecole de Technologie Superieure, Montreal, Quebec, Canada has been very successful with there system. Omer is a heavily funded program with almost limitless resources. They are able to purchase or fabricate any components they need. There system is a reliable and effective one but also very expensive one. Our system will rely on our ingenuity and donations from sponsors.
The harsh underwater environment that the control system will need to operate in was a major factor that determined what device we used. We set out to find products that were already waterproof. When that failed we found items that could be easily waterproofed.
The LCD is the same LCD used in the microprocessors lab. This was cheap and easy to implement into the design.
Servos: Standard servos only provide about 50 oz-in torque. This does not be meet the needs required. On the control fins there is a theoretical zero torque line that the fin can rotate, approximately 40% of the fin cord length at the base. The torque increases dramatically as the pivot point moves away from the zero torque line. A hi-torque servo is needed, the HS-755MG is rated at 200 oz-in torque at 6 volts, and HiTec RCD has donated nine. Figure 1: HS-755MG
Microcontroller: The original design called for a single Atmel Atmega2560 processor. This would allow for a single processor to control all functions and for any expansion. In testing we were unable to program the Atmega2560. We opted to use two Atmega324p processors. These were used in prototyping the system, are easy to implement and could provide the functions that were needed for the project. An added benefit of using two processors is that one is dedicated to the Dead Man system adding a level of redundancy and safety. In the event that the control processor fails the safety system will still function. Figure 2: Final μP Design with two Atmega324p processors
Electrical & Computer Engineering
Figure 5: Block Diagram 324p(A)
Figure 6: Block Diagram 324p(B)
Two Atmel Atmega324p processors are used. The first, 324p(A) figure XX, does the majority of the work. It takes inputs from the joystick, pressure transducer, and the accelerometer then outputs via two pulse width modulators (PWM). The rudder servos are connected to the output compare 1 pins, OC1A and OC1B, and the elevator fins are on the OC2A and OC2B pins. The second Atmel, 324p(B) figure XX, is dedicated to running the Dead Man safety system and the LCD. The Dead Man switch is an active high input on PortB (PB.0). When PB.0 goes high the Dead Man switch has been released and the Dead Man servo on OC1A is commanded to deploy the Dead Man buoy.
324p(A) Servo(x4)
Joystick
Accelerometer
Pressure Sensor
324p(B)
Dead Man Servo
Pressure Sensor
Dead Man Switch
Electrical & Computer Engineering
The flowcharts for 324p(A) and 324p(B) are in figures XX and XX respectively. A more detailed schematic diagram of the main processor board and the accelerometer are in appendix A.
The joystick outputs a voltage ranging from 0VDC for full control stick deflection in one direction, to 5VDC for full control stick deflection in the opposite direction. This is done linearly for both axis on the joystick. Each axis is connected to the 8-bit analog to digital converter of 324p(A), this 8-bit value is then used in the control algorithm. The operation of the pressure transducer is similar to the joystick in 324p(A). On system reset the pressure is read and that value, set pressure, is what the control algorithm will hold the submarine at. In the control loop a Δpressure is calculated, Δpressure = set pressure – current pressure. On 324p(B) the set depth is read on reset and the set depth and current depth is displayed on the LCD. The depth is a simple calculation, depth = [(ADCValue × (30psia/255)) – 15.26] × 2.31ft. The accelerometer is connected to 324p(A) via the USART in SPI mode. The USART sends the address of the axis that we want to get a value from and the accelerometer sends a 16 bit value back to 324p(A). Currently only the Y-axis is used to determine the roll, the Z-axis is not working. When the sub is level the Y-axis = 0, if the sub rolls left the Y-axis < 0, in a right roll Y-axis > 0. This value is sent to the control algorithm. The simplified control algorithm is: servoValue = (joystick±Δpressure±Y-axis), Δpressure is not used in rudder movement.
After the control algorithm determines the appropriate value for a servo it is sent to the PWM to set the servo position. The servo position is determined by the pulse width, .9ms to 2.1ms for 0-180 degrees of rotation.
Electrical & Computer Engineering
Figure 7: 324p(A) Flowchart
Get X-axis from ADC.1, get Y-axis from ADC.
Get accelerometer data
Calculate Roll
Rudder(T/B) = X-axis ± Roll Elevator(L/R) = Y-axis ± Roll ± Up/Down Elevator
Rudder(T/B)/Elevator(L/R)
Max Value
Rudder(T/B)/Eleva tor(L/R) < Min Value
Rudder(T/B)/Elevator(L/R) = Max Value
Rudder(T/B)/Elevator(L/R) = Min Value
Electrical & Computer Engineering
Figure 8: 324p(B) Flowchart
Initialize Timer0/1, ADC, LCD, PWM
Dead Man Switch pressed
Launch Dead Man buoy
Get Depth from ADC.
Print Depth to LCD
Electrical & Computer Engineering
Device Unit Price Units Cost Paid Joystick $ 192.00 1 $ 192.00 $ - Atmega324p $ 6.02 2 $ 12.04 $ - HS-755MG Servo $ 40.00 5 $ 200.00 $ - PS9801 Sensor $ 500.00 1 $ 500.00 $ - Accelerometer $ 12.30 1 $ 12.30 $ - LCD $ 12.00 1 $ 12.00 $ - Servo Batteries $ 3.00 6 $ 18.00 $ 18. Battery Charger $ 30.00 1 $ 30.00 $ 30. Battery Holder $ 1.00 3 $ 3.00 $ 3. Conduit Box $ 12.00 2 $ 24.00 $ - Level Shifter $ 3.00 2 $ 6.00 $ - Wire $ 6.00 3 $ 18.00 $ 18. Total $1,027.34 $ 69.
Table 1: Bill of Materials
Electrical & Computer Engineering
Main Processor Board Schematic
Electrical & Computer Engineering
PVC conduit boxes were used to house the servo batteries and the main processor board. These boxes purchased at a local hardware store and modified to make them waterproof. The lid is attached with four screws and has a foam gasket. The foam gasket was replaced by applying silicone sealant to the lid, smoothed out with a credit card and was allowed to dry. This seal was tested at a depth of 30ft. about twice the depth that the sub will run at. Holes were drilled to allow for wires to pass through the boxes. The wires and holes were coated with hot glue and Plasti-Dip, a product commonly used in coating tool handles.
The servos were waterproofed in a similar manner. The wires were coated with Scotchkote, a liquid electrical tape, and then dipped in Plasti-Dip. The output shaft was coated with silicon grease and an o-ring around the shaft. The control horn secured to the shaft seals the upper case of the servo. This technique is a modified version of waterproofing found on the Society of Robots web site, www.societyofrobots.com.
For the accelerometer/LCD a box was constructed out of acrylic sheet. Again silicon sealant, hot glue, and Plasti-Dip were used to seal the box.