[PATCH] Reverse working with kit ESCs


The ESCs I received in my kit didn't work all the way down to 0, they seem to cut out around 17. This meant reverse didn't work for me via the keyboard.

My patch to limit the low end to 20 is here: https://github.com/mikenz/openrov-software/commit/a409b68aa567768a18826a8e814cf8dbea7cfe43

This allowed me to run all the motors from the keyboard as expected.


I encountered exactly the same problem after I had calibrated the ESCs using the cockpit's diagnostic function (I calibrated 0=full reverse, 90=neutral, 180=full forward).

Although Mike's solution will work fine when using the keyboard for speed control, there is a disatvantage of just limiting the values that go to the arduino to values above 20 when using the gamepad, because you lose a large part of the joystick's control range.

Instead of just limiting the output values, scaling the the control range from -90 to +90 to values between a min and a max value (e.g. -70 and +90) in ArduinoPhysics.js (see attachment) would be the right way. By setting the min/max value pair to -50/+50, the issue of brownouts (see http://openrov.com/forum/topics/basic-throttle-limits-in-arduino-software-to-fix-brownouts) could also be addressed without changing the Arduino firmware.

By extending the cockpit software, the min/max values could by changed via the browser, so it yould be very easy to find the right throttle values (it would be best to be able to do this for each motor separately).



Hmm... never post software changes before having tested it ;)

Here is an update with correct scaling of values, including the vertical thruster. Additionally, I removed the exp() function for better response to the gamepad joysticks.



I just loaded the new ArduinoPhysics.js (with the min/max values at -50/+50) and tested in my ROV. It works perfectly. I now have forward and reverse on all three motors without the dropout with reverse value below 20. There seems to still be plenty of power available from the props at this reduced level.

We next need to limit the range of the camera servo to not push the mechanical limit when pointing down (Z key).

Thanks Stefan,



Hi Jim,

yes, the servo issue. I think the Hitec HS-81 servo was not designed for full 180 degrees of rotation. In addition, the design of the electronics chassis does not allow for a rotation angle of 180 without getting in conflict with the cable harness entering the acrylic tube.

The (plastic) gear of my HS-81 eventually broke, and I replaced it with a HS-82 with a metal gear. Well, with this servo having a robust gear, the servo electronics overheated and died. Finally I managed to assemble a working servo out of the remains of both.

Then I limited the rotation angle to 90 degrees (45 to 135 degrees instead of 0 to 180) by modifying ArduinoPhysics.js:

physics.mapTiltServo =
function (value) {return value + OFFSET;};

was modified to

physics.mapTiltServo =
function (value) {return -value/2 + OFFSET;};

(I added the minus sign because the servo direction was originally inverted)

This works fine now. However, there is also an issue with a constant servo jitter when the servo has reached one of its end positions which comes from the servo trying to hold the exact postion, which adds a constant current of 100 to 500 mA and surely will lead to another servo damage not to speak of the faster draining of the batteries.

To overcome this, I'm currently experimenting with a version of the Arduino firmware which detaches the servo each time a position is reached and, in addition, turns the servo much slower in order to remove stress from it's electronics and mechanics.



thanks for the update. I will monitor your progress and maybe try somethings myself. I am busy trying to fit everything in the tube without it rubbing right now.




This is great! I've been concerned that even the HS-82 wouldn't have enough torque to rotate the electronics chassis (it always has a lot more friction against the tube then I'd like) so if slowing the rotation down and turning the signal off when you've reached the desired position works please let us know. It would be great if we could actually get the E-chassis to rotate. Also, I was thinking that wrapping the outside of the E-chassis with packing tape might help with friction. Do you think that would be any good?




After some experiments with the firmware I can say:

  • the servo jitter definetly can be removed by detaching the servo in the firmware after a new position has been reached
  • slowing down the servo speed (I used the VarSpeedServo library) does NOT help to solve the friction issue

Regarding the friction issue: it turns out that even after keeping all elements except the e-chassis itself from touching the inner side of the acrylic tube (see here), friction is still too high to make the servo turn the e-chassis smootly. The fricition is caused by the sheer weight of the e-chassis liing on the bottom of the tube. Funnily I also thought of using packing tape to reduce it, but just rubbing with some tape on the outer side of the tube shows that this probably would not make it any better. I also made experiments with aluminium foil and teflon lube, but neither worked.

Now the idea is to prevent the e-chassis from putting its weight to the tube. This could be achieved by suspending the e-chassis between both endcaps. While the servo horn would be the bracket at one side, the syringe at the other side could be used in combination with a metal pin to make the other bracket.

I already set up this construction and it is very promising, but during all the tests the servo (the second already) quit service. This time, there was a short circuit in the servo (probably due to overheating) which made the servo's ferrite bead on the cape spectacularly vanish into smoke. Grrr.

I ordered a new servo already - once I got it, I will continue the experiments and come up with my findings regarding both the e-chassis suspension and the jitter issue.



Maybe a bearing mounted on opposite side of the e-chassis from the servo could work?

one could have a bearing resting on the diameter of the syringe, and a hole in the e-chassis that goes on the outer ring of the bearing.

There are alot of bearings in the rc-car world that could work, i have a really slim bearing on my hpi sprint that i think can be used: http://www.hpieurope.com/piw.php?lang=en&partNo=b030

this should have large enough inner diameter to fit over the syringe, but not so big it would consume alot of space.