Go to Post "But from a real life standpoint, that looks like something the evil villains in a superhero movie would use to get around in" Reading the phrases "real life" and "evil villains in a superhero movie" in the same sentence makes me giggle. - Alan Anderson [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
  #1   Spotlight this post!  
Unread 10-02-2003, 13:16
Matchew Matchew is offline
Registered User
#0892
 
Join Date: Jan 2002
Location: Canal Winchester ohio
Posts: 15
Matchew is an unknown quantity at this point
Send a message via AIM to Matchew
need glp programing steering with a steering wheel

does anyone have a good way to steer witha steering whell i mean program . on our bot right now it is four whell drive an has quad steering but we can't figure out how to get the wheels to go back you center. the motor goes to fast so it kinda over corrects itself and it goes back and forth until finally it finds the center.
  #2   Spotlight this post!  
Unread 10-02-2003, 13:44
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
Okay. I'm going to assume that your wheel is simply a potentiometer with a wheel attached. This means that it will simply read a value between 0 and 254, 0 all the way left, 254 all the way right. One solution to your problem of over correction would be what my team has come to call a "slew rate." We have incurred the same problem letting our joystick snap back into place, and it kind of bounces around. What you must do is ramp the speed of your rotation. I will do it with the default tank drive code, since I am not sure what your drive code is, but it should be easy to apply to your code.

pwm1_old var byte
pwm2_old var byte
slew_rate CON 5 'Or however much you decide it should be

pwm1_old = pwm1
pwm2_old = pwm2
PWM1 = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) -2000)
PWM2 = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) -2000)
'The above two lines could be replaced by your current code

If (abs(pwm1-pwm1_old) < slew_rate) then noslew1
If pwm1>pwm1_old then pwm1=((pwm1_old+slew_rate)MAX 254)
If pwm1<pwm1_old then pwm1=((pwm1_old-slew_rate)MIN 0)

noslew1:
If (abs(pwm2-pwm2_old) < slew_rate) then noslew2
If pwm2>pwm2_old then pwm2=((pwm2_old+slew_rate)MAX 254)
If pwm2<pwm2_old then pwm2=((pwm2_old-slew_rate)MIN 0)
noslew2:

This code stores the old value of the motor outputs, then assigns the new motor output based on the joystick (in your case a steering wheel. It then goes on to check if the new value is "close enough" to your old value, in other words within your constant, 5 in my case. If it is not within the constant, it adds or subtracts the constant to the old value, and assigns it to your new motor output.
This will, in effect, add or subtract a constant to your motor speed every loop until it reaches the correct point on your steering wheel.
I hope this helps you out!
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
  #3   Spotlight this post!  
Unread 10-02-2003, 14:20
ttedrow's Avatar
ttedrow ttedrow is offline
Herding electrons
AKA: Tim Tedrow
FRC #0281 (EnTech)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2000
Location: Greenville, SC
Posts: 165
ttedrow will become famous soon enoughttedrow will become famous soon enough
Matchew,

I'm confused about your setup. Do your wheels turn (left and right) or are you using differential speed (skid steer) to turn you robot?

If you have true quad steering (left and right) then you will need position feedback so the BS program will know where the wheels are pointing. Then a control loop will need to be programmed. (see White Papers ) for control loop programming.

Good Luck

Tim Tedrow
__________________
Sr. Design Engineer
Caterpillar Inc.
Greenville, SC

KD4EGM

FRC 281 Greenvillains
Infected with the FIRST virus in 2000

Yes, Chute Door!!!
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
4 wheel steering/ Crab Huey_Da_X-cat Technical Discussion 3 11-02-2002 22:49
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32


All times are GMT -5. The time now is 19:20.

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