Quote:
|
Originally Posted by jaustin
It's as if the rc variable is getting randomly set, and when it moves to the next command it does not recognize it (even thought it did the last time it ran).
|
Possibly a memory overwrite. You might generate a .map file and check it to see where your arrays are falling relative to the memory location of rc (i.e., those at lower addresses can overwrite higher addresses), and print the values of rc to see if it's really random. Make sure rc is static or global.
For the unbalance power of the left vs. right drive I'd test both at max pwm (forward and backward) and then begin slowing the faster side until the sides are balanced. That'll give you a more concrete measurement of the magnitude of the problem. The motors, chain, wheels all contribute to mismatched power, but it's not usually so severe. This is actually one of the exercises I put the new programmers through, by purposely unbalancing things (through s/w or mechanics) and having them rebalance in software.
P.S. The difference is usually proportional or close to it, so you can apply a percentage of the max correction at slower pwms.