How to Make an Underwater Glider
by Oldwelin in Workshop > 3D Design
30 Views, 0 Favorites, 0 Comments
How to Make an Underwater Glider
Llywelyn Lehman and I, Rhys Weibel, are Highschool students at Saint James High School in Hagerstown, Maryland. We designed an underwater glider. The reason we decided to make an underwater glider is because we wanted to make a glider for but we wanted it to be different, so we thought that swimming is just flying but in a different medium, like how a penguin swims.
Supplies
- 4: 3/16" diameter metal rods with a length of 36"
- 4: 1/8" brass square tubes with a length of 1'
- 2: 3.00mm diameter metal rods with a length of 1'4" ( or something close to that, you will have to cut it later)
- 1: 3.00mm diameter metal rods with a length of 139.6mm
- 1: Arduino Nano
- 1: HiLego Arduino Nano I/O Expansion Shield
- 3: MG996R Servo Motor
- 1: 17HS3401 Stepper motor
- 1: a4988 stepper motor driver
- 5: 60ml Syringes
- 1:COM-09032 Joystick
- 2:TS02-66-55-BK-100-LCR-D buttons
- 6: INR18650 Batteries
- 1' of 4.50mm OD vinyl tubing
- 72cm of 4.5" OD PVC pipe
- 2 sections of monokote heat shrink wrap that have a 1' width and a length of 1.5'
3D Printing
3D Print the pieces of the glider from these files
- Files: description and number needed
- https://a360.co/4gssInQ 1:Tail cone
- https://a360.co/3VvcClu 6: Wing Ribs
- https://a360.co/4213GrQ 2:aeileron pieces (Print one then print another as the mirror image)
- https://a360.co/4h3mcEa 1:Rudder Pieces
- https://a360.co/406c8U5 3:Servo Connector
- https://a360.co/40mFAXq 1:Nose Cone
- https://a360.co/3DK85p5 2:Wing bracket (Print one then print another as the mirror image)
- https://a360.co/3PthAeW 2:Servo holder
- https://a360.co/4aa2ftp 1:Tail cone servo Holder
print from this file: https://a360.co/3DTr6Wg
- ballast ring 1, and 2
- Stepper motor
- Body 30
- the two rings at each end of the glider in the internal body section of fusion
Acquire Non 3D-printed Materials
If you have already acquired the non 3D-printed materials then move to the next step, if you have not buy the Non 3D-printed materials.
Attach Servo Connectors to the Servos
Using the 4 way connectors that came with the servos, attach the servo connectors to the four way servo connector
Solder HiLego Arduino Nano I/O Expansion Shield and Arduino Nano Together
Solder the HiLego Arduino Nano I/O Expansion Shield and the Arduino Nano together.
Put Arduino and Batteries Into Body 30
Put the batteries and the Arduino into body 30 and wire them according to the instructions in step 14.
Assemble Ballast Engine
Take the 5 60ml syringes and put them so that the plunder end is in ballast ring 2 then put the into the corresponding holes of ballast ring 1
Assemble the Insides of the Glider
Take two of the three servo motors and stepper motor and put them in their respective holders, so the stepper motor holders, and the servo motor holders. then take the 4 3/16" metal rods, body 30 and the stepper motor, and put the 4 metal rods into the four round holes on Body 30 and the stepper motor and push them a little bit towards one end of the metal rods. then put the servo motor holders on the rods so that they are in front of the stepper motor holder. after that put the Ballast Engine with the nozzles facing away from the rest of the internal pieces. it should look like this file but with the ballast rings reversed https://a360.co/3DTr6Wg, then put this into the PVC pipe
Tail Cone Servo Motor Holder and Tail Cone
Take the tail cone servo motor holder, put the servo motor in it then put the holder into the tail cone so that the curved part of the tail cone holder is at the entrance of the tail cone, and glue it down. then take the 3.00mm diameter metal rod with a length of 139.6mm and push it through the little hole on the side of the tail cone ( you may have to drill this out if your printer has a lower tolerance and made the hold to small) so that it connects with the connecting rod side of the servo connecter pin. then push the tail cone into place so that it is near to the side with the Arduino, and reconnect its wires.
Assemble and Attach the Rudder
Take the rudder pieces, and 3.00mm diameter metal rod with a length of 139.6mm, put it into the hole on the glider and put the rudder piece into the slot on the rudder and fit the metal rod into it, and glue the rudder piece to the metal rod. then put the completed rudder into the grove, and glue it in place.
Assembling the Wings the Wings
Take the Wing Bracket and put it on the center of gravity of the glider and in the middle hole of the bracket drill a hole that is a little bit larger than 3.00mm. then take the wing bracket and the 4 1/8" brass tubing, along with the 3.00mm diameter metal rod with a length of 1'6"and put the brass tubing into the first and last square holes on the bracket and put the metal rod in the middle hole. take then the 3 wing ribs and place one 7 cm away from the Bracket, making sure that the trailing edge of the wing is over the rest of the bracket and glue it there, and the place each of the other ribs 7cm apart, and then place the Aileron 7cm away from the last wing rib, you will then have to cut the brass rod in the last hole, leaving 9cm length out from the first wing rib, do not forget to glue these in place as well, then place the 3.00mm Diameter metal rod that has a length of 1'6", and put it in the middle hole of the wing ribs and ailerons, and put the second piece of the aileron in its spot in the middle of the aileron, and glue it to the metal rod. repeat this again, but as a mirror image for the other side of the Glider
Attaching the Wings
Take the bracket and the new wing section that you have just made, and glue them together, so that the brass rods are 2 cm into the bracket. then connect the metal rod in the middle hole to the servo motor on the insider of the glider, and then measure the distance from the hole on the glider to the middle hole on the bracket. then take that measurement and cut that length of the end of the metal rod. then attach the metal rod to the servo connector, and glue the bracket into place on the glider, be sure that the leading edge of the glider is facing away from body 30 and the stepper motor. repeat on the other side of the glider and make sure to mirror it. the last step of the wing making process is to put the monokote on the wings. rap the monokote around the wing structure, and use a heat gun to shrink it to fit tightly around the wing.
Finishing Off the Physical Glider
Put the nose cone into the front of the glider and connect the little hole to the ballast engine, and seal up all of the cracks around the nose and tail cones.
Coding the Arduino
Upload the following code into the Arduino Nano:
#include <Servo.h>
// Servo objects
Servo aileronServoLeft;
Servo aileronServoRight;
Servo tailFinServo;
// Joystick pins
const int xAxisPin = A0; // X-axis of the joystick
const int yAxisPin = A1; // Y-axis of the joystick
const int buttonPins = 5; // Optional button for tail fin control (set to -1 if unused)
const int buttonPinss = 6;
// Servo limits
const int maxAngle = 15; // Maximum angle for ailerons and tail fin
// Pin definitions
const int stepPin = 3; // Step pin for A4988
const int dirPin = 2; // Direction pin for A4988
const int buttonPin = 4; // Button pin
// Variables
bool direction = true; // Current direction: true = forward, false = backward
bool buttonPressed = false; // Tracks button state
bool lastButtonState = HIGH; // Previous button state
// Movement parameters
const int stepsPerRevolution = 200; // Adjust for your motor (1.8° per step)
const int totalSteps = stepsPerRevolution * 5; // Example: 5 full rotations
const int stepDelay = 500; // Microseconds between steps (adjust for speed)
void setup() {
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP); // Use internal pull-up resistor
// Attach servos to PWM pins
aileronServoLeft.attach(9);
aileronServoRight.attach(8);
tailFinServo.attach(10);
// Initialize button pin (optional)
pinMode(buttonPinss, INPUT_PULLUP); // Pullup to detect button press
pinMode(buttonPins, INPUT_PULLUP); // Pullup to detect button press
// Set servos to neutral positions
aileronServoLeft.write(90);
aileronServoRight.write(90);
tailFinServo.write(90);
}
void loop() {
int xVal = analogRead(xAxisPin);
int yVal = analogRead(yAxisPin);
// Map joystick values to roll and pitch angles
int rollAngle = map(xVal, 0, 1023, -maxAngle, maxAngle); // Roll
int pitchAngle = map(yVal, 0, 1023, -maxAngle, maxAngle); // Pitch
// Calculate servo positions for ailerons
int leftAileronAngle = constrain(90 + rollAngle - pitchAngle, 0, 180);
int rightAileronAngle = constrain(90 - rollAngle - pitchAngle, 0, 180);
// Update aileron servos
aileronServoLeft.write(leftAileronAngle);
aileronServoRight.write(rightAileronAngle);
// Control tail fin with button (optional)
if (digitalReal(buttonPinss) == HIGH && digitalRead(buttonPins) == LOW) {
// If button is pressed, move tail fin to a specific angle
tailFinServo.write(90 + maxAngle); // Example: move to the right
} else if(digitalReal(buttonPins) == HIGH && digitalRead(buttonPinss) == LOW){
// Otherwise, keep tail fin at neutral
tailFinServo.write(90 - maxAngle);
} else if(digitalReal(buttonPinss) == HIGH && digitalRead(buttonPins) == HIGH){
tailFinServo.write(90);
}
// Small delay for stability
delay(10);
// Read button state
bool currentButtonState = digitalRead(buttonPin);
// Detect button press (rising edge)
if (lastButtonState == HIGH && currentButtonState == LOW) {
buttonPressed = !buttonPressed; // Toggle the buttonPressed state
}
lastButtonState = currentButtonState;
// Move the motor if the button is pressed
if (buttonPressed) {
moveMotor(direction); // Move in the current direction
direction = !direction; // Toggle direction for the next press
buttonPressed = false; // Reset the button state
}
}
void moveMotor(bool dir) {
// Set the direction
digitalWrite(dirPin, dir);
// Move the motor the specified number of steps
for (int i = 0; i < totalSteps; i++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(stepDelay);
digitalWrite(stepPin, LOW);
delayMicroseconds(stepDelay);
}
}
Wiring the Electronics
Connect the ground wires of the servo motors to the ground pins on the arduino nano. Do the same for the power pins. Then, put the right servo signal pin on to pin 8, the left into pin 9, and the tail into pin 10. Connect the stepper motor to the a4988 stepper motor drive. Then, connect two of the batteries into the vmot pin on the motor drive. Attach the vod and gnd pin into power and ground pins on the arduino nano. Attach the direction pin on the drive into pin 2 and the speed pin into pin 3. Attach the SW pin on the joystick into pin 4 on the arduino. Attach two buttons into pin 5 and pin 6 on the arduino. Attach the +5v and GND pins on the joystick into a power and ground pin on the arduino. For joystick control, attach VRX pin into the A0 pin and the VRY pin to the A1 pin on the arduino from the joystick. Put two batteries in series and another two in series, then, run both sets of batteries in parallel into the power jack of the arduino nano. ( you may have to unattach things and then reattach them later)