Go to Post And, if you don't know what something means, say so, we'll be happy to explain. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Motors
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 22-01-2008, 21:31
molly molly is offline
Registered User
no team
 
Join Date: Jan 2008
Location: Pennsylvania
Posts: 2
molly is an unknown quantity at this point
Motor control for steering

Hi,
I am new to this. I want to steer the robot with an arrangemnt similar to the front wheel of a bicycle. At the top of the fork our plan is to mount a cim motor and gearbox.
does anyone know how well we can control the motor rotation to steer the robots.

Thanks!!!
  #2   Spotlight this post!  
Unread 22-01-2008, 22:08
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Motor control for steering

Get a single turn 100k pot, mount it to a sproket and start researching PID control. You will probably need P I & D to get good steering feedback. You also might be able to spring load the wheel to make it center itself once power is drop from the cim.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #3   Spotlight this post!  
Unread 22-01-2008, 22:41
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Motor control for steering

To expand on the above: Assuming the gearbox allows the shaft to turn slow enough, you tell the motor to turn in one direction (for example, PWM 0 means counter-clockwise, 255 means clockwise) until the potentiometer (attached to the steering "fork") reaches the desired position.

A potentiometer is a vailable resistor, they usually have about 270 degrees of rotation. Use a 5k or 10 k Linear potentiometer for this application (100k is too high a value). The center pin of the pot goes to thr Signal Input pin on the RC, one end pin of the pot goes to the RC 5 volt supply, the other end to the RC ground (All at the Analog inputs). This will return a value of 0 to 1023, depending upon position.

So, let's say a left turn is a 184 reading on your potentiometer: Command the motor to spin in the correct direction until the pot reads 184. Or, take the steering input from a joystick (0 to 255), multiply by 4, and that't the Pot's target value.

It really requires PI or PID control, not hard to implement but really important.

Don
__________________

I am N2IRZ - What's your callsign?
  #4   Spotlight this post!  
Unread 23-01-2008, 02:18
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Motor control for steering

Potentiometers are pretty much the tried and true system but also look into the US Digital Magnetic absolute Shaft Encoder ( Part number MA3-A-B8 ) A bit pricey but very accurate and 360 degrees of revolution so you can revolve the wheel without the limitation of the 270 most potentiometers allow. ( Order the connecting wire as well.)

Steve
  #5   Spotlight this post!  
Unread 23-01-2008, 07:47
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,792
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Motor control for steering

Quote:
Originally Posted by molly View Post
Hi,
I am new to this. I want to steer the robot with an arrangemnt similar to the front wheel of a bicycle. At the top of the fork our plan is to mount a cim motor and gearbox.
does anyone know how well we can control the motor rotation to steer the robots.

Thanks!!!
Molly,
I am guessing your plan is to use the CIM motor as the steering. Although this is a great motor for driving, the Globe motor may be better suited for you needs. It already contains a gear box that converts this little motor into a very powerful but slow system that lends itself well to the kinds of control systems mentioned above.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #6   Spotlight this post!  
Unread 27-01-2008, 10:27
DarKCroNo's Avatar
DarKCroNo DarKCroNo is offline
Registered User
FRC #2670
 
Join Date: Dec 2007
Location: Toronto
Posts: 37
DarKCroNo is an unknown quantity at this point
Re: Motor control for steering

Quote:
Originally Posted by Don Rotolo View Post
So, let's say a left turn is a 184 reading on your potentiometer: Command the motor to spin in the correct direction until the pot reads 184. Or, take the steering input from a joystick (0 to 255), multiply by 4, and that't the Pot's target value.

It really requires PI or PID control, not hard to implement but really important.

Don
Okay I understand that part, but how do I implement PID onto easyC?, Sorry but it's our rookie year and I've been reading on PID control and all I've been getting are the theory but I don't understand how to code it with easyC
  #7   Spotlight this post!  
Unread 27-01-2008, 17:06
Jaybee1405
 
Posts: n/a
Re: Motor control for steering

Very gutsy plan for a rookie team! I love it
  #8   Spotlight this post!  
Unread 31-01-2008, 14:10
David Fort David Fort is offline
Registered User
FRC #1001
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2003
Location: Cleveland, OH
Posts: 26
David Fort is on a distinguished road
Re: Motor control for steering

Quote:
Originally Posted by DarKCroNo View Post
Okay I understand that part, but how do I implement PID onto easyC?, Sorry but it's our rookie year and I've been reading on PID control and all I've been getting are the theory but I don't understand how to code it with easyC
Our team is struggling also (but using MPLab), so take my advice with a grain of salt, but the equations for PID are really pretty simple. A lot of teams use the C code from Kevin Watson
http://frc.kevin.org/frc/2005/naviga...2005_01_08.zip

there are files pid.c and pid.h in that zip file. There is a newer flavor of the same on his web page too, but the zip format was corrupt when i downloaded it.

I suggest you just take the pid function and implement the same formula using expressions and variables in Easy C. I've only used Easy C for about an hour, so I won't pretend to know exactly how to do that, but I'm pretty sure it is straightforward.

The Hard part is getting the "tuning" right. The tuning tells your control system how Much to correct for a given error. If you correct too much, you overshoot, and then get an error the other way, which overshoots back to the original side, etc. If you correct too little, then the steering will lag the joystick significantly.

To further complicate life, there are 3 factors of interest, the P, I, and D factors, and each of them contributes a different problem.

If I figure out a good tuning strategy, i'll let you know. :-)
Generally, I think people start with I and D zero, then get P so that it doesn't oscillate out of control, then increase I until the control loop reaches the desired steady state value in a reasonable time. There are lots of texts on it and lots of variations on the control scheme, but the challenge I find is that you get such a short burst of test before the steering is locked all the way to one side. It would be easier if you could test the response to various steps without hitting the stop. I guess I've blurred the distinction between steering position control and steering velocity control (i.e. a pid controlling the speed that the steering wheel turns). As I recall Kevin Watson has a version for position as well as for velocity. Sometimes (e.g. in the industrial robot I worked on in the '80s) there are several layers - an "outer" layer, controlling Position, which results in a Desired Velocity to turn the motor to correct the Position, which then produces a Desired Acceleration, which then produces a desired Torque, which then produces a Desired Current. I think it reasonable to attempt the Position and Velocity layers in a FIRST robot, and you might think of the other parts as the job of the Victor speed controller.

Also fwiw, we are using the Globe motor as recommended earlier, and I find it to be way faster than necessary even though it has a gear reduction box. That might contribute to the difficulty we are having tuning, and I sometimes wish we were using one of the worm drive motors instead.

EDIT: I see on the vex forum, someone has posted something about PID in EasyC. I didn't read it, but perhaps it is worth a look: http://www.vexforum.com/showthread.php?t=1510

Last edited by David Fort : 31-01-2008 at 14:15. Reason: Add link to similar topic on Vex forum
  #9   Spotlight this post!  
Unread 31-01-2008, 14:43
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,708
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Motor control for steering

As other have said, look into PID control. I'd personally recommend just trying P or PD control first and see if that gets you the desired results. Adding the I term to the system can introduce a lot of instabilities and problems if you're not careful. If you feel you must have it, keep your I gain as low as possible and look into adding "Integral Anti-Windup" into your control equation. The I term tracks errors over time and if your system simply can't meet your commanded value for some reason, then the I term can build up to a huge value, overflow your variable, etc. None of these things are good, so keep things simple at first and stick with P or PD control.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #10   Spotlight this post!  
Unread 02-02-2008, 19:05
David Fort David Fort is offline
Registered User
FRC #1001
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2003
Location: Cleveland, OH
Posts: 26
David Fort is on a distinguished road
Re: Motor control for steering

Quote:
Originally Posted by David Fort View Post
A lot of teams use the C code from Kevin Watson
http://frc.kevin.org/frc/2005/naviga...2005_01_08.zip
FYI, we downloaded Kevin Watson's example PID last night and reworked it for our situation and it worked OK once we got some good tuning numbers in it. (it was easier to tune our Vex robot than our FRC robot. On the other hand, the FRC robot was a much more exciting process)

One thing that has always puzzled me is where he divides the integral of the error by the pid_time. This seems like it calculates the average error, not the accumulated error. We deleted that part and it worked better. YAMMV.

Also on the "anti windup" stuff - we basically don't add the error to the error_i if the motor is already turning as fast as it can.

Not working 100%, but getting close.

David Fort
Team 1001
Hacksaw
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
Steering for mecanum? eyekantspel Control System 9 09-01-2008 21:58
Four Wheel, all steering, non-omniwheel, ONE power/motor source drive FizMan Technical Discussion 31 27-04-2004 12:12
need glp programing steering with a steering wheel Matchew Programming 2 10-02-2003 14:20
Gyrochip for Straight Steering, any tips? archiver 2001 1 23-06-2002 23:34
Motor Control archiver 2000 1 23-06-2002 23:01


All times are GMT -5. The time now is 03:27.

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