Go to Post We call ourselves community/family. We are. Our kitchen table where we gather is the size of Chief Delphi. - JaneYoung [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 09-10-2013, 01:01
mkaa00x's Avatar
mkaa00x mkaa00x is offline
Momo
AKA: Mohammad Al-Ahdal
FRC #4627 (Iron Manning)
Team Role: RoboCoach
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Calgary, Canada
Posts: 38
mkaa00x is an unknown quantity at this point
Question Suggestions on a good way to get angle?

Hey guys! we need a somewhat powerful motor than can also calculate angle, we want this motor to be able to turn all the time and for infinite rotations in either direction, (so kinda like a Mini CIM or maybe even a CIM although it can measure angle of it's rotation [0-360degress])

I'm not good at all with this sort of stuff, as in I'm not good with parts but once I know how they work I'll program them anytime. soooooo like is it possible to use a servo? is it turn-able over and over or how would we use some sort of encoder to calculate angle? helps please
Reply With Quote
  #2   Spotlight this post!  
Unread 09-10-2013, 01:08
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,823
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Suggestions on a good way to get angle?

Yes and no.

Servos do come in continuous-rotation variants--that is, they just keep going to get to where you want them. The problem is, FRC rules limit the max power of a servo to far lower than you'd need for most applications. If you need a CIM or Mini-CIM, sorry, not going to work. (Actually, there ARE larger servos--but cost becomes an issue, as does size, and definitely FRC legality.)

You could try a stepper motor, but you'd have no way of knowing whether or not you actually made it to the point you want to get to.

Your best bet, given the power and continuous rotation, is a quadrature encoder, with a PID loop to slow the motor down as it gets close to a set stop point. If continuous rotation wasn't a concern, I'd suggest a potentiometer instead.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

Reply With Quote
  #3   Spotlight this post!  
Unread 09-10-2013, 01:13
mkaa00x's Avatar
mkaa00x mkaa00x is offline
Momo
AKA: Mohammad Al-Ahdal
FRC #4627 (Iron Manning)
Team Role: RoboCoach
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Calgary, Canada
Posts: 38
mkaa00x is an unknown quantity at this point
Question Re: Suggestions on a good way to get angle?

Quote:
Originally Posted by EricH View Post
Yes and no.

Servos do come in continuous-rotation variants--that is, they just keep going to get to where you want them. The problem is, FRC rules limit the max power of a servo to far lower than you'd need for most applications. If you need a CIM or Mini-CIM, sorry, not going to work. (Actually, there ARE larger servos--but cost becomes an issue, as does size, and definitely FRC legality.)

You could try a stepper motor, but you'd have no way of knowing whether or not you actually made it to the point you want to get to.

Your best bet, given the power and continuous rotation, is a quadrature encoder, with a PID loop to slow the motor down as it gets close to a set stop point. If continuous rotation wasn't a concern, I'd suggest a potentiometer instead.
Yeah, I understand how a PID works... WAIT THE SERVO HAS UNLIMITED AMOUNT OF ROTATIONS??? So technically, if we were to have a servo that would feed data to an input by making sure that we don't power up the servo in anyway... we can use (in Java) the .getAngle (or whatever it was) method for measuring an angle, correct? Like I know it may not have enough power but it can work side by side with a cim. Right?

*EDIT*

Oh and I haven't found any servo that does that, can you like send me a link too, if possible of one that has continuous rotations? If not I can try asking one of the builders on our team
Reply With Quote
  #4   Spotlight this post!  
Unread 09-10-2013, 01:29
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: Suggestions on a good way to get angle?

Soo... does this need to be FRC legal or cheap? If you answered no to *both* of those questions, I would recommend Dynamixel servos :) If it's for the robot (for some non-competition thing), they'll be way more trouble than they're worth. Just had to get that out there :)
Reply With Quote
  #5   Spotlight this post!  
Unread 09-10-2013, 01:31
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,823
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Suggestions on a good way to get angle?

Quote:
Originally Posted by mkaa00x View Post
Yeah, I understand how a PID works... WAIT THE SERVO HAS UNLIMITED AMOUNT OF ROTATIONS??? So technically, if we were to have a servo that would feed data to an input by making sure that we don't power up the servo in anyway... we can use (in Java) the .getAngle (or whatever it was) method for measuring an angle, correct? Like I know it may not have enough power but it can work side by side with a cim. Right?

*EDIT*

Oh and I haven't found any servo that does that, can you like send me a link too, if possible of one that has continuous rotations? If not I can try asking one of the builders on our team
One step at a time:

1) Servos have unlimited rotations IFF they are Continuous Rotation (CR) servos. Example: http://hitecrcd.com/products/servos/...-servo/product. Other servos on the same site may or may not be CR, and may or may not be modifiable to be CR.

2) Servo feeding data to an input, ugh! Servos are designed to be used as motion sources, not data sources. You could use it... but for one thing.

3) Guess what the servo's sensor actually is? IIRC, it's a small encoder.

4) A CIM would exert an awful lot of force on that servo. The linked servo is only rated at 52 RPM, 46.8 oz-in rated torque. To put this in perspective, that's 1% of the CIM free speed and 13% of the CIM stall torque. Servo might not survive more than a little time unless the motor was removed. At which point, you have a small encoder.

So, let's go through how to read an encoder for angle:
1) Determine how many counts it takes to go through one 360-degree turn. Divide by 360 to get counts per degree (or divide by 2*pi for counts per radian, which the computer might like better).
2) Get the count from the encoder as to how far it's traveled (and in which direction) from the last stop point.
3) You now have a number of counts, and a number of counts per angle. With a little math, you can eliminate the number of counts and come up with an angle.

Speaking as an ME, I wouldn't want to use a servo when a sturdier encoder was available, and most likely cheaper.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

Reply With Quote
  #6   Spotlight this post!  
Unread 09-10-2013, 02:10
mkaa00x's Avatar
mkaa00x mkaa00x is offline
Momo
AKA: Mohammad Al-Ahdal
FRC #4627 (Iron Manning)
Team Role: RoboCoach
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Calgary, Canada
Posts: 38
mkaa00x is an unknown quantity at this point
Talking Re: Suggestions on a good way to get angle?

Quote:
Originally Posted by EricH View Post
One step at a time:

1) Servos have unlimited rotations IFF they are Continuous Rotation (CR) servos. Example: http://hitecrcd.com/products/servos/...-servo/product. Other servos on the same site may or may not be CR, and may or may not be modifiable to be CR.

2) Servo feeding data to an input, ugh! Servos are designed to be used as motion sources, not data sources. You could use it... but for one thing.

3) Guess what the servo's sensor actually is? IIRC, it's a small encoder.

4) A CIM would exert an awful lot of force on that servo. The linked servo is only rated at 52 RPM, 46.8 oz-in rated torque. To put this in perspective, that's 1% of the CIM free speed and 13% of the CIM stall torque. Servo might not survive more than a little time unless the motor was removed. At which point, you have a small encoder.

So, let's go through how to read an encoder for angle:
1) Determine how many counts it takes to go through one 360-degree turn. Divide by 360 to get counts per degree (or divide by 2*pi for counts per radian, which the computer might like better).
2) Get the count from the encoder as to how far it's traveled (and in which direction) from the last stop point.
3) You now have a number of counts, and a number of counts per angle. With a little math, you can eliminate the number of counts and come up with an angle.

Speaking as an ME, I wouldn't want to use a servo when a sturdier encoder was available, and most likely cheaper.
OH! I get it! so basically servos are encoders + motors, they're easier to program because half the code is already there, I can use a CIM + encoder although I'd need to become a nerder nerd and nerd out nerdy maths to get the answer for the value of the angle made by the CIM and basically set a value, until angle reaches approximately point A, keep making the CIM spin in 1 direction.

Thanks so much
Reply With Quote
  #7   Spotlight this post!  
Unread 09-10-2013, 02:38
BBray_T1296's Avatar
BBray_T1296 BBray_T1296 is offline
I am Dave! Yognaut
AKA: Brian Bray
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Rockwall, TX
Posts: 947
BBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond repute
Re: Suggestions on a good way to get angle?

Getting a motor with >1000RPM to stop exactly where you want it with 1/4 of a turn of tolerance is not impossible, albeit extremely difficult, especially with various FRC-rules related constraints.

I am guessing you want to stop the output of some gearing system within that tolerance. at that point, your rpm will be significantly slower (not the 5000RPM of a CIM) and accomplishing that task will be orders of magnitude easier, but CIMS (and bag motors, and fisher price motors) are going to be hard to control so precisely unless they have a very high reduction.

We used the AndyMark am-0914 gearmotor with an additional 3:1 (roughly) reduction (total of 213:1 +/-) and only had 1 full degree of tolerance, and we were using a jaguar and PWM. The problem is, under the large load we had, the difference between stalling and running too-many RPM is so small, PWM-wise, that you will find yourself oscillating to no avail.

While only trying to get 1/4 rotation seems easier, It can lead to failure. With a system, if I told the robot to rotate (say, an arm) 2.5 rotations, It would end up very close to 2.5. However, If I told it to rotate 0.25 rotations, 10 times, It may be likely to end up closer to 2.25 or 2.75 without high precision and accuracy.

We had that problem when our robot auto targeting tried to correct when we shot basketballs (rebound rumble). Over the course of the match, the robot's zero (what it thinks is its starting position [actually started perfectly forward]) ended up maybe 10 degrees off. Of course, it didn't particularly matter in that case, It just thought the goal was a little further around than it was, the camera still said it was straight on (and it was).

In a FIRST setting, you don't have all day to run a motor at 2% power until it is perfectly spot on, you have 3 seconds before that defense bot rams you again.
__________________
If molecular reactions are deterministic, are all universes identical?

RIP David Shafer: you will be missed


Reply With Quote
  #8   Spotlight this post!  
Unread 09-10-2013, 09:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,124
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: Suggestions on a good way to get angle?

Quote:
Originally Posted by mkaa00x View Post
o get the answer for the value of the angle made by the CIM and basically set a value, until angle reaches approximately point A, keep making the CIM spin in 1 direction.
Unless you have a "one direction only" requirement, that's not how it should work.

Say you're at an angle of 85 degrees and you want to be at 80 degrees. Wouldn't it be better to go back 5 degrees than to go forward 355 degrees?

BTW, the C++ WPILib code does exactly that:

Code:
 *  Set the PID controller to consider the input to be continuous,
 *  Rather then using the max and min in as constraints, it considers them to
 *  be the same point and automatically calculates the shortest route to
 *  the setpoint.



Reply With Quote
  #9   Spotlight this post!  
Unread 09-10-2013, 10:34
buildmaster5000 buildmaster5000 is offline
Trying to program the swerve drive
AKA: Alex
FRC #2421 (Rolling Thunder Robotics)
Team Role: Alumni
 
Join Date: May 2009
Rookie Year: 2009
Location: Northern Virginia
Posts: 207
buildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud of
Re: Suggestions on a good way to get angle?

As soon as I read the requirements that the OP posted, I immediately thought of the US Digital MA3. It is an absolute magnetic encoder with continuous rotation (think potentiometer with unlimited turning ability). If you hook up a CIM motor and this sensor to a PID controller, you should be able to achieve your desired behavior
__________________
-Alex



2010 Washington DC Regional: Engineering Excellence Award
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 05:28.

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