Go to Post [You know you're proud to be a FIRSTer when...] You explain to someone how do do something, they go off and do it, come back and ask, "is this right?" and you say, "Yes." . - NorviewsVeteran [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 05-02-2012, 16:10
kairichingu kairichingu is offline
Registered User
FRC #2437
 
Join Date: Jan 2012
Location: Hawaii
Posts: 2
kairichingu is an unknown quantity at this point
stop loop with encoder

Our team is trying to control our arm with an encoder to make the motor start when we push a button and stop when the encoder reads a certain voltage. We are able to make the motor run, however we are unable to stop the motor when the encoder reads that voltage.

We set the loop condition to stop when true (when the voltage is greater than 3) through an accelerometer vi since we are reading voltage. We have tested the encoder with the Accelerometer Angle example, so I'm pretty sure that it is running correctly. I've attached our code below and we are stumped as to why it is not working. Also, we noticed that on the driver station the Analog Input gives different values than we expect. Could anyone tell us whether to base our numbers off the readings on the dashboard or the Accelerometer Angle example? Thank you!
Attached Thumbnails
Click image for larger version

Name:	encoder code.PNG
Views:	28
Size:	19.6 KB
ID:	11739  
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2012, 16:30
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: stop loop with encoder

Even if your loop exits, there is nothing to set the motor speed back to 0. You need a motor set output outside the loop to stop the motor. Make sure you wire through the reference from the inside of the loop so the "set to 0" part doesn't run until the loop is complete.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2012, 16:46
kairichingu kairichingu is offline
Registered User
FRC #2437
 
Join Date: Jan 2012
Location: Hawaii
Posts: 2
kairichingu is an unknown quantity at this point
Re: stop loop with encoder

this seems to have fixed our problem! thank you
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:25.

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