2 Limit Switchs, Serial on S4

Questions about using encoders with the Roboclaw product line
Post Reply
gearhead1
Posts: 3
Joined: Fri Feb 23, 2018 2:28 pm
2 Limit Switchs, Serial on S4

Post by gearhead1 »

Circuit Diagram attached.
General Settings and Position Settings, screens shots attached.
Note S4 is set to: " Motor1Limit (Both) "

NO SETTINGS on PWM, Or Velocity screens

I was trying to wire 2 limit switches per the FORUM, Home/Limit switch thread, Jul16, 2017:
“The other options let you use a single signal line to detect both forward limit and backward limit/home switches. The switches should be wired in series so either one can trigger the signal pin.”

Power-Up behavior is:
1) input POT1 is centered
2) Turn power on
3) Motor runs in positive direction for a few seconds
4) 2 switches in series as in diagram have no effect during power-up
5) Ion Studio can read the board part-way through motor running
6) Motor stops at about 50,000 counts
7) ION Studio can now read the board, M1 encoder = approx 50,000

After the start-up cycle, the input POT1, Motor1 and Encoder1 track nicely.
Pot-00% == Encoder counts at zero+- deadzone
Pot-50%== Encoder at 50,000
Pot100%==Encoder at 100,000
So-- Position Control is working OK.

Wired as shown the switches have no effect at any time.
No effect during the motor-running at start-up
No effect after start-up when executing a move by using the input POT1

What am I missing?
Attachments
GEN+POS_screens.PNG
GEN+POS_screens.PNG (201.13 KiB) Viewed 5594 times
S4PINS.png
S4PINS.png (40.08 KiB) Viewed 5594 times
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: 2 Limit Switchs, Serial on S4

Post by Basicmicro Support »

From your description it sounds like the motor is moving foward on power up. There are two possible causes of this.

1. One or both limit switfches are triggered(physically or from misconfiguration) OR the motor is wired backwards relative to the direction setting for the motor.

First make sure the switches are not triggered(pressed/clicked) and that thay are setup to be normally high when not pressed and low when pressed OR set the inverse check box next to each limit switch option and make sure the physica switch are normally LOW and HIGH when triggered.

Assuming the above is setup correctly you need to check the direction the motor moves relative to the controls in Ion Studio. Move the motor slider UP in PWM settings. That is forward as far as the Roboclaw is concerned. If your motor moves toward the Home switch then your motor is running backwards. You either need to check the reverse direction checkbox in General settings for that motor or you need to reverse the wires on the motor.

Assuming all the above is setup correctly on power up with auto homing enabled there are two things that can happen:

1. If a limit/home switch is triggered/pressed the motor will move forward for up to 3 seconds at the set duty/speed. If the limit/home switch never opens back to normal the homing system will timeout and stop the motor. If when the motor moves it gets out of the switch(as it should normally in this state) the motor will stop and then procede to step two.

2. If neither home/limit switch is triggered, the motor will move backwards for up to the timeout limit set. If it triggers the home/limit switch it will stop and the encoder for that motor will zero.

Note for dual switches on a single input(other limit/home modes do not apply here): if the forward limit is triggered on power up the Roboclaw ASSUMES it is the Home(reverse) limit switch that was triggered. It has no way of determing if the forward limit is what is activated on power so it assumes it is always the home limit switch when using two limit switches on a single input pin. You must never power off the Roboclaw while the forward limit switch is triggered. If you do you will have to manually move the motor out of the limit switch before powering on the Roboclaw again(or manually disable the foward limit switch somehow).

The dual switch home/limit functionality on a single pin of the Roboclaw is handled by knowing which direction the motor was moving when it triggers the switch. On power up it has no idea what direction the motor was moving when the limit was trigger since it either happened while powered off or the last time it was running the motor which is not stored anywhere.
gearhead1
Posts: 3
Joined: Fri Feb 23, 2018 2:28 pm
Re: 2 Limit Switchs, Serial on S4

Post by gearhead1 »

Any news on the firmware for 1 motor with 2-switches on S4 + S5?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: 2 Limit Switchs, Serial on S4

Post by Basicmicro Support »

It has not been released yet. We have decided to hold off on the released till sometime next month. It needs to be fully tested on all models and we are out of stock on several models right now.

If you email support I can send you a pre-release version you can use. It wont be till the end of the week though.

Post Reply