Personal note: the children in the picture on my wall are my two grandchildren: Philip and James.
In order to have positive control of the Rover we need to make sure that when we tell it to go 5 feet, it only goes 5 feet and then stops! What we found so far is that the motors will allow the Rover to continue moving after stopping the pulses driving the H-bridges. Even though the state table of the H-bridges have a “Brake” state, it does not work with our motors.
Motors are composed of coils of wire (or windings) around a magnetic core. In order for it work, the motors would have to have two windings with either three or four wires – two per winding or have one common connection. The common would be tied to +V. With the other two wires grounded through the H-bridge the motor would be trying to go in both direction at the same time! Obviously this would not occur so the motor would effectively be braked instead of free-wheeling.
To stop the Rover from coasting I decided to try applying a few pulses in the reverse direction of the motion just completed. I found, by experiment, that two pulses at 50% duty cycle does a good job of stopping the motors without any noticeable reverse motion. My guess is that this will be dependent on the initial speed so I will probably have either a simple algorithm or a table look-up to determine the optimum parameters for braking. In either case, the values will be determined experimentally.
Another part of calibrating the motion is to determine how many pulses are required for specific distances. My initial tests were to find out how many pulses are required for one complete revolution of the wheels. Again, this is dependent on the initial speed. It was actually these experiments that forced me to figure out how to brake the motion. What I hve found so far is the following for one complete revolution of the motors:
- 6 or 7 pulses at 75% duty cycle
- 7 or 8 pulses at 50%
- 10 pulses at 25%
These numbers will probably change as Puck and I work on the Rover, but they at least get us started.