Home/Limit switches

Questions about using encoders with the Roboclaw product line
Joe
Posts: 34
Joined: Fri Dec 23, 2016 1:00 am
Home/Limit switches

Post by Joe »

As I mentioned in an another thread I want to control a linear slide with one motor of RC. With another brand controller I was used to have one home/limit switch at the min position and another limit switch at the end of the slide for security reasons.
In the RC wiring diagram I can only find a wiring example for one switch per motor.
How can I wire my two switches to the RC and what settings do I have to make in IONmotion software?

PS: Sorry if someone else already asked this but a search for the words "switch" or "limit" is not possible.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

The current firmware does not support 2 limit switchs(home+limit) on the same motor.

The next update of the Roboclaw firmware will allow two switches to be connected to the same limit signal input(eg S4 for motor 1 and s5 for motor 2). The limit type(forward or reverse) is detected on the fly when the signal is detected(eg if the motor is moving forward when the signal gets triggered it will be a forward limit(you will be able to move the motor backwards out of the switch but not any further forward) and vice versa.
Joe
Posts: 34
Joined: Fri Dec 23, 2016 1:00 am
Re: Home/Limit switches

Post by Joe »

Hi, are the two switches per motor (home/limit) already supported?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

Yes. Install Ion Studio from the website. It replaces Ion Motion and has the latest firmware with dual limit switch support on a single S pin.
Joe
Posts: 34
Joined: Fri Dec 23, 2016 1:00 am
Re: Home/Limit switches

Post by Joe »

Can someone explain the S4/5 options Home(auto) and Home(user). What is the difference?
Unbenannt.PNG
Unbenannt.PNG (11.55 KiB) Viewed 13406 times
Also some other modes are undocumented in the current manual.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

Auot means the Roboclaw automatically run the motors on power up to home them. Manual means that the user will have to send commands after power up to move the motor into the home switch. The manual mode gives the user more options/control over how the homing is done.

In Auto mode motor 1 is homed first and then motor 2.

When Auto mode is set, there are two things that can happen on power up.

Mode 1. the motor is already triggering the home sensor, so the motor will be moved forward until the sensor is no long triggered and then it will continue on to Mode 2.
Mode 2. the motor is not triggering the home sensor, so the motor will be moved backwards until the sensor is triggered.

Note that Mode 1. has a hardwired timeout of 3 seconds. Mode 2. has a user settable timeout in seconds.

The method of moving the motors is determined by how the motor is setup. If the Velocity or Position PID is not setup for the motor it will use a PWM signal with the user selected Duty percentage(20 percent by default). If Velocity or Position PID is setup it will move the motor at the user specified percentage of the maximum speed of the motor(eg the QPPS). So by default 20% of QPPS.
Joe
Posts: 34
Joined: Fri Dec 23, 2016 1:00 am
Re: Home/Limit switches

Post by Joe »

Thank you, could you please explain the other options?
What does home(user)/limit(fwd) or limit(both)?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

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. Roboclaw uses the current motor direction to determine which switch was triggered but there is a catch. You can not power on the Roboclaw while the forward limit switch is triggered. if you do, Roboclaw will assume you are at the home position since it will not know your last movement was forward into the limit switch.

We may update this in future firmware release to save the last state when triggering a forward limit but currently you have to make sure you dont leave the forward limit switch triggered when powering up.
Joe
Posts: 34
Joined: Fri Dec 23, 2016 1:00 am
Re: Home/Limit switches

Post by Joe »

acidtech wrote: Note that Mode 1. has a hardwired timeout of 3 seconds. Mode 2. has a user settable timeout in seconds.
What does timeout mean?
Where can I set modes?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

The Timeout is used when auto homing is used. It sets how long the Roboclaw will try to reach the home sensor. When auto homing is set the roboclaw will check the home sensor on power up. If the sensor is NOT engaged it will move the motor backwards until the switch is engaged or the timeout runs out. If the Home switch is already engaged the Roboclaw will move the motor forward till it releases the home switch or a hardwired 3 second timeout timesout. Then it will move backwards as in the first case.

All functions/modes can be set using Ion Studio. The S4 and S5 mode settings are in the General Settings screen.

Post Reply