Thread: PID Questions
View Single Post
  #2   Spotlight this post!  
Unread 04-02-2008, 06:51
Doug Leppard's Avatar
Doug Leppard Doug Leppard is offline
Registered User
FRC #1902 (Exploding Bacon)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Orlando
Posts: 435
Doug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond reputeDoug Leppard has a reputation beyond repute
Send a message via AIM to Doug Leppard
Re: PID Questions

We are a six wheel bot. We are using PID in the autonomous mode but not the driver mode. Unless done right it will fight the drivers. Drivers have PID built into their brain.

PID is more of an art than science. First you must understand the science about it and then use the art to tune it.

You don't use at all times all the letters of PID.

For going straight using encoders we are now just using the P part. That is simply subtracting one encoder from the other that will be the P. Then we just add that to a basepower of each wheel, one wheel we add another wheel we subtract. Basepower is the power it takes to adjust the speed you want to go.

BTW I do not do speed PID. It gets really complicated to have a speed and a straight PID at same time. I am not the best at PID and I know some can do it, but I don’t want to mess with it. This year we are on a flat surface, so a set basepower will allow you to go about the same speed each time, especially sense the batteries are fresh for that 15 seconds.

Now remember each wheel encoder will be off because each wheel is not exactly thee same, on our test bot they are 5% off from each other so we adjust that.

How this would look in code:

propostional = (LeftEncoder-RightEncoder)*Pfactor

Pfactor you have to experiment with, we are using 1.

Leftpower = basepower + proportional
Rightpower = basepower - proportional

That will get you going very straight if your encoders in 10 ft will give you the same readings.

For the turn we did something similiar. Don't have time forr that right now, maybe later see if this makes sense and works, you can tell me you are ready for a turn later.

BTW we might use the I integral to even fine tune the straight even more.
__________________
Doug Leppard