Using Home switches

General discussion of using Roboclaw motor controllers
Posts: 1
Joined: Sat Dec 22, 2018 8:52 pm

Using Home switches

Postby robbenjamin » Sat Dec 22, 2018 9:07 pm

I am very interested in using the home switch functionality, however I am having difficulty finding information.

There are some mentions of a user or manual mode, but not how to use it.

I am wondering if one would send command 74 mode 4, then send a motor move command? And then the motor would stop and the encoder would be set to zero IF the home switch was triggered while the motor was moving?
If that is the case would you then send another command 74 with a mode 0-3?

I have a rotating mechanism and do not want it to always rotate in a given direction to find home, as this would wind up wires. What I would like it to rotate forward until home switched triggered or until a given number of encoder counts (1/2 turn). If 1/2 turn is reached and not home switch triggered then rotate backwards until home switch is triggered or 1 full turn. If home switched is not triggered in the backward full turn, then return to starting position and stop.


User avatar
Basicmicro Support
Posts: 1077
Joined: Thu Feb 26, 2015 9:45 pm

Re: Using Home switches

Postby Basicmicro Support » Wed Dec 26, 2018 10:02 am

There are two modes. Auto and User. In Auto made the Roboclaw will do the following on power up:

1. If the Switch is already triggered, the motor will be moved forward(with a hardwired timeout of 3 seconds).
2. If the Switch is not triggered, the motor will move in reverse until the switch is triggered or until the user setable timeout expires.

Note Roboclaw will home motor 1 and then home motor 2 in that order.

After that if the user moves the motor into the switch it will stop the motor like a limit switch(when switch is in home or limit mode) and zero the encoder(if the switch is set to Home mode)

The difference between Auto and User mode is that User mode does not do the automatic homing. On power up the user should send commands to get the switch status and move the motor appropriately. As in Auto mode, when in User mode the motor will be stopped if the switch is triggered while the motor is moving in the defined direction(eg home or limit(rev) will stop the motor if the limit triggeres while the motor is moving in reverse) and if mode is limit(fwd) the motor will stop if the switch is triggered while the motor is moving forward. When set to Home mode the encoder for that motor will also be zero'd when the switch is triggered.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests