GPS, Intertial Sensor, PID

Hello. My team just got a GPS sensor, and A Inertial sensor. we already have a PID, so we are wondering what we should do. We could scrap the PID and use the GPS sensor, or we could add the gps sensor to PID if that is a thing, or we could do something that some one suggests. Thank you!

PID and the GPS sensor aren’t replacements for each other. PID takes a sensor input, compares that value to a target, and produces a control signal. the GPS sensor is just a fancy sensor that you can use as another input for your control systems, including PID.

12 Likes

Ok. would the GPS sensor benefit from A PID?

A GPS sensor tells you where your robot is, nothing more. Without some kind of control loop your robot will not move autonomously. PID is one such control loop that could be implemented, though there are many more advanced options as well that can be implemented on top of a PID loop.

10 Likes

Well, if the GPS sensor is a more precise and more accurate sensor that whatever your current PID is using (I am assuming tracking wheels and a rotational sensor) then you could build a new PID with the GPS sensor. Another possibility is running your standard PID then using the GPS sensor to tell you where you are after the fact and use that information to adjust the next desired value in the PID possibly. There are a lot of options here.

1 Like

or you could use Pure Pursuit(which would take a ridiculous time to learn), or a modified and simplified version. we are currently trying to use the GPS to track the robot’s position relative to it’s target, and then drive in a constantly changing arc to get to that position. It’s still a work ing progress though.

1 Like

The WPI team who provide a rich library for FRC, seem to believe that Pure Pursuit is best suited for holonomic drives, and, instead favor Ramsete for skid-steer drives.

Regardless, they have some very nice documentation on trajectory generation and path-following: Trajectory Tutorial — FIRST Robotics Competition documentation

I’ve also found this YouTube series to be a very approachable explanation of Pure Pursuit and how to implement it: FTC Programming: Pure Pursuit Tutorial 1 - YouTube

5 Likes

We are currently using good old distance formula
image
where current x is x1 and desired x is x2 and
probably not the greatest way, but is super accurate

4 Likes

So, a bit unrelated, would you all say that the gps sensor is consistent in its readings and how it is running?

Once calibrated, the GPS sensor has been very consistent in its position for me.
The one point I don’t like is that it can’t see its position in the corners of the field.

2 Likes

We use two for that reason, when one of them has a low quality ready we switch it to the other one.

2 Likes

your school must be loaded. we found one perfectly accurate; when it can’t read the code, it uses other sources to calculate its position until it can read the GPS code again.

Wait you can use two?

Why wouldn’t you be able to? It’s just another sensor

1 Like

Hold up…

My post is a little late, but…

Yes, that is a thing, we use both the gps and a PID (technically two PIDs working together).