Go to Post "It's not a bug, it's an unlisted feature." - Barry Craig [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 02-11-2016, 03:31 PM
parbas parbas is offline
Registered User
AKA: Parker
FRC #4701 (WIRE)
 
Join Date: Dec 2013
Rookie Year: 2013
Location: United States
Posts: 5
parbas is an unknown quantity at this point
CIM Motor Reversing

We're having an issue with a CIM motor operating in reverse. In our code, we have a CIM motor set to go forward for half a second and then in reverse for half a second (both at full speed) at the press of a button. The issue is that the motor does not go back to it's starting position like we thought it would. It goes further back than it was when it started, which is causing an arm to move further and further back with each button press.

Any ideas?

Thanks!
  #2   Spotlight this post!  
Unread 02-11-2016, 03:33 PM
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is online now
#wheatcoastneatcoast
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (F3)
Team Role: Student
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 292
Bkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud of
Re: CIM Motor Reversing

I'd try to put an encoder on the motor and controlling it through a PID loops.
  #3   Spotlight this post!  
Unread 02-11-2016, 03:43 PM
Brian C's Avatar
Brian C Brian C is offline
Doer of Whatever
AKA: Brian Cholerton
FRC #1468 (J-Birds)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1999
Location: Islip Terrace Long Island-NY
Posts: 323
Brian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant futureBrian C has a brilliant future
Re: CIM Motor Reversing

Electric motors are designed to operate with more effective power in one direction than another. This is done through the timing of where the armature and commutator in relation to the field magnets.

It sounds as if your initial button push is spinning the motor in "reverse" and your second movement is the motors "forward" rotation. If you're trying to stop an arm at a specific point then limit switches or a potentiometer would really be the best option.
__________________
2016 Season; Game Announcer at
NYC Regional
SBPLI Long Island Regional
  #4   Spotlight this post!  
Unread 02-11-2016, 03:47 PM
Knufire Knufire is offline
Rose-Hulman Institute of Technology
no team
Team Role: College Student
 
Join Date: Sep 2009
Rookie Year: 2010
Location: Terre Haute, IN
Posts: 733
Knufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond reputeKnufire has a reputation beyond repute
Re: CIM Motor Reversing

Quote:
Originally Posted by parbas View Post
We're having an issue with a CIM motor operating in reverse. In our code, we have a CIM motor set to go forward for half a second and then in reverse for half a second (both at full speed) at the press of a button. The issue is that the motor does not go back to it's starting position like we thought it would. It goes further back than it was when it started, which is causing an arm to move further and further back with each button press.

Any ideas?

Thanks!
There are many variables you are not controlling. Things like battery voltage, arm. angle (the load on the motor required to move the arm when it is horizontal is much more than when the arm is vertical), the motor may be biased in one direction, etc. Simply applying a percentage of battery voltage for a specified amount of time isn't going to let you preciely control the position of the arm.

You will need to put a sensor on the arm joint to measure the angle of the arm, and use that measured angle in code with a control loop to control the position of the arm.
__________________
Team 469: 2010 - 2013
Team 5188: 2014 - 2016
NAR (VEX U): 2014 - Present
  #5   Spotlight this post!  
Unread 02-12-2016, 12:48 AM
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,536
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: CIM Motor Reversing

In particular with an arm, the load on the arm is almost always preferentially in one direction (probably what you are referring to as "back"). All other things being equal or even close, it will take more volt-seconds to raise a load than to lower it. If you need to get it to a certain spot, use an encoder, potentiometer, limit switch, or other sensor to tell when the process is complete.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
  #6   Spotlight this post!  
Unread 02-12-2016, 05:00 AM
cbale2000's Avatar
cbale2000 cbale2000 is offline
Registered User
AKA: Chris Bale
FRC #0703 (Phoenix)
Team Role: Leadership
 
Join Date: Apr 2006
Rookie Year: 2004
Location: Saginaw, MI
Posts: 927
cbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond reputecbale2000 has a reputation beyond repute
Re: CIM Motor Reversing

Quote:
Originally Posted by GeeTwo View Post
In particular with an arm, the load on the arm is almost always preferentially in one direction (probably what you are referring to as "back"). All other things being equal or even close, it will take more volt-seconds to raise a load than to lower it. If you need to get it to a certain spot, use an encoder, potentiometer, limit switch, or other sensor to tell when the process is complete.
To add to this, in a pinch, you can add a dead stop to the mechanism and then program it to slightly overshoot where you want it to go and always hit the dead stop, thus returning it to a consistent starting point. You do briefly stall the motor by doing this (though CIMs do have a bit of tolerance to this) and you have to have a mechanism beefy enough to take the repeated impacts, but if for whatever reason you are unable to add/program a sensor for the mechanism it will do the job. Just make sure you bring a spare motor or two. Of course this method pretty much only works with a 2-position mechanism.

That said, the other suggestions mentioned above are all far preferable to the option I just described. A physical dead stop for a mechanism should almost always be a last resort.
  #7   Spotlight this post!  
Unread 02-12-2016, 08:18 AM
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,536
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: CIM Motor Reversing

Quote:
Originally Posted by cbale2000 View Post
To add to this, in a pinch, you can add a dead stop to the mechanism and then program it to slightly overshoot where you want it to go and always hit the dead stop, thus returning it to a consistent starting point. You do briefly stall the motor by doing this ..
If you go this route, also monitor the current on that motor. A spike in current (other than during startup) will alert you to hitting the stop. Not elegant, but better than nothing.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
  #8   Spotlight this post!  
Unread 02-12-2016, 08:42 AM
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 113
aeastet is an unknown quantity at this point
Re: CIM Motor Reversing

Encoders are easy to use and take no time to install. Look into that before doing something like dead stopping your arm. That could cause many other issues with voltage spikes and brownouts.
  #9   Spotlight this post!  
Unread 02-12-2016, 08:57 AM
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 285
gpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to all
Re: CIM Motor Reversing

Quote:
Originally Posted by aeastet View Post
Encoders are easy to use and take no time to install. Look into that before doing something like dead stopping your arm. That could cause many other issues with voltage spikes and brownouts.
Encoders are not hard, but limit switches are even easier - especially with the new SPARK speed controllers which have limit switch inputs. No software!!! You dont even need to stop driving up or down based on time, just leave the motor drive in the direction you want the arm. The limit switch cuts the power at precisely the right time. I strongly recommend limit switches tied directly to a speed controller (Spark, Jaguar or SRX) for this particular problem.

Also, a previous post talked about loads. Not knowing your system, I am going to make a wild guess that the first direction arm moves is "up" (against gravity) and the second, faster direction is "down" (with gravity). Gravity always wins - common design challenge with rotating arms.
  #10   Spotlight this post!  
Unread 02-12-2016, 09:03 AM
maxnz's Avatar
maxnz maxnz is offline
Can't wait for next season!
AKA: Max Narvaez
FRC #2855 (BEASTBot)
Team Role: Student
 
Join Date: Jan 2016
Rookie Year: 2016
Location: St. Paul, MN
Posts: 241
maxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of light
Re: CIM Motor Reversing

Potentiometers work too, but they can be harder to program.
  #11   Spotlight this post!  
Unread 02-12-2016, 09:05 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,997
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: CIM Motor Reversing


If you decide to go with limit switches, make sure to mount them in such a way that they don't also serve as a hard stop.

Common mistake.



  #12   Spotlight this post!  
Unread 02-12-2016, 09:33 AM
Zebra_Fact_Man's Avatar
Zebra_Fact_Man Zebra_Fact_Man is offline
]\/[ Go Blue!
AKA: Solomon
FRC #1076 (Pi Hi Samurai)
Team Role: Coach
 
Join Date: Mar 2012
Rookie Year: 2006
Location: Ann Arbor, MI
Posts: 454
Zebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant futureZebra_Fact_Man has a brilliant future
Re: CIM Motor Reversing

Quote:
Originally Posted by Ether View Post

If you decide to go with limit switches, make sure to mount them in such a way that they don't also serve as a hard stop.

Common mistake.



Seconded. You'll destroy your limit switch if you do.
-Knowledge from experience.

It boggles my mind that there are still people that think motors/gearboxes/axles are going to perfectly turn in opposite directions at the same speed/distance/force.
__________________
My Journey in FIRST:

Mentor/Coach/Engineer
2014-2016: Team 1076 - Pi Hi Samurai
____ 2014: Team 5220 - The Rockets
2009-2014: Team 313 - The Bionic Union/Bionic Zebras
Student
2006-2009: Team 313 - The Bionic Union
  #13   Spotlight this post!  
Unread 02-12-2016, 09:52 AM
maxnz's Avatar
maxnz maxnz is offline
Can't wait for next season!
AKA: Max Narvaez
FRC #2855 (BEASTBot)
Team Role: Student
 
Join Date: Jan 2016
Rookie Year: 2016
Location: St. Paul, MN
Posts: 241
maxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of lightmaxnz is a glorious beacon of light
Re: CIM Motor Reversing

Quote:
Originally Posted by Zebra_Fact_Man View Post
Seconded. You'll destroy your limit switch if you do.
-Knowledge from experience.
That happened enough times that we had to fashion a new 'detector' (the part that is hit and turns on the switch, not sure what it's called) out of a zip tie. It actually worked better than the metal did by not bending out of shape and staying there for the rest of the offseason event.
  #14   Spotlight this post!  
Unread 02-12-2016, 10:09 AM
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 285
gpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to all
Re: CIM Motor Reversing

Quote:
Originally Posted by Ether View Post

If you decide to go with limit switches, make sure to mount them in such a way that they don't also serve as a hard stop.

Common mistake.



Agreed. I have seen many smashed/mangled limit switches. This can be a huge issue, especially if the arm is moving fast. Locate the switch trip point about a half inch before the hard stop, such that when at the hard stop the switch is still tripped.

One way to make the "switch" more robust from damage with fast moving arms is to use a hall effect sensor like http://www.andymark.com/Electrical-p/am-3313.htm an put a small magnet on the arm.
  #15   Spotlight this post!  
Unread 02-12-2016, 10:37 AM
MrForbes's Avatar
MrForbes MrForbes is online now
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 5,937
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
Re: CIM Motor Reversing

...or mount the switch so that it is activated as the arm moves past it and hits the hard stop. There are many solutions.
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


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

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