Go to Post I'm frustrated by the world's reluctance to bend over backwards for FIRST. - Madison [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 02-02-2013, 08:52
jibicax jibicax is offline
Registered User
AKA: Adina Paddy
FRC #3680 (Elemental Dragons)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2011
Location: NorthCarolina
Posts: 8
jibicax is an unknown quantity at this point
Encoders and Motors

My team wants a robot that you press a button and a "ramp" moves so many degrees up or down. So, like a limit switch but without the absolute endpoints. I know an encoder can do that, but I never worked an Encoder before. I went through the LabVIEW examples till I created the vi below (all the proper open boxes are there). Which starts the motor, but it doesn't stop. Basically, I'm asking how to make an encoder control a motors set output.

PHP Code:
[ATTACH]13753[/ATTACH
Attached Thumbnails
Click image for larger version

Name:	EncoderMotor.JPG
Views:	58
Size:	82.0 KB
ID:	13753  
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2013, 15:55
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: Encoders and Motors

Your problem is probably that the encoder does not measure in degrees. An encoder measures ticks per second, which is more suitable for measuring speed and distance than measuring angles.

I think your main problem, though, is that you're getting your current angle by dividing your Distance reading by 360 and taking the remainder. The Distance output will probably read something like inches or feet, depending on how you configured the encoder in Begin.vi. I would just experiment with different positions and find a more appropriate setpoint and process variable.

Or, if you really want to work with angles, you could try mounting a gyro sideways on your ramp. I don't think that's your best option, though.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2013, 16:55
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,833
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: Encoders and Motors

I'd look at using a potentiometer for this kind of task.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2013, 17:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Encoders and Motors

Quote:
Originally Posted by bvisness View Post
Your problem is probably that the encoder does not measure in degrees... An encoder measures ticks per second, which is more suitable for measuring speed and distance than measuring angles..
What an encoder "measures" depends on how its output signal is decoded. It can measure either angular position or angular speed. These can be converted into distance or linear speed.

http://en.wikipedia.org/wiki/Rotary_encoder

A gyro is a poor choice for measuring the angle of an adjustable ram.


Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2013, 17:51
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: Encoders and Motors

Quote:
Originally Posted by Ether View Post
What an encoder "measures" depends on how its output signal is decoded. It can measure either angular position or angular speed. These can be converted into distance or linear speed.

http://en.wikipedia.org/wiki/Rotary_encoder

A gyro is a poor choice for measuring the angle of an adjustable ram.


Ah, you're right. Thanks for correcting me. If you could get an encoder properly configured (which is something that I always have trouble with) that would almost certainly be your best option.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2013, 17:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Encoders and Motors

Quote:
Originally Posted by bvisness View Post
If you could get an encoder properly configured (which is something that I always have trouble with) that would almost certainly be your best option.
I think a potentiometer would be a good, perhaps even better, option for this application (low speed, limited rotation), as Mark suggested.


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 22:52.

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