Roboclaw Solo: Setting S3 mode via packet serial

General discussion of using Roboclaw motor controllers
Post Reply
stu
Posts: 4
Joined: Wed May 08, 2019 8:24 am
Roboclaw Solo: Setting S3 mode via packet serial

Post by stu »

S3 can be set to act as a limit switch (reverse) via the Basicmicro Motion Studio GUI,
bms_gui.PNG
bms_gui.PNG (21.66 KiB) Viewed 3218 times
however the user manual doesn't explain how to do so using packet serial. The user manual appears to be out of date for the solo: there's no S4 or S5 on this model.
robo_user_man.PNG
robo_user_man.PNG (103.83 KiB) Viewed 3218 times
Essentially I'd like to know what to throw in this function to set S3 to be the limit switch for reverse motion:

Code: Select all

roboclaw.SetPinFunctions(0x80,???,0,0)
Using python on windows
Connected to serial using FTDI cable
13V power supply
Normally open limit switch connected to S3 and GND

Thanks in advance!
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw Solo: Setting S3 mode via packet serial

Post by Basicmicro Support »

The SetPinFunctions commands has changed quite a bit and yes the manual is out of date on this particular command.

We go into detail on the changes in this forum post: viewtopic.php?f=2&t=528

It doesnt talk specifically about the Solo but the new system used by the SetPinFunctions command works the same on Solo. Solo S3 effectively works the same as other Roboclaw S4 pins as far as the auxilliary functions are concerned.
stu
Posts: 4
Joined: Wed May 08, 2019 8:24 am
Re: Roboclaw Solo: Setting S3 mode via packet serial

Post by stu »

I figured it out by setting the functionality through the GUI then reading the pin modes using

Code: Select all

rc.ReadPinFunctions(0x80)
It printed

Code: Select all

(1, 0, 34, 0)
which is strange considering your post says reverse limit is 0x20, which is 32.

Any idea what that's about?

Thanks for the response by the way.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw Solo: Setting S3 mode via packet serial

Post by Basicmicro Support »

You combine multiple things to make a setting.

For a reverse limit you combine SIGTYPE_LIMIT 0x02 and SIGFLAG_BACKWARD 0x20 which produces 0x22(34).

Every mode must have a SIGTYPE set. Then you set specific SIGFLAGs for that mode.

Post Reply