Testing Leap Motion controller for hand tracking inside the Unity editor. Deploying to HoloLens 2 takes a few minutes each time and a specific process to prevent errors. Less deployments is better, especially if you just want to tweak something small.
Still working on this guy… sorry no video at this time. He was assembled enough to execute some motion presets that I added to the code, but there are some interference issues and possibly one or two servos that don’t work quite right. I took him back apart to work on shielding but got pulled off the project for a while. So close to getting back to the code.
Circuit Diagram v8 (WIP)
Alive! Well, the light is on…
Servo Hook-Up Board – Bottom
Servo Hook-Up Board – Top
Servo Hook-Up Board – Side
PC Power Supply with Voltage Regulator (Arduino wants 7-12V, I gave it 9V)
The videos below are demonstrations of the potentiometer and a few other commands. The potentiometer controls the interval value when turned left or right (as does “i##”). You can also see some examples of the other commands that Rocco accepts as input in the first video. I am pasting a sequence of motion pre-sets while using the potentiometer to change his movement speed.
“[” or “]” | Increase/decrease servo speed – Rocco continues executing a motion every “servo_speed” milliseconds until motion is complete
“s###” | Set a three digit servo speed (default is 25ms, maximum 999ms)
Hardware potentiometer | Increase/decrease servo_interval – Rocco moves each servo “servo_interval” number of degrees until executed motion is complete
“i##” | Set a two digit servo interval (default is 32 which is the maximum value)
“p” | Toggle usage of potentiometer for reading the servo interval (potentiometer is used by default)
“j##” | Select a servo using a two digit servo number
“,” (the “<” key) | Select previous servo
“.” (the “>” key) | Select next servo
“k” | “Knock” selected servo (move +5 degrees then -5 degrees just to see which servo is selected)
“a###” | Set the angle of current servo, requires three digit angle (add leading zeros if necessary)
Below is an example of how to connect to the HC-06 module using Real-Term:
Baud: 9600 (this value should match what is coded in the Arduino) Port: “6 = \BthModem0” (you can find which COM port HC-06 is using in Windows 7 by “Devices and Printers”, “HC-06”, “Hardware”) Parity: None Data Bits: 8 Stop Bits: 1 Hardware Flow Control: None Press “Change” to connect
I am also able to connect to the Bluetooth module using my Nook tablet and the “Bluetooth Terminal” application. Any Android tablet will work, but iPads and iPhones will not as they don’t support this kind of connection.
I had a left over power supply with a molex connector on the end that can put out 5V @ 2A or 12V @ 2A. I am using it at 5V to independently power the servos collectively. I also re-purposed a female molex to 2-pin adapter to get the power to the breadboard.
I am not sure yet how much current these servos draw. I only know that 2A is enough because, well, I tried it. I tried to measure this with my multimeter but could not get a valid reading. I later discovered most multimeters can’t read servo current.
I chose an Arduino Mega 2560 R3 for the main board. I’ve never used an Arduino before so this is exciting. There are dedicated products for controlling servos and pre-programming motions, but I’m currently putting an emphasis on coding as much of this project as possible. The Mega has enough pins to control (but not power) all 18 servos. I’ve read there may be problems with interrupts or “bandwidth” when trying to control all 18, but I’m still going to try. If it doesn’t work out I’ll look at adding hardware to the project.
It should not be printed to a 3D printer currently because the holes don’t line up quite right. When I started assembling the first leg I had to widen most of the holes and even move some of them. This is possibly because the servo dimensions aren’t exact. I will try to fix the model when I build the rest of the legs.
Below is a description of all the materials and components currently used to make the robot.
Any drill bits meant for plexiglass will work, but these are the bits I’ve used:
You can order acrylic sheets anywhere, but I have a lot left over from prior projects. I have previously ordered them from U.S. Plastics. You can cut plexiglass by scoring it repeatedly with a box cutter along a heavy straight edge.
18 @ 20mm x 100mm – mid-leg and outer leg lengths (shared size) 6 @ 10mm x 132mm – longest leg pieces 12 @ 10mm x 42mm – knee servo side mounts 18 @ 10mm x 32mm – knee servo top and bottom mounts 12 @ 35mm x 35mm – hip top and bottom plates 6 @ 12mm x 35mm – hip mid-panel 2 @ ? – hexagonal body top and bottom (no exact dimensions currently) Other – there may be other plexiglass cuts added later
I needed some spacing material to fill an area in my design and provide support. I also needed to be able to cut it by hand, so I just got a stick of wood from the hardware store.
6 @ ~27mm x ~22mm x ~11mm (length, width, height)
The wood is then cut to an “L” shape. I’ve only made one so I’m not sure how much I cut out. Let’s just call it “some”.
I designed the mounting hardware solution around getting as many of the components as I could from one place.
I was able to do this such that I got everything from McMaster-Carr. Most of the components are shown to the right:
According to the link below, the “spline screw” that fits in the center of the servos I’m using (TowerPro MG90s) is an M2.5 size. I needed longer screws than the ones that were supplied so that I could put plexiglass between the screw heads and the servos.
I also needed some threaded rod that I could cut to specific lengths using a dremmel. The threaded rod and the the metal hex nuts for it are the heaviest parts of the mounting hardware but it is necessary to keep the hip/shoulder “square” and keep it from flexing. To keep the weight down, almost all the mounting hardware is nylon.
At first I thought I was going to get full size servos for this project, but the lowest price I saw for those was around $10 per servo, which would have added $180 to the project before it even got started. I did not want to make that kind of commitment never having worked with these components before. I did a lot of research and have tried to summarize it below.
Here is a look at the current outcome of having chosen metal geared MG90s micro servos:
Cost/Quality – Servos are another type of purchase where you get what you pay for. I feel like the choice was sort of “expensive” vs. “disposable”. There are also robotics grade servos, but those were definitely out of the question.
Gear Type – I wanted the more expensive metal geared servos instead of plastic so that the gears don’t strip/slip under the weight of the robot. I’ve heard these can get hot but I can’t test that yet.
Brands and Models – I’ve heard Hitec and Futaba are the better brands. Many people have strong negative and positive opinions about brands and models of servos. This is in part due to the fact that the market contains a lot of knock-off products and a lot of servos with really bad quality control. Many arrive faulty or fail quickly. On top of that, I found most of the discussion about servos seems to center around keeping expensive RC planes and helicopters in the air. As I understand it, there are also a lot of issues with online hobby shops holding people’s money hostage while they obtain their stock from overseas. Lastly, using servos to carry the weight of a robot is an inherent abuse of their design.
Physical Size – Standard size servos with metal gears cost too much to be “disposable”, and I didn’t want to spend enough to get a quality brand/model at that size. I chose the micro size instead. The micro servos are lighter and use less power too.
Voltage and Torque – For testing I was able to power one servo using the Arduino, but it definitely can’t power 18 of them. I don’t know how many it can power safely, but I think the answer is very few. The more voltage you supply to a servo (within its specified range), the greater its torque (strength). Torque is one of the more important factors for walking robots since they need immediate and constantly available support for their weight. Running servos at their maximum voltage will wear them out quicker though, so I chose to run mine at 5V which is in between their minimum and maximum values.
Accuracy – I’m actually minimally concerned with this, as I want my robot to have a little personality anyway. I plan to accommodate for any detrimental imprecision with code wherever possible.
Practicality – I wondered was it even practical to use micro servos? They’re not famous for doing heavy lifting. It turns out yes! There aren’t as many examples of these in use, but some of my favorite robots are using them. Sometimes they are a little shaky in certain positions, but I will try to design and code around that as well.
Given the quality issues, I assume I will be replacing servos periodically, so being able to return them and get new ones quickly and cheaply is my main concern. With hobby shops and eBay ruled out, I ignored a lot of negative comments about the TowerPro MG90s and ordered it anyway because it was the only servo that met the requirements AND could be ordered via Amazon Prime for $5 per servo.
TowerPro MG90s Micro Servo Specs:
Dimensions: 22.8 x 12.2 x 28.5mm
Operating Speed (4.8V no load): 0.1sec / 60 degrees Operating Speed (6V no load): 0.08sec / 60 degrees
Stall Torque (4.8V): 1.8 kg / cm (also seen listed as 2.2 kg / cm)
Stall Torque (6V): 2.2 kg / cm (also seen listed as 2.5 kg / cm)
Temperature Range: -30 to +60 Degree C
Dead Band Width: 5usec (also seen listed as 2usec)
Rocco is built on an Arduino, which is a development board and environment that can read data from sensors and run code written in C. The code for this project is located on GitHub here: https://github.com/levans88/Rocco
The main focus of the code right now is to read input over a serial connection and execute appropriate functions (mostly movements) based on the characters received. The core function handling movement is “motion”.
There are no inverse or forward kinematics involved yet, only motion presets which are defined in the motionPreset function. Destination angles are set in that function as well and passed to the motion function to be executed.
The motion function uses the servo_interval variable to determine how many degrees each servo should move at a time on the way to completing a motion. It also uses the servo_speed variable to determine how frequently each servo should move.
For an interval of “01” (one degree, the most granular), a speed of “010” (10 milliseconds) works best. Here is an example of Rocco moving slowly (with an interval close to 01):
For the fastest movements, the maximum interval value of “32” (32 degrees) can be used along with a speed of “001” (1 millisecond). There is very little observable difference in anything lower than 25 milliseconds for fast motions.
For a few years now I have been seeing hexapod robots show up on sites like Hack-A-Day and in my search results. Some are custom, built from scratch robots made with wood, or professionally cut aluminum, and others are kits that can be bought and assembled from RC/Hobby shops and robotics web sites.
So, armed with more ideas and questions than anything else, I set out to build my own hexapod robot named Rocco, and I will document the project here. I am catching up on documentation, and a lot of work has already been done. I will make separate blog posts for different project components.