|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Accurately "Arcing" in Auton/Hybrid Mode
to do our arc, we tell the robot to do a certain number of rpms on each side of the wheel base, using the following (pseudo) code:
Code:
VForward = 40; omega = dist_from_wall / some_constant + desired_dist_from_wall / some_constant; wheel_left = VForward + omega; wheel_right = VForward - omega; |
|
#2
|
||||
|
||||
|
Re: Accurately "Arcing" in Auton/Hybrid Mode
Quote:
I just was thinking about that once you've posted! That's one of the options, and it looks like it would make an accurate turn. I'll play with this tomorrow and see if this would work out for us. Thanks! |
|
#3
|
|||
|
|||
|
Re: Accurately "Arcing" in Auton/Hybrid Mode
Hey Kiet. I did some thinking about how to do this earlier but haven't talked to anyone on 254/968 about it, so I'll just tell you here.
Here's some of the math I came up with: If: V_L = Velocity of the left wheels V_R = Velocity of the right wheels w = Width of robot (distance from left wheels to right wheels) Then: Code:
omega = angular speed = (V_R - V_L) / w r = turning radius = w/2 * (V_R + V_L) / (V_R - V_L) So if you use Uberbots' code and do V_R = v + x, V_L =v - x, then you can solve for x for a desired r: Code:
x = w/2 * v/r Using the gyro and encoders like Adam suggested will work too. In that case you can calculate the turning radius from just V_L = left velocity, and omega = gyro output: Code:
r = V_L / omega + w/2 Last edited by Jay Lundy : 07-04-2008 at 02:32. |
|
#4
|
|||
|
|||
|
Re: Accurately "Arcing" in Auton/Hybrid Mode
By the way, if you do use a PID loop to control the velocities I think you can improve stability (ie overshooting) and probably even response time by using both feedback and feed-forward control.
Instead of sending this to the motors: Code:
pwm_out = PID(e) // PID is your PID function, e is the speed error Code:
pwm_out = guess(target_velocity) + PID(e) By the way your straight drive code uses the same idea (both sides are fed throttle and the PID loop just makes small adjustments to keep them at the same speed). Last edited by Jay Lundy : 07-04-2008 at 03:41. |
|
#5
|
|||||
|
|||||
|
Re: Accurately "Arcing" in Auton/Hybrid Mode
Quote:
I would caution, though, that you probably want to code it like this: Code:
pwm_out = feed_forward_gain*guess(target_velocity) + (1-feed_forward_gain)*PID(e) This clamps your output, and lets you use the same gains as in the pure feedback case. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Championship Event - Where the "Random" Match Sorting Really "Shines" | Travis Hoffman | Championship Event | 57 | 19-04-2007 08:06 |
| 2006 game poll #4 (type of "sensing" in autonomous mode) | dhitchco | Rumor Mill | 1 | 18-11-2005 12:27 |
| New NEMO White Papers! "Creating a Killer Packet" and "25 Ways to Sponsor" | Jessica Boucher | Team Organization | 0 | 10-08-2005 10:55 |
| "Thunderbirds" Vs. "Team America" Which one will rule the box office? | Elgin Clock | Chit-Chat | 3 | 07-09-2004 19:53 |
| Why use "Invisible Mode"? | Steve Howland | CD Forum Support | 1 | 15-08-2004 11:18 |