Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Servo Motors (http://www.chiefdelphi.com/forums/showthread.php?t=112584)

KissMySass3763 02-02-2013 11:56

Servo Motors
 
I am trying to program a servo motor in a true/ false statement o that when a button is pressed, the servo motor will rotate. I really have no idea how to do that, or even if I should be using a case structure at all. Where do I start?

Madeline

Mark McLeod 02-02-2013 12:19

Re: Servo Motors
 
What you desire to have happen probably needs better definition.

Here is an example of pressing and holding a button to move a servo.
When the button is released the servo returns to a preset position.


If you want the button to move the servo permanently to a position, then a simple case statement might do it.

KissMySass3763 02-02-2013 12:40

Re: Servo Motors
 
It may be better defined as a timed system, but with no timer involved. I want the button to tel th servo to rotate 180 degrees and then return to the origional angle, but without having to hold the button down. do not know if that is even possible.

Mark McLeod 02-02-2013 12:44

Re: Servo Motors
 
That would have to be a timed action.
There is no sensor feedback built in to the servo that your code can call to check to see when the servo reaches the 180 degree mark.
All your code knows is that it ordered a turn to 180 degrees, not whether the servo arrives there or not.

You'd have to add a potentiometer that your code could read from for feedback.

KissMySass3763 02-02-2013 13:07

Re: Servo Motors
 
How would I write the code for a timer, and then wire it into my code for the servo, in that case?

Mark McLeod 02-02-2013 14:42

Re: Servo Motors
 
You have a couple of options.

Here is one that works only in Periodic Tasks.vi, but is pretty straight forward:


If you want it in Teleop.vi, then you have to set a timer and check it each time through Teleop to act when the timer expires.


All times are GMT -5. The time now is 12:06.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi