Issues with home/limit switches

General discussion of using Roboclaw motor controllers
Post Reply
Posts: 1
Joined: Tue Feb 25, 2020 6:52 am

Issues with home/limit switches

Post by mattmotl » Thu Feb 27, 2020 4:33 am


I am attempting to use a roboclaw controller for a restriction plate for a duct. Essentially, it will be sliding a metal plate up and down, so I will need to know when it is at the top and bottom of its position. I have attempted to use the home/limit switches in a few ways, but getting weird results from this. BTW I have to use analog control. Here's what I've tried and the results from it:

First, I hooked one side of each switch to the roboclaw ground, and the other side of both switches to S4 (this is a 2x30 controller) using a pullup resistor. It will go out to my limit and return fine, when it presses the home switch, it stops as it should. However, when I start to go back out to the limit, as soon as it releases the home switch, it stops again, indicating on MotionStudio that it is home. I thought it could be switch bounce, so I added an RC filter, but this was just delaying the time it took to think it was home after it released the home switch.
Next, I tried placing the driver into bridged mode, then using S4 for my home switch, and S5 for my limit switch. This was OK, but unreliable. I got it to go back and forth between home and limit about 5 times before it stopped again after letting go of the home switch. I have no idea what is causing this, I thought maybe the driver was bad.
So then, I tried the original setup with a roboclaw solo. Both limit switches on the same line (S3 I believe). Same thing was happening, so this must be something with the firmware or my setup. I can post a schematic of my setup if needed, but it is fairly straight forward. It is wired just as it shows in the manual.

Thanks and hope you can help,

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

Re: Issues with home/limit switches

Post by Basicmicro Support » Fri Feb 28, 2020 11:16 am

I believe I already talked with you on the phone however just in case that wasnt you...

This definitely sounds like a debounce issue. Some switchs are pretty bad when it comes to that. Using an RC filter was the right idea but if you have to use such a large cap to debounce you may need something more. Please provide a simple diagram if the RC circuit and switch(s). I think a diode in an appropriate location can be used to bypass the RC filter when triggering the switch but remain in circuit when releasing the switch.

Post Reply