Twin Servo Ultrasonic Pathfinding Robot
by mjt266 in Circuits > Arduino
134 Views, 0 Favorites, 0 Comments
Twin Servo Ultrasonic Pathfinding Robot
The original assembly instructions and parts list is included within the report pdf, but will be rewritten and simplified if possible for this website, and if that is still unclear, downloading all of the Autodesk Fusion 360 models as well as the complete assembly will show you where every part is supposed to go as well as its orientation. All non mockup parts (anything that isn't colored gray) are parts that are designed to be laser cut from 1/4 inch acrylic.
This project assumes that the viewer has a basic exposure to Arduino Code, both in writing and uploading programs to the Arduino itself, that the viewer understands or knows enough to teach themselves circuit diagrams, that the viewer has access to a laser cutter, that the viewer has basic tools (Philips Head Screwdriver, Wire Stripper & Cutter), and that the viewer can assemble and support glue models while they set.
(Wires not included as a model or in the assembly for fixing all parts with circular slots in the CAD files)
Additionally, as a note that came after this project was originally submitted for Cornell University's MAE 3780 Mechatronics class, in all of the cases where a stripped jumper/electrical wire is used for structure assembly, you should be able substitute in properly bent paperclips as they are roughly the same diameter. Just to be safe, you probably shouldn't be using jumbo paperclips or the largest options you can find, the smaller the better. This is especially useful when constructing the axles for the motor powered legs as paperclips are far more stiff and stronger than the jumper wires. The original project was completed using only these wires, but its actual function was severely compromised as the wires would deform under the weight of trying to drag the entire robot forwards.
And if you are feeling especially ambitious, you should be able to convert this robot from having 2 powered/moving legs with 4 locked supports into a 6 leg design. By copying the crank mechanism used to restrict the rotational motion of the motor powered legs, you can instead space the 4 legs out from the body using cranks of bent wire/paperclips. Your cranks must have identical dimensions for the proper rotational motion to be copied, otherwise you will only have partial rotation for each leg. The 4 now-moving legs can be driven by the 2 drive legs by connecting a stiff material that is free to let the leg axles rotate. If this is unclear, think of an older steam powered train, and look at the wheels that have struts connecting them on similar locations on each wheel. The concept is the exact same here, although I was never able to get this to properly function before the submission, the robot was designed for that ultimate purpose and adapted to instead use 4 locked legs for support.
Enjoy!
Materials List:
To recreate this project for yourself and have it be compatible with the provided part dimensions and Arduino Code, you will need the following supplies:
- 1x Adafruit Industries LLC 3942 Ultrasonic Sensor
- 2x DFRobot SER0043 360 Degree Continuous 9g Micro Servo Motors
- 1x DFRobot SER0006 180 Degree Positional 9g Micro Servo
- 12x12x1/4" Acrylic Plate
- 6 ft of 22AWG Solid Core Hookup Wire, and at least 4 Paperclips, or just 12-16 paperclips entirely
- Cardboard (anywhere from 1/8 to 1/16" thick, you only need 1 inch by 6 inches at most)
- 1x Arduino Uno with a 4 1/2 x 3 1/2 mounting plate (see CAD Arduino/Breadboard mockup for dimensions)
- 1x Mini Breadboard
- 4x AA Batteries with holder (preferably wide and flat instead of square and thick, but not super important)
- Arduino Jumper Wire kit
- 1x Slideswitch
- 4x M4-40 Screws (Depends on the mounting plate for the Arduino, but the laser cut parts are fit to a M4-40 screw)
- Cyanoacrylate Gorilla Glue
Build the Circuit:
This project, as stated in the first step, assumes that you can read a circuit diagram and tell what the various symbols mean. The diagram above, while abstract, shows what connections you will need to make between your servos, the switch, the ultrasonic sensor, the batteries, and the Arduino, as well as all relevant pins. I've attached two images that show what my circuit looked like when assembled, but these can be unclear at certain points.
NOTE: While it can make things easier to assemble the circuit first, make sure to add the servos into your circuit design last. You should aim to recreate the circuit displayed on your breadboard without the servos being connected. This is important because depending on the length of the jumper wires from the servo motors, you do not want to line up all of your servo connections on one side of the breadboard only to find that one of the servos cannot reach.
Laser Cut Your Body Parts
This step is unfortunately, more vague. Either you know how to use a laser cutter and understand the process of transferring a .dwg file to be cut, or you will have to find someone else who has practice with such files. Once you have your parts cut, the bodywork should pop right out of the acrylic plate, with the occasional snap.
Basic Assembly
All CAD images shown above (with the exception of the last one) are in order of their respective part: the first image is the base plate, seen as C1 in my project report, the second image is C2, and so on. If you are unclear at any time on which parts go where, there should be an attached assembly file alongside all of the individual parts files that can be opened on Autodesk Fusion 360, which will tell you exactly where everything should be located. Additionally, the pictures of the actual robot from previous steps can be used in a worst case scenario, but these images are lacking way too much detail for me to consider them a valid step.
To begin, fix your Arduino to the mount you should have acquired from the parts list. You can always make do and substitute other materials like a flat piece of cardboard with the same dimensions, but if you can find a premade mount for the Uno, this should save you a lot of time. The red/brown plate is the mount, the green part represents the Arduino, and the white part represents a mini breadboard. Take this mount and screw it into the four holes with the M4-40 screws on the acrylic base plate C1. The breadboard should be pointing towards the center of the robot, where the two notches are cut close to each other on each side.
Basic Assembly Continued
Now, begin slotting your C3 supports into the side of your robot. It is crucial that the little nub that sticks out is pointing in the right direction, because otherwise the robot will not be able to fit the servos and could conflict with the Arduino mounting plate.
The easiest way to tell which way a C3 support should be facing is to take the four outer nubs on the long side of the C1 base plate, and split it with an imaginary line between the second and third nubs, starting from either end, so that you get two slots on one side and two on the other. Whichever side the support ends up being on, the nub should point away from this imaginary center line. Depending on how precise your laser cutter is, your parts might either be a very snug fit and could require sanding (if you don't have a sander, a nail filer works perfectly fine, if not slowly) to fit in all the way, or your parts could be barely too small and have a bit of wiggle room in their slots. Regardless, once you are sure that the 8x C3 supports are all facing in the right direction, then you can start using the Cyanoacrylate glue to bond the legs to the body.
Basic Assembly Continued
With the outer legs attached to the base plate (they should be pointing straight up), we now can move to the "inside" of the body. You will want to take your C2 supports and push them through the slots in the center of the base plate, adding glue to the bottom as you go. Then, you can add the C4 and C5 battery walls in place, before again gluing. By this point in the body assembly, the remaining parts can only fit into specific places, and in the case of the C4 walls, can only fit facing one way to fit between the outer C3 supports. Like with C2, add glue to the contacting surfaces and let try for ~30 seconds.
Assembling the Support Legs
All that is left now is to assemble the legs. The center drive legs, we will leave alone for now. The four outer legs on the corners of the robot, you can add very easily by either gluing them to the side of the C3 support with the massive faces against each other, or, you can skip the glue and instead take your 22AWG wire / unfolded paperclips and thread these wires through the two tiny holes that are on the outer four C3 supports. All that matters here is that the legs all point the same direction, and they are immobile, only serving to prob the robot off the ground.
Assembling the Servo Powered Legs
This is the most difficult step in the assembly. If you used 22AWG wire to thread all the other parts together up to this point, you will have no problems. But for the axle / cranks that connect the servo head and the free axle slot from the C2 center support, you will need the paperclips. This is because in my testing, using the 22AWG wire lead to a barely function and self destructive design as this wire is so flimsy and easy to deform that the force that the servos try to deliver to the legs instead is wasted as the supports between the center leg and the servo motor twist and bend in real time. Paperclips on the other hand, are generally made of much stiffer and stronger materials, and as such are much better suited to being the connection between the motor and the leg.
Start by attaching any of the "heads" that should have came with your servo motors and screwing them into the servos themselves. Each head should have a row/rows of tiny holes in each side, which just perfectly match up with the diameter of the 22AWG and Paperclip wires. Start by cutting a very short piece of paperclip, make sure it is as straight as possible, then bend a tiny hook near the end. You will be threading this tiny hook through the holes in the servo head slot. MAKE SURE YOU COUNT HOW MANY HOLES YOU OFFSET FROM THE CENTER. This is important not only for maintaining the symmetry of the robot, but also because you will need the exact distance between this first clip that connects to the motor, and the second clip that will be longer and used only as a free rotating support will need to have a bent portion in the center that is THE EXACT same length as the distance from the servo head screw to the hole where the hook is attached. The hook will almost immediately fall out, so the best thing you can do is cut a piece of scotch tape in half to reduce the width, then as soon as the hooked axle is through the servo head, lock it into place against the servo head by taping it down.
Now for the free axle. Unlike the first, shorter, hooked axle, this axle is more of a crank then a straight cylinder. Your goal is to unbend a paper clip to the point where it is straight as possible, then make two 90 degree angle bends spaced at the distance we just found before, but also have those angles leading to the wire still remaining parallel to itself, just offset from the center. This should leave you with a paperclip that is way too straight and long, but that is OK as all we are using this axle for is to thread into the top slot of the C2 support. If you assemble this part correctly, your second axle paperclip should look like a camshaft. You can always cut extra length off if you need to minimize distance between the robot and the legs. Both slots in each leg should now be possible to fill. You will know if you threaded your custom wires correctly if you try to cycle through the leg motion and the leg almost appears looked in place but it really is only not rotating, but still moving. It should almost look like a horse galloping with its legs cycling as it moves.
If you want even more support, you can cut a very thin, 1x2" piece of cardboard for both sides, and thread so it lays flat over the top slot of both C3 supports. Then, you can poke a hole in this now flattened cardboard in line with the center of the servo head below it, before finally pushing the free crank axle through this hole and into the center C2 support's top slot.
Final Assembly Notes
Now that the hardest parts of manufacturing and assembling are over, it is time to lock your servo motors into place. Take your 2 continuous servos and try to slot them between the center two C3 supports in each side. You will know if you built the design properly if the micro servos are a clean fit and barely leave any room between themselves and the supports C2 and C3. These servos can be fixed similar to the four support legs, by running a wire through the cut out holes in each support to restrict sideways motion.
Take your remaining positional servo motor, and slot it into the cut out slot in the front of the robot, just past the Arduino mount. From here, you have to get a little creative. You are trying to find a way to mount the ultrasonic sensor, which needs to be upright onto a completely flat and non-supportive surface. I did this by taking a piece of thicker cardboard, folding it at a 90 degree angle, cutting one side down to the dimension of the sensor, then poking holes at the very edge of this bent cardboard to allow the sensor to be threaded into place, just like every other part, but now on top of a servo as opposed to merely being fixed in place. You can tape this sensor / cardboard structure piece to the top of the center servo, if properly mounted and fixed, your center servo should now act almost like the neck to a person's head by being able to turn the ultrasonic sensor in other directions. Make sure to connect your final servo motor and your ultrasonic sensor to the circuit if you haven't already.
Now, double check your circuit to make sure everything is connected, and if so, you are done! The only thing left to do is upload the INO file to the Arduino, and see if your robot starts walking in a straight line! The program is either something that you can download from clicking the image, or worst case scenario, you can look through my attached .pdf report, as all the code is written at the very end of the document.