Go to Post I'm sure they liked the size and power output but disliked when they were on fire. - notmattlythgoe [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-01-2014, 22:23
Matt_4505 Matt_4505 is offline
Registered User
FRC #4505
Team Role: Programmer
 
Join Date: Nov 2012
Rookie Year: 2012
Location: United States
Posts: 16
Matt_4505 is on a distinguished road
Precise Motor Control

Hello,

This year my team is spinning a CIM motor to move a throwing arm and I will have to keep the CIM going at a specific speed. I was wondering how the control values -1 <-> 1 (fed to a Jaguar) compare to the CIM's RPM? Is there a more efficient to go about controlling the motor? Thank you!
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2014, 22:35
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Precise Motor Control

You could figure out how a power value compares to an RPM through trial and error, but I would not recommend it at all.

Instead, if you have an encoder or a potentiometer around, you can use a PID control loop. There are numerous paper on CD of the code and use. The loop will use the present and past velocities of the arm (this is why you need a sensor) in comparison to the target velocity in order to compute an updated motor value. The motor value will get updated many times a second, helping your arm reach target velocity quite quickly ("quickly" depends on what motors, gearing, and mechanical arm you have). Good control loops represent programming on a higher level and can simplify quite a bit of work for your drivers, so they can focus on driving.

If you have any more questions, feel free to PM me.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner

Last edited by Aaron.Graeve : 09-01-2014 at 22:37. Reason: Grammar
Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2014, 22:35
Tanaythan's Avatar
Tanaythan Tanaythan is offline
Programmer
AKA: Tanay Nathan
FRC #3256 (Warriorborgs)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2010
Location: San Jose
Posts: 27
Tanaythan is an unknown quantity at this point
Re: Precise Motor Control

The most efficient way of controlling a motor's RPM precisely is to have some sort of sensor control it (such as an encoder) and using a control system monitor the power sent to the Jaguar. The most common types used for robotics are PID and Bang-Bang, which have been documented well around chiefdelphi.
__________________
Tanay Nathan
Programmer
Team #3256 Warriorborgs
Reply With Quote
  #4   Spotlight this post!  
Unread 09-01-2014, 22:37
Owen Makin Owen Makin is offline
Registered User
FRC #1972
 
Join Date: Jan 2013
Location: CUHS El Centro
Posts: 50
Owen Makin is an unknown quantity at this point
Re: Precise Motor Control

Think of the values as a percentage of the voltage of the battery, being sent to the motor. How you get around that depends on what language you use to code.
Reply With Quote
  #5   Spotlight this post!  
Unread 09-01-2014, 22:40
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: Precise Motor Control

Quote:
Originally Posted by Owen Makin View Post
Think of the values as a percentage of the voltage of the battery, being sent to the motor. How you get around that depends on what language you use to code.
The only issue with that is, depending on the specific speed controller, the value to power graph is not linear, is different for each type of speed controller, and can be different between two controllers of the same model.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner
Reply With Quote
  #6   Spotlight this post!  
Unread 09-01-2014, 22:44
Matt_4505 Matt_4505 is offline
Registered User
FRC #4505
Team Role: Programmer
 
Join Date: Nov 2012
Rookie Year: 2012
Location: United States
Posts: 16
Matt_4505 is on a distinguished road
Re: Precise Motor Control

Thanks! I'll look into using an encoder!
Reply With Quote
  #7   Spotlight this post!  
Unread 09-01-2014, 23:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Precise Motor Control

Quote:
Originally Posted by Tanaythan View Post
The most common types used for robotics are PID and Bang-Bang, which have been documented well around chiefdelphi.
Not as common, but used successfully by some teams, is TBH. You'll find LabVIEW, C, and Java examples in this thread:

http://www.chiefdelphi.com/forums/sh...d.php?t=105965


Reply With Quote
  #8   Spotlight this post!  
Unread 10-01-2014, 10:17
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Precise Motor Control

Would TBH be more viable than PID for an application with a continuously changing setpoint (such as regulating drive wheel speed)?
Reply With Quote
  #9   Spotlight this post!  
Unread 10-01-2014, 10:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Precise Motor Control

Quote:
Originally Posted by ekapalka View Post
Would TBH be more viable than PID for an application with a continuously changing setpoint (such as regulating drive wheel speed)?
Controllers are characterized by such factors as dynamic response, stability, steady-state accuracy, etc. Since PID has 3 tuning parameters and TBH has only one, PID can handle a wider range of applications.

I suspect TBH would not work as well as PID for the application you described. You might not be able to set the TBH gain high enough to get the response you want without causing instability.

Any teams out there who have used TBH successfully for drivetrain wheel speed control?



Last edited by Ether : 10-01-2014 at 13:45.
Reply With Quote
Reply


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


All times are GMT -5. The time now is 12:43.

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