From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Potentiometer for angle measurements

hei! 
I have a project on making a steering system on a scale model boat. So i have a potentiometer, servo, thruster and MyRio. 
The servo spin the thruster around in 360 degrees.

The potentiometer will say how many degrees the thruster is at. 

 

i have designed a program who can take the value from the potmeter (SIN and COS) and transfer dem into degrees. So if plot the truster to go to 70 degress (setpoint) it will do that. For this i use a PID regulator.
But i have a problem when the thruster is at 359 degress, it will go a little too far and go to 1 degree. the system then reeds 1 degree and spins the truster a whole round to 359 agian, then the same thing happens and that just goes on util i change the setpoint. 
So i need something so that the program understand that when it goes to 1 degree it will not that the whole round but just go back to 359 degress. 
Does anyone have some idea on how to solve this problem? 

 

attached a screenshot of the program

Download All
0 Kudos
Message 1 of 3
(2,547 Views)

Hi,

 

you need to program a little more logic into your VI!

 

For the start it may help to prevent "wrap ups" by counting upwards with 361° instead of jumping back to 1°…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,532 Views)

thanks, will try to look into that:)

0 Kudos
Message 3 of 3
(2,499 Views)