S4 Homing

Questions about using encoders with the Roboclaw product line
Post Reply
gnordin
Posts: 4
Joined: Fri Apr 05, 2019 6:15 pm

S4 Homing

Post by gnordin » Fri Apr 19, 2019 3:03 pm

I have a Roboclaw 2x15 and am trying to set up homing on S4 but am having trouble because the voltage on the data pin of S4 is not what I expect (the + and - S4 pins are 5V and GND, as expected). With nothing connected, the voltage on the data pin is 1.86V. This is the same whether I use Motion Studio to set the S4 mode to "Motor 1 Home(Auto)","Motor 1 Home(User)", or "disabled". I would have thought that the internal pull-up resistor (which is mentioned in a 2015 forum post and I assume is enabled) would pull this up to close to 5V.

When I hook up a NO switch to S4 like in the figure on pg. 45 of the user manual, I get the following behavior:
- With a 10 kOhm resistor between the data pin and the + pin, the voltage on the data pin goes up to 2.1V, When I close the switch, it goes to near GND (-140 mV) as expected. However, when running the motor backwards to trigger the limit switch the motor does not stop when the switch is closed. I assume that the voltage when the switch is open is not high enough for the controller to recognize that it should be ready to look for an active low voltage to trigger that the motor should stop, correct?
- When I use a 1 kOhm resistor, the data pin voltage is 2.85V when the switch is open, and now the motor stops when running in reverse and the switch is closed.

I am puzzled as to why the voltage is so low on the S4 data pin with the internal pull-up. Is this normal, or is my Roboclaw defective? I notice the same voltage on the S5 data pin under the same conditions.

Is there a recommended resistor value for the external pull-up?

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

Re: S4 Homing

Post by Basicmicro Support » Mon Apr 22, 2019 10:30 am

When set as limit inputs(homing) the signal pins have a very weak pullup. There is also a current limiting resistor and zenro diode on each signal line. Also, the processor of the Roboclaw is 3.3v. This means the pullups try to pull up to 3.3v(not 5v) and the extra load from the current limiting resistor and zenor diode keep the pullup voltage around 2v. In most cases I recommend you use an external pull-up for any anything except fairly short signal lines.

However when you add an external pullup(10k or 1k is fine) you should see the pins voltage go all the way to 3.3v. I just tested this on a unit with a 10k pullup to 5v.

This means either your pins are not setup as inputs(maybe you didnt write the settings to the board in Motion studio?) or there IS something damaged on your controller. I recommend you call in to support and we'll run some tests to confirm if that is the case or not.

Post Reply