Go to Post we would all build robots to play "rock-paper-scissors" if FIRST told us to, cause it is just so freakin' much fun to build a robot until 2:30am every night for six weeks! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 21-03-2009, 22:32
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,537
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Traction control: How do I tune a PID controller with variable gain?

Simply add 1 to the denominator of your ratio before dividing by it. This will elimate your infinity case.

Is pushing the joystick forward negative or positive? I can't remember.

I only ask because assuming you're accelerating, you're adding a positive value to your joystick. I'm curious if you should be adding that positive number, or subtracting it to decrease acceleration.

Last edited by Tom Line : 21-03-2009 at 22:36.
  #17   Spotlight this post!  
Unread 22-03-2009, 20:10
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Traction control: How do I tune a PID controller with variable gain?

Forward is negative, so said the HID designer who must have flown planes or been thinking of a flight simulator or something.

Greg McKaskle
  #18   Spotlight this post!  
Unread 22-03-2009, 21:18
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
Re: Traction control: How do I tune a PID controller with variable gain?

Thanks Greg! It wasn't too intuitive to me as to why forward would be negative so I decided to multiply the getaxis outputs by a -1. This way I could add the traction control PID correction to this value and then submit that value to the motor controller.

On another note, we were able to get our traction control to work for the most part. I will summarize our method and will then outline some problems and ask questions.

Here is a summary for our traction control:
-calculate the slip ratio (driven wheel velocity-follower wheel velocity)/max_velocity. max_velocity=100in/s (for us).
-submit this slip ratio to the process variable of a PID controller.
-P=3 (for us), I=0,D=0
-add the PID output value to the current driver command to correct for slip if needed.

note: the max_velocity used in the slip ratio is defined as the maximum linear velocity of the wheels when the robot is off the ground.

Problems:
1)I am using the slip ratio of 0% instead of the optimum 20%. With my algorithm, there will be always be an error if the robot isn't moving because slip ratio would be zero in that case.
2)when I floor the joystick forward, traction control works pretty well. Then if I let the joystick go and fly back to center, I get some jerking in the driven wheels. If i were to bring the joystick back slowly, the jerking doesn't occur.

What am I asking?:
1) I'm not using sending a variable gain to the PID controller as discussed by team 121. The variable gain would be calculated as K*slip ratio. Is this a good idea? This method would seem to allow me to use a slip ratio setpoint of 20% and not cause an error greater than 0 when the robot isn't moving.
2) Should I filter my slip ratio and motor commands somehow? If so should I use a lowpass filter or something similar? Or a rate limiter? I would like to remain simple and effective.
3)With my current algorithm, if I floor it forward and then floor it backwards, the wheels lockup. This makes sense (PID limits: -1 to 1 and full reverse = -1 command = motor command of 0). I would like the wheels to speed up in the direction the bot is moving and pull the robots speed down. I'm thinking that the variable gain PID method would do this for me. What do you think?

I have a pdf of my code attached if any of you want to dive into the code.
Attached Files
File Type: pdf traction_ctrl3.pdf (181.5 KB, 60 views)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Traction contron w/ multichannel PID control rohoRaider NI LabVIEW 2 17-02-2009 20:41
Using PID for traction control (help!) ellisk Programming 2 07-02-2009 14:05
PID traction Control dpeterson3 C/C++ 5 26-01-2009 21:11
Demo: Simple robot arm with a PID controller mtomczak Programming 1 17-01-2008 02:17
How to tune a PID loop? steve d Programming 3 11-02-2007 20:49


All times are GMT -5. The time now is 04:22.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi