Go to Post Another lesson is don't post on Chief Delphi disappointed, stop and evaluate first. Emotions suck sometimes. :-) - sircedric4 [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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 08-01-2013, 23:57
Robobuff1.0's Avatar
Robobuff1.0 Robobuff1.0 is offline
Registered User
FRC #1633
 
Join Date: Jan 2011
Location: Arizona
Posts: 46
Robobuff1.0 is an unknown quantity at this point
[FTC]: LABVIEW: Help with programming an Arm with an Encoder

Hi I am fairly new at programming using an encoder and need some assistance. I wanted to program an arm with an encoder to go to a position and HOLD THERE on the press of a button until ANOTHER BUTTON is pressed. (so like a loop keeps running holding the arm in place, like if the arm is lower than it should be the code moves it back up and if its higher moves it lower... until another button is clicked) I'm using Labview. I need help please!!!
__________________
FRC: 1633
FTC: 2873
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2013, 00:04
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: [FTC]: LABVIEW: Help with programming an Arm with an Encoder

Quote:
Originally Posted by Robobuff1.0 View Post
Hi I am fairly new at programming using an encoder and need some assistance. I wanted to program an arm with an encoder to go to a position and HOLD THERE on the press of a button until ANOTHER BUTTON is pressed. (so like a loop keeps running holding the arm in place, like if the arm is lower than it should be the code moves it back up and if its higher moves it lower... until another button is clicked) I'm using Labview. I need help please!!!
http://www.chiefdelphi.com/forums/sh...05&postcount=1

Have you successfully been able to read an encoder?

Do you know how to program buttons to select setpoint values?

If you could articulate what part of the problem you are struggling with, it would help in getting you the answers you need.




Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2013, 00:13
Robobuff1.0's Avatar
Robobuff1.0 Robobuff1.0 is offline
Registered User
FRC #1633
 
Join Date: Jan 2011
Location: Arizona
Posts: 46
Robobuff1.0 is an unknown quantity at this point
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder

Yes I was able to get the encoder to got to a set position however the loop ends once it is at that position so the arm goes back down. I want it to stay there until I tell it no to. And no I don't know how to use button to setpoint
__________________
FRC: 1633
FTC: 2873
Reply With Quote
  #4   Spotlight this post!  
Unread 09-01-2013, 08:18
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 753
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder

Quote:
Originally Posted by Robobuff1.0 View Post
Yes I was able to get the encoder to got to a set position however the loop ends once it is at that position so the arm goes back down. I want it to stay there until I tell it no to. And no I don't know how to use button to setpoint
Without seeing your code, it's hard to know how/when you are issuing move commans to the arm.

It could be one of several problems.

The Motor controller could be timing out after you issue the move command (this is to prevent a bad move burning up your motor), or you could be issuing the return command without meaning to.

If the arm goes limp a short period after making the correct move, then it's probably the timeout.

You need to use the watchdog VI (in the tetrix pallett) in order to keep the motor controller alive.

One way to do this would be just to put it in the main control loop.
A better way would be to creat a loop that runs slower, so you are not making the call faster than you need to.

If the motor Drives itself back to the other position than you are probably sending the command yourself. One way to debug this is to put a beep in the program where you issue each commands. High beep for position 1, low beep for position 2. Thenyou can 'hear' what your program thinks it's doing.

Sound is your friend on the NXT.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #5   Spotlight this post!  
Unread 09-01-2013, 21:28
Robobuff1.0's Avatar
Robobuff1.0 Robobuff1.0 is offline
Registered User
FRC #1633
 
Join Date: Jan 2011
Location: Arizona
Posts: 46
Robobuff1.0 is an unknown quantity at this point
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder

Okay here is a picture of my code. So is it correct? I want the motor to go to the encoder position and hold.
Attached Thumbnails
Click image for larger version

Name:	Code.png
Views:	64
Size:	9.5 KB
ID:	13442  
__________________
FRC: 1633
FTC: 2873
Reply With Quote
  #6   Spotlight this post!  
Unread 09-01-2013, 21:38
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 753
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder

Quote:
Originally Posted by Robobuff1.0 View Post
Okay here is a picture of my code. So is it correct? I want the motor to go to the encoder position and hold.
Since you have reset the encoder, it will start out at zero, and you are giving a positive power, so the encoder value will go up.

Which means that test: Encoder > -360 will be true immediately, so the loop will exit immediately. So perhaps it should be > 360.

Some suggestions....

You really should have a "wait" in that loop because once it starts working, it will lock up the program for the duration of the arm move (which may not be a good idea) You should maybe wait for 25 to 50 msec.

Also., once the loop exits, if you don't send a new motor command in 2.5 seconds, it will droop down again.

FTC used to have a "move to position" (rather than "Move fixed distance")which would do exactly what you want here, with a single call, but I couldn't find it this year (had to roll my own).

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #7   Spotlight this post!  
Unread 09-01-2013, 21:46
Robobuff1.0's Avatar
Robobuff1.0 Robobuff1.0 is offline
Registered User
FRC #1633
 
Join Date: Jan 2011
Location: Arizona
Posts: 46
Robobuff1.0 is an unknown quantity at this point
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder

okay I have added the wait for 25 milliseconds and How would I make the motor stay in that position until another button is pressed instead of just exiting the loop like in my code
__________________
FRC: 1633
FTC: 2873
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 08:03.

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