|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Traction Control in Autonomous?
I was wondering how you could integrate Traction Control while you are in autonomous mode.
What Traction Control requires is a constantly updating loop. The way we drive in autonomous is "Turn Motor On" "Wait a few seconds" "Turn motor off" During those few seconds of waiting does the traction control variables update? If they dont any ideas? |
|
#2
|
||||
|
||||
|
Re: Traction Control in Autonomous?
Something that we've been doing quite successfully is something to this effect:
Code:
double start = GetTime();
while (IsAutonomous())
{
double time_elapsed = GetTime() - start;
if (time_elaped < 0.5)
{
// time period of 0-0.5 seconds
speed = .25;
angle = some_N;
rotation = some_N;
}
else if (time_elapsed < 1)
{
// time period of 0.5 to 1 seconds
speed = .5;
angle = some_N;
rotation = some_N;
}
// ... and so on until 15 seconds
myDrive.Drive( speed, rotation );
}
As a bonus, we use the gyro to get the angle of the robot, and some things that can set the rotation parameter of our bot based on our current angle relative to the field so we can say "point the nose in this direction". Of course we have swerve/crab drive the so rotation stuff is a bit easier to implement since we can specify a heading and a rotation value. |
|
#3
|
|||
|
|||
|
Re: Traction Control in Autonomous?
We are using a simple ramp to drive in autonomous, of course we are only driving forward and spinning so that simplifies things a bit....
![]() |
|
#4
|
|||
|
|||
|
Re: Traction Control in Autonomous?
How is your code set up for traction control? You may very well be able to take the teleop traction control, put it into a function, and call it separately from both autonomous and teleop.
If you would like an example of code that achieves this, I'd be more than willing to send it to you to analyze. Or, if you sent me your code, I could look over it and give more specific details on how to implement it. Other than that, if you ramp up to speed, it will work -- traction control is more ideal, but it's not bad. |
|
#5
|
|||
|
|||
|
Re: Traction Control in Autonomous?
The traction control is setup using 2 encoders on each side of the bot.
It grabs the data from each encoder then stores it into a variable. If it detects the bots wheels are moving to fast (slipping) then is slows the motor speed down. It detects slippage like this encoder1 stores variable new / Makes one loop / new becomes old / encoder stores new / compare new to old. So basically it detects slippage and its suprisingly very accurate & works great for pushing people. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Traction Control- Help!!!! | naruto137 | NI LabVIEW | 0 | 21-02-2009 13:21 |
| Traction Control Poll | Zorkinian | Programming | 5 | 13-02-2009 11:06 |
| Implementation of Traction Control | keehun | Programming | 5 | 10-02-2009 10:02 |
| PID traction Control | dpeterson3 | C/C++ | 5 | 26-01-2009 21:11 |
| Traction Control Algorithm | Mr. Lim | Programming | 3 | 20-01-2004 14:26 |