Go to Post The best defense is a good offense, never back down - Nawaid Ladak [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 17-11-2011, 11:35
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Control testing

Hey everyone. I am new to creating robotic controls using sensors - the digital encoder. I was wondering if anyone knew how to obtain the number of counts that a digital encoder gives through one rotation of a motor shaft so that I can find the "distance per count" constant for our program. Also our encoder is a 4x if that has any play on anything.

Also I wish to use the encoder as a sensor for a PID loop to control the rotational angle of a shaft. Recently I had learned of motor control profiling and I was wondering if any one could explain how this works as well as how to program it. Much thanks!

PS: I'm using LabView and Java
  #2   Spotlight this post!  
Unread 17-11-2011, 11:44
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,854
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Control testing

The easy way to get distance per count is to:
  • Add a readout of the raw encoder value (essentially set distance per count = 1)
  • Layout a tape measure
  • Push your robot slowly 5 or 10 feet (or if it's an arm measure the rotation)
  • Divide count readout by inches pushed to get distance per count in inches.
  • Repeat to verify
You can calculate the value by knowing:
  • The number of counts per revolution of your specific encoder (all transistions for 4x)
  • gear reduction through transmission starting at the encoder mount point (not necessarily matched to the motor shaft rotation)
  • sprocket reduction between the output shaft and the wheel
  • The wheel circumference
  • Verify as before with a tape measure, readout, and pushing the robot a known distance
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 17-11-2011 at 11:51.
  #3   Spotlight this post!  
Unread 17-11-2011, 19:57
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Re: Control testing

Thanks! I tried to test to see if we could just get feedback from the encoder and I noticed something odd: the rate of the Encoder Get was 0 even though I was reading a change in the distance output. What might be causing this?
  #4   Spotlight this post!  
Unread 17-11-2011, 21:12
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,854
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Control testing

The rate might be too slow to register, but it could be this known bug (there's a solution at the very end).
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 17-11-2011 at 21:23.
  #5   Spotlight this post!  
Unread 18-11-2011, 00:17
theNerd's Avatar
theNerd theNerd is offline
Registered User
FRC #3329 (Cam Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2110
Location: St. Marys
Posts: 51
theNerd is an unknown quantity at this point
Re: Control testing

Quote:
Originally Posted by Mark McLeod View Post
The rate might be too slow to register,.
Thanks! I wont be able to test the code till the 28 (Thanksgiving break....) but I think the off season update should solve the problem.

Also what are some ideal rates to set for minimum rate? The encoders are plugged into the 2010 KOP AndyMark gear boxes - I'm not sure of their rpm. Thanks!
  #6   Spotlight this post!  
Unread 18-11-2011, 08:26
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: Control testing

Quote:
Originally Posted by theNerd View Post
Thanks! I wont be able to test the code till the 28 (Thanksgiving break....) but I think the off season update should solve the problem.

Also what are some ideal rates to set for minimum rate? The encoders are plugged into the 2010 KOP AndyMark gear boxes - I'm not sure of their rpm. Thanks!
You can look the model up to find out its specs from US Digital. I recall the model used being http://www.usdigital.com/products/en...rotary/kit/e4p It says on the website max RPM is 60,000 mechanically constrained. Count per revolution of the model appears to also factor in determining the actual RPM with examples of 360CPR =10,000 and 100CPR = 36,000

Last edited by MagiChau : 18-11-2011 at 08:34.
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 19:02.

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