04-29-2018 02:53 PM - edited 04-29-2018 03:11 PM
Hi
Im currently controlling linear servo motor with Labview and ran into a problem. I need to stop the motor immediately when it reaches the endlimit sensor. The problem is, that the endlimit sensor value is not as stable as I would like and sometimes has the same value, as it does when the motor has actually reached the endlimit. Therefore the motor stops without reaching the end.
I tried to use while and for loops to see if the value stays high long enough to be sure that the motor has truly reached the end.The problem I had with this was that while the for/while loop was checking the value, rest of the code was stopped and waiting for them to finish. Is there a possibility to get case structure and while/for loop running at the same time? Or is there a different way to solve the problem?
EDIT: I think its worth to mention I'm using Arduino UNO to measure the voltage of the endlimit sensor. It seems that the initilization seems to be the problematic part of it.
04-30-2018 06:14 PM
How are you currently controlling the motor, and what logic do you have implemented with the end limit? In addition, could you elaborate on the endlimit sensor value not being stable? Attaching your code could be useful in this situation.
05-01-2018 01:02 PM - edited 05-01-2018 01:11 PM
Hi
Sorry for the late answer, but it seems that I have found a solution for my problem already using the event structure. Under the endlimit sensor value not being stable I meant it changing between 4-5V even when the limit was not reached.