I have code with two limit switches to move up or down a PG71. That motor is on a slide and when I hit the up button it’ll go up. when I hit the down button nada. But when I physically hit the bottom limit switch the motor will move up until let go. once the top one is hit the motor is stuck until I move it off of the limitswitch and I physically move it down because my button does not work. Pictures down below thanks for any help! http://i.imgur.com/HjGkr4j.png
I think your issue is with the in range/coerce towards the right of the code. You might want to see about replacing that with a T/F select (like the ones in it already) to choose between the three values. Have it so that “if limit_bottom true, give 0 for down, give 1 for up (if pressing)”.
I think your logic of using the coerce function is very clever. However I think you want a constant of -1 for the lower limit switch coerce function to allow the motor to go up.
Hi,
Let me see if I have this correct. You are currently for a lift up/down command, setting a value of +/-1, and then trying to correct that value depending on whether the limit switch on the top/bottom is pressed.
I would recommend a different approach. After getting a command to lift, check first if the limit switch is pressed. if it is, do nothing; if it is not, assign the correct +/-1 depending on lift direction.
Hope this helps.
I think your problem is the values going to the bottom range input of the In Range and Coerce function. The select function controlled by the TuskBottomStop switch will give it either 0 or 1, which will keep the motor from ever going down, and will force the motor to go up when the switch is pressed.
Try changing the 1 to a -1 instead.