Intro: 359 Degree Servo Modification
There is a lack of RC servos that have greater than 90 degree servo angle while still having position control. A few servos go 180 degrees, but nothing greater. A servo with a greater range of movement could be used as a Halloween prop with a head that rotates 359 degrees. Other uses might include a realistic model tank turret drive, or a full range analog panel meter. Additionally, the life of a typical servo is reduced due to the mechanical analog potientiometer wearing during use (as well as its physical construction design limiting range) . This modification addresses these issues.
The modification involves removing the analog potientiometer and control board, and replacing with a hall effect absolute encoder and new control board and motor driver. The new control board is used because there is no inexpensive way to program and add an SPI port for the new encoder; the new board costs only a few dollars and is easily programmable for any desired range. This is a prototype, and the controller board and motor driver were mounted external to the case. With a custom circuit board, a production model could easily fit all the components inside.
Step 1: Materials Required
1 ea. standard size servo MG996R
1 ea. diametrically magnetized magnet Diametrically magnetized magnet
1 ea. MLX90316 BDG hall type encoder Encoder
1 ea. SOIC-8 adapter (99 spare) Adapter
1 ea. 3/16" x 12" wood dowel, hobby store
1 ea. motor driver TB6612
1 ea. Arduino Pro Mini, 3.3v, 8 Mhz Pro Mini
4 ea. 0.1 uF capacitors Capacitors
1 ea. servo tester servo tester
Step 2: Modifications to Servo
Remove the 4 screws holding the servo together, and remove the control board and potientiometer. Carefully remove the final drive gear, noting the arrangement of the gears (a photo will help if you forget). Remove the pin in the final drive gear, see Instructable. Test fit the 3/16" dowel into the hole where the potientiometer shaft was, a bit of sanding around the circumference of the dowel will be required. The dowel should fit through the hole and about 1/8" above the top of the hole. With a pocket knife or Exacto knife, shape the end of the dowel to snugly fit the slot in the bottom of the drive gear (where the potientiometer shaft used to fit). Test that the dowel can move the drive gear without too much friction. On the inside of the servo case, mark with a pencil line on the dowel so the dowel can be cut- the dowel should only extend into the case 1/8" when cut. Cut the dowel as straight as possible, then epoxy the magnet on. After the glue is dry, clean the drive gear slot with a toothpick or similar, and drop a bit of epoxy into the slot. Put the dowel and magnet into the hole, and align so the magnet remains as straight as possible when the final gear is rotated (doesn't have to be perfect). Allow to dry.
Solder the MLX90316 onto the adapter board, adding the capacitors as close or on the board as recommended by the Datasheet. Attach wires between the Pro Mini and the sensor according to the test circuit diagram. Hot glue the MLX90316/adapter board to the bottom servo cover, to get a distance of 1/8" to 1/4" between the sensor and the magnet with the cover installed. Test the operation of the sensor using the Arduino sensor test sketch. With an external motor supply of 3 to 5 volts, the sensor readings should move consistently on the Arduino serial monitor.
Complete the wiring of the Pro Mini to the motor driver and motor per the final circuit diagram. Hot glue the Pro Mini and motor driver to the outside of the servo case.
Program the Pro Mini with the servo_mod_MG996R_PID.ino Sketch; you may want to temporarily un-comment some of the Serial output code to see the current range of your controller device. If you get values different from the code in the sketch, just substitute your values instead. Test servo action using a servo tester or your own controller, and compare range to a standard servo. The output range can also be adjusted if desired in the sketch (in the map function).
Step 3: Enjoy Modified Servo
The modified full range servo works quite well. In the program, the PID control is set to all proportional, but could be fine tuned to include integral and derivative constants if required. The wear prone potientiometer was replaced with a non-contact hall sensor for infinite feedback sensor life.
Ideas for the full range servo include evil clown head twisting Halloween props, realistic turrets in model aircraft and tanks, camera pan and tilt control, and geared output applications.