|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Using PID for traction control (help!)
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: Code:
pidSetpoint = getOmniVelocity() // get velocity according to encoder on omni wheel pidCurrentPoint = getTransmissionVelocity() // get velocity according to encoder on transmission change = calculatePID() newMotorSpeed = currentMotorSpeed + change 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. |
|
#2
|
|||
|
|||
|
Re: Using PID for traction control (help!)
I would have to see more more of your code to tell for sure, but by your description it sounds like your loop just needs some tuning. The spinning in circles is classic PID overshoot.
We use a box with 3 pots (one for P, I, and D) so we can tune without reloading the code. |
|
#3
|
|||
|
|||
|
Re: Using PID for traction control (help!)
Turns out that left and right were swapped
The person on our software them (I'm looking at you, Ben) who wrote wrappers over the motors got them mixed up. As a result, we have spent about 2 weeks working on inexplicably buggy drive code. ![]() It works now, though. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using encoders for traction control help | ellisk | Programming | 13 | 03-02-2009 19:56 |
| PID traction Control | dpeterson3 | C/C++ | 5 | 26-01-2009 21:11 |
| Integral Window for PID Control | phrontist | Programming | 2 | 16-02-2008 17:32 |
| PID for velocity control | SuperBK | Programming | 13 | 04-02-2008 23:16 |
| Problems Using PID for Velocity | Astronouth7303 | Programming | 6 | 10-02-2006 09:00 |