02-05-2015 09:17 PM
Good day everyone,
The attachments include, the LV project file and the solidworks assembly for a hobby servo motor.
What I go to to work thus far : I got the position of the hobby servo motor's horn ( the circular part on the assembly file ) to rotate by a specific angle every x seconds ( i dont know the time interval). e.g when i set the angle to 10 degrees, it rotates by 10 degrees every x seconds continuously.
What I wish to get : I would like that when I set an angle, the hobby servo's horn rotates by that amount and stay there until I set a new angle for the position input. After which it will take that new angle, subtract it from the previous(current) angle and move to that amount.
for example : I adjust the angle to 50 degrees. The servo's horn should move to 50 degrees from the start point. I then adjust it to 60 degrees. The servo's horn should rotate by 10 degrees.
Note : the input for the positino is controlled by tha analog voltage received from a potentionmeter connected the an arduino on pin 0
Any other input you require from me, please feel free to ask 🙂
02-05-2015 10:22 PM
lzy,
Is this your final design project for college work? Looks like you need to learn more LabVIEW...
In any case, you could use a "feedback node" to store angle value from "last run" and then take a difference between that & latest live value to determine how many degrees you have to travel.
-BTC
02-06-2015 12:45 PM
Thank you BTC_Admin,
Its not for a final design project.
So with your help I was able to get it to rotate, but it still isnt rotating the way I want it.
Currently : If I set an anlge to 40 degrees, it rotates to 40 degrees continuously forever. If I then set it to 50 degrees it adds 10 degrees and rotates at 50 degrees forever. Also if it is at 50 degrees and I set it at 40 degrees it decreases to 40 degrees which is good but it still rotates forever.
What I still can't figure out and wish to have : First of all I wish that it can stay at the set position untill a new command is sent and not continuously rotate. Also when I input a negative angle it does not rotate the opposite way, instead it seems as though it is adding that negative angle with the current angle and rotating by that amount continuously.
I have looked at some loops to have it stop moving continuously but I cant seem to get it to work out :(.
I will be so glad if you can give me some directions
thanks
02-06-2015 01:27 PM
Edit : To make my objective simply stated, I wish to have the horn rotate from 0 - 360 degrees.
E.g If i set it to 90 degrees, then from a point x it rotates to the (x + 90) degree mark and stays there until a new command is given. If in the next command if i set it to 45 degrees it rotates to the (x + 45) degree mark. and lastly if after it is on the x+45 degree mark, i set it to 50 degrees it goes to ( x + 50) degree mark.
This sounds so simple yet its difficult for me. As you all can guess I am very new to Labview. :mansad: