PID Control

My rookie team has created their first cut at drive code. Currently, there is a lot of jerk motions and a lot of wheel spin. I’m quite impressed with what they have achieved so far, but i think there is a lot of room to improve. What I have been considering is using a PID controller. I have seen that this year there is a tutorial on the NI site to do just this. I was wondering what other teams were doing to achieve smooth controlled drive motion and if PID is a worth while path to go down? Thanks in advance.

A PID is a useful tool, but if you don’t know why the jerking and wheel spinning are taking place, you may be applying a SW band-aid rather than solving the problem. Similarly, there are other approaches that are simpler and won’t introduce instabilities like an improperly tuned PID can/will.

For example, if the drivers are just too aggressive with the stick, you can either let them practice until they learn not to spin and bounce, or you can lower the acceleration in the code. Both are simpler and more effective than a PID.

See if you can identify the problem more clearly, and ask again.

Greg McKaskle

I don’t think PIDs are going to be the best option, I think maybe having encoders and to stop it turning and spinning, and lower the gain on the controller

To echo the current sentiment in the thread…

PID may help you, but there are easier ways to fix this.

First - the jerking. Do you have multi-motor gearboxes on the drivetrain? If so, calibrate your motor controllers - nothing messes with fine control as much as having two motors trying to do different things when geared together.

Next - try a drive curve. Implement a deadzone so the robot doesn’t try to move when the speed controllers aren’t on enough to move it, and map the joystick inputs so that closer in the robot will try to move less, and ramps up quickly to maximum at the extremes.

Lastly - beware braking. Depending on your gear ratio, setting braking in the speed controller can either make you stop quickly and be hard to push, or can make you stop immediately when input isn’t given and cause the robot to move in a jerky fashion when the sticks move through the zero position.

Luck,

Sparks