|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder
Quote:
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. |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||||
|
|||||
|
Re: [FTC]: LABVIEW: Help with programming an Arm with an Encoder
Quote:
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. |
|
#4
|
||||
|
||||
|
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
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|