02-02-2012 01:14 PM
Hi,
I took the example Velocity Profiling and modified it for two motors, the error came out said no Board ID are wired, but they are wired. Can anyone check the code for me please?
Thank you
CKH
Solved! Go to Solution.
02-02-2012 03:29 PM
Please ignore the first post, I found another sample than can control 2 axes at the same time, this is exactly what I need. However, the motors will not stop after i click the stop button, I have to run another program to make them stop, is there any way I can fix the issue? Another question I have is, how can I make 1 motor run CW the other one run CCW?
Thank you
CKH
02-02-2012 03:30 PM
This is the code.
02-03-2012 11:26 AM
Hi there. Let me try to answer your questions.
1) To stop the motors, you have to include a "Stop Motion.flx" function outside of the while loop. This way, when you hit the stop button on the front panel, it exits the while loop (that's what the stop button controls), and then the "Stop Motion" functions execute and stop the motors. I've attached modified code that should accomplish that.
2) To go the other direction, try putting in a negative velocity.
I hope this helps. 🙂
02-03-2012 11:27 AM
I didn't attach the file. Woops! A classic mistake.
02-03-2012 11:38 AM
Hi Ravi,
Thanks for the reply, I solved the direction problem by adding negative sign on the step poistion, I'll try the velocity as well.
Thank you,
CKH
02-07-2012 03:27 PM
Hi Ravi,
I tried to put the stop motion into my vi, but the motor still moving forward after I hit the stop button, I have to go to MAX manually reset the poistion "Reset Position button". Is there other way that I can stop the program whenever I want?
Thank you,
CKH
02-07-2012 05:40 PM
Hi Ravi,
I solved the stop button problem now, but is there a way to reset the position to 0? After I stop the motor and try to run it again, it will pick up previous position and continue the count from that specific position, I know I can try to reset it in MAX, but just wanted to know if there is any easier way to do.
Thank you,
CKH
02-08-2012 12:07 PM
Hi CKH,
So right after your Stop Motion.flx VI, you can put a "Reset Position.flx" VI, located in the Functions Palette at Vision and Motion >> NI 73xx >> Trajectory Control. The attached screenshot shows you where it is. If you'll notice, the functions around here provide many control options for your motor, many of the operations you perform in MAX.
I hope this helps. 🙂
02-08-2012 04:12 PM
Hi Ravi,
Right now I am looking for much simpler way to switch the motor direction, from CW to CCW, I'm thinking making a switch do the work. I know I can just mannually added a negative sign in front of the target position, but I think if I can just add a trigger switch function, this might be easier. Is there any way to do it, I was thinking duplicate the same code but using "negative sign" times the "position" to make it negative target position under "case structure".
The following is the vi I created before adding the trigger switch.
Thank you,
CKH