PID robot heading--comments?

Okay, this is an idea that I’ve been thinking of over the past few days. Basically the problem is that obviously steering is going to be quite hard this year, specificlly in regard to the fact that to steer the robot effectivley one will likely have to make a lot of course corrections due to oversteering and the effect of the trailer behind the robot

My idea:Implement the steering control as a PID loop, where the ideal robot heading was determined by a joystick, and the actual heading was determined by a gyro mounted on the robot. Then use this to determine the offsets sent to the motors in order to turn the robot. Each time the PID calculation was run, the gyro would be zeroed.

The thing is, I’m not sure if this would actually hold water. Has anyone used a similar system, or does anyone have any advice about it?

I’ve had a similar idea of using a PID loop to control robot heading. I’ve been experimenting with the idea of PID Heading Control on our old 2008 robot, which seems to fair nicely. Though with the new wheels, I’m not sure how much effect a loop would have, but it could prove VERY useful if it can be used wisely.

It shall have to wait until tomorrow when I can play with a robot with the new wheels. :slight_smile:

-Tanner

Using the gyro is an ok idea, but keep in mind that your gyro will drift naturally over time (without vibration, ours was drifting about 1 deg/minute today in the shop).

Much worse than that however, is that if your robot gets hit hard (likely in this high-contact game) you’ll briefly exceed the gyro’s maximum speed which will mess up your current heading calculation.

We were thinking of something similar, but rather than aiming to point the robot at a certain absolute angle, have the X position of your joystick describe a desired turn rate in degrees per second, then have a PID loop attempt to achieve that.

Much worse than that however, is that if your robot gets hit hard (likely in this high-contact game) you’ll briefly exceed the gyro’s maximum speed which will mess up your current heading calculation.

Oh yeah…good point. I’ll have to do some experiments to see how much of an issue this is

Use an Accelerometer to know if there was a sirious bump and use it to define what the robot will do in a bump. I’m sure the Accelerometer can detect bumps from diffrent angles and report them to the cRIO.

The loop should be just as effective with the new wheels, your gains will just be significantly different, for example if you are turning a large number of degrees with traditional wheels you can just slow the wheels and let friction stop you. However with the new wheels you may need to try to drive them in the opposite direction at the end of the turn to slow the robot quickly and avoid oscillation.

Another concern is that friction between the carpet around the outside and the wheel is much greater than the friction between the plastic and the wheel, this will likely cause less than desirable results if part of your robot is on the carpet.

-James

That’s the whole point of using the PID. when you hit the carpet, and your equal motor speeds cause robot rotation, the gyro picks it up and corrects by slowing down the more frictionful wheels.

It is correct to say (as above) that you don’t have to control the actual heading (called “position loop”), but you could instead control the rate of change of heading (“velocity loop”).

many machine tools (milling machines, waterjets, etc) use two layers of PID. one position loop, and one velocity loop “inside” it.

The position loop says “I’m going to need to be here, so go this fast” to the servo amplifier (a fancy speed controller). The Amplifier then says “I need to be going this fast, so I should use this current” to decide what to send to the motor.

Since a First robot may not care about the absolute heading, the position loop can be left out.