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
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°…