Help with home position

General discussion of using Roboclaw motor controllers
Post Reply
Cittadini
Posts: 2
Joined: Wed Sep 02, 2020 3:49 am
Help with home position

Post by Cittadini »

Dear Sirs

I want to use the Roboclaw Solo driver with a home position made with a magnetic swicth .
I can configure all (S2 for encoder enable / disable , and S3 for home position )
So I need that S3 ( home position ) only works when I power up the driver ( one time )
How I can configure it ?

The problem is that every time my motor rotates ,magnetic swicth made stop my motor ....
For me home position is only to use as a reset for the first time I power up the system


Thanks in advance
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Help with home position

Post by Basicmicro Support »

Unfortunately we do not offer a mode like you describe.
felix
Posts: 19
Joined: Thu Dec 03, 2020 8:08 am
Re: Help with home position

Post by felix »

WARNING : I never used a roboclaw Solo, and I haven't checked the voltage levels for the switch pin : you might need to use a level shifter or a voltage divider in order to avaoid to destroy you board

One hack could be to transform the switch into a "virtual switch" that is only active once after startup : that way, when you pass it a second time, there will be no signal sent to the roboclaw, and therefore it will not act (nb : I don't know if the roboclaw "know" the position of the switch and will still stop).

The easiest way to do that is probably with an arduino (lets suppose the switch provides 5V when activated, 0V when not activated).
Connect the switch to a digital input pin, and the S3 pin to a digital output pin

Then in the setup, you can have a code like this :

Code: Select all

while (digitalRead(switch)==0)   //wait for initial home
{
digital_write(out,LOW)
}

digital_write(out,HIGH)   //switch just got activated for the first time
while(digitalRead(switch)==1)
{
//do nothing
}

digital_write(out,LOW)


and an empty loop
Note that you can also replace the second while by a fixed delay


If you prefer, it should also be possible to get the same feature without a microcontroler, using some digital integrated circuits (latches, logic gates, ...) : It would require a bit more thinking, let me know if you want to go in that direction

Post Reply