There is a new version of WPILib on the web site that has some changes that were just added today to help us with some motor control. So here you go:
- Modified Motor function to be aware of the deadband in the Victor 884 speed controllers. The Victor 884 has a built-in deadband that runs from 117-137 of PWM values sent to it. The Motor function will now take values from 0-127 and 0-(-127) and scale them to fit into the actual working range of the Victor which is 23-116 and 138-232. This means that values sent to the motors will tend to be more continuous without the discontinuity in the range. The Motor function is used by Drive and Motors so if you use these functions, the change will be seen in those functions as well.
- There is another function added,
Code:
unsignd char GetPacketNumber(void)
that returns the OI packet number. Each time a new packet is received from the master processor this number is incremented. It is only a 8 bit value so it wraps around every 256 packets, but it provides an indication of when there is new data received.
Let me know if you find any problems, particularly with the Motor change. I think this will help - it did for some motors controlled by PID loops for us. There were too many conflicting controls and was getting very confusing.