Hi all,
I’m back to working on traction control code, and it doesn’t seem to work The first thing that I’m trying to get working is to get the wheels to go at the same velocity as the robot.
Here’s the setup: we have an omni (trailer) wheels on each side of the robot, plus encoders on the omnis and on each transmission. This lets us see the velocity the wheels are going, and the velocity the robot (via the omnis) is going.
Here is my algorithm for maintaining the velocity indicated by the omni wheels, in pseduocode:
pidSetpoint = getOmniVelocity() // get velocity according to encoder on omni wheel
pidCurrentPoint = getTransmissionVelocity() // get velocity according to encoder on transmission
change = calculatePID()
newMotorSpeed = currentMotorSpeed + change
I do use different PID’s for the left and right (that would be a stupid bug!) However, this code seems to make the robot go at the correct speed for a while, and then it starts to get faster and start spinning in circles! Does anyone have any ideas as to why this might occur?
Secondly, my plan is to decide if we’re slipping (getOmniVelocity() and getTransmissionVelocity() differ enough) and then kick in the PID correction code until the slipping is over. Does anyone have any real-world success using this (albeit simplistic) method? I’m worried that it will become jerky.