This component needs a little history to understand our motivations.
In December 2013 Team Mojavaton (now Team Grit) was invited to the #DARPADRC Trials. We used an off the shelf servo for all actuators. We believe we designed within the specifications for those servos. Those devices cost about $500.00 a piece. As a self funded team that is an expensive component. During the practice day of the Trials we had 3 such devices die in various manners, and many times had problems with heating. If you see video of our robot in 2013 you will see us nearly opening a door or closing a valve and then have to stop and pick up the robot to save servos from distruction. Because DARPA teams really understand the issues that arise during competition one of our favorite teams (Kairos Autonomi) gave us, not lent, servos to keep us in the Trials. And we expedited shipping on 3 more from supplier with fingers crossed.
Misguided approach and stubborness
In the Finals we were not going to rely on those same servos. We spend a large amount of time, 1 year about, on a Stepper Motor and 99:1 hypocycloid gearbox that was 3D Printed. The design including leg construction is a thing of beauty, one issue, the stepper motor gearbox has too high of torque loss. 90% loss of torque as measured in a prototype. Not that the gearbox is really at fault. Our team believes that is it our understanding of the gearbox that is lacking. I as the team lead I took entirely too long to give up on the Stepper Motor/Hypocycloid design.
Back to the Simpliest Thing That Could Possibly Work approach
The legs we used at the Finals were designed about 3 weeks before the Finals. Our mechanical engineer is also a #FRC First Robotics mentor. So we went with what he knew. What we built was a motor, 3 10:1 planetary gears (for 1000:1 ratio), Talon motor controller, same SpectraSymbol Softpot, and again a Arduino Pro mini. Mechanical, Electronics, Software End-to-End in 3 weeks, not a bad pace for voluteers and enthusiasts. In the end all the components for this "servo" cost $200.00, and can be repaired with $30.00-$50.00 replacement parts.
We did replace a Hex-Shaft output during the Finals at a cost of $30.00. A completely different story than a $500.00 repair for a similar failure on the old servo mechanism.
Step 1: The components and rough layout
The picture shows the different pieces of the "servo" joint.
- A) SpectraSymbol Softpot with McMaster-Carr grub nut pressure pin and 3D Printed mount. The sensor shown is for the knee joint while the motor, gearbox, and bevel gears are for the femur joint. But the sensor for femur is identical.
- B) The Vex BAG motor
- C) 3 Vex 10:1 planetary gears, with motor interface and hex output shaft blocks.
- D) Two Vex bevel gears
- E) Talon Motor Controller
- F) Arduino Pro Mini
- Various nuts, bolts, wires, and hex shaft and bearings
- On 1-1/4 square aluminum extrusion
- Custom Laser cut aluminum plate
#VexRobotics is not a sponsor of our team, or the FRC Team we mentor for we just like the parts, and knew how to use them.
The dxf's are for the metal plates that are cut to make the leg. The sensor plate contains the hole for bearing and material to allow mounting of the softpot. The Inner Knee plate is what is moved by the servo mechanism. There is one specialty piece that is used to connect the new leg to the existing hips.
Step 2: Wiring the Arduino Pro Mini
This is the simpliest of all steps. The Arduino Pro Mini uses its I2C interface to communicate with the main PC. The input to the Talon motor control is a simpleservo signal. We used the Arduino's Servo library but instead for just servo.write we use servo.writeMircoseconds to have a little finer control or the servo position. Our communication over I2C did limit it to 0 to 180 so that precision would probably be more used with the PID control, when implemented. Other than the I2C and the Servo output the only other device connected to the servo is the SpectraSymbol softpot. The resistor network is used to protect the sensor and insure that the value will go to 1023 if there is not enough pressure on the softpot.
Step 3: Software: Simple Dead Band servo control
The software contains many of the same features as the swerve steer feet. It is a simple serial menu for configuring the servo that is stored in the eeprom. The code does a simple dead-band control of the Talon motor control. If the softpot is close to the requested position the motor is turned off, and saves power. If the sensor is "past" the position it will run the motor in reverse. If sensor "short" of the requested position it runs the motor forward. The speed of the motor is a fixed value from the eeprom.
There is a special function added specifically to calibrate the talon. This is done to synchronize the meaning of the servo timing signals between the Talon and the control device, in this case the Arduino Pro Mini. The Talon is callibrated by sending it an extremely low and extremely high value then a center value. On the Arduino this is implemented as a menu option so the user simple presses the 'c' button and sending that to the Arduino while pressing a paper clip into the "CAL" button hole on the Talon. CAUTION!! Forgetting to press the CAL button will make the servo go to extreme values so be quick to kill power if the motor moves during a calibration.
Where is the PID code?
There isn't any yet. The simplest thing that could possibly work encourages a design that may work and then test in real world to see if it is sufficient. We also know we have other components.
Being interested in simplicity we were curious whether that simple approach would even hold a steady position on our robot. We did have legs that individually would start to wave under no load. Though given our set of four legs the systems of connected servos does seem more stable.
We do plan to implement PID control just other features were a priority and we can stand on our legs for hours under power and not shake apart.
Step 4: What is left to do?
- We plan on implementing the PID control. We are curious about the power consumption of the PID control vs simple dead-band control. Could just be a simple setting in eeprom to use dead-band or PID control. In fact many different control approaches could be tested.
- Change the I2C to keep the precision of the request through the entire system. In that design the main PC could request an angle with 1/10 degree of precision and the would be preserved all the way to the servo.writeMicroseconds call being made by the Arduino.
- Remove as much backlash as we can afford. To completely remove backlash will cost more due to precise manufacturing and mechanism to reduce movement of components. Our approach is to see how much backlash can we live with.
Why not use one Arduino to control many servos?
That could be done. We like the design of making something that is modular so you can add and remove a Degree-Of-Freedom and all that needs to be connected is the power and I2C.