Home/Limit switches

Questions about using encoders with the Roboclaw product line
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

Set the high bit of the pwm mode(SETPWMMODE). Make sure you dont change the PWM mode though. 0x01 is the default setting so you should set the pwm mode to 0x81 to enable bridged mode and keep the default sign magnitude PWM modulation setting.
Ellimc
Posts: 5
Joined: Thu May 16, 2019 3:54 am
Re: Home/Limit switches

Post by Ellimc »

Hi
I am working to an auto homing programme and it seems that it does already exist.
I would like to know how do i have to connect my switch to the roboclaw? the switch that i work with is similare to the one sell on this web site
https://fr.rs-online.com/web/p/products ... lsrc=aw.ds

And also I would like to know if this line of code will be enough for an arduino board.
roboclaw.SetPinFunctions(uaddress, 0, 4,4);
Will it automatically make the homing after that command? or must I put an other line of code?
Thank you in advance
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Home/Limit switches

Post by Basicmicro Support »

For auto homing you need to set the pin functions to Home(Auto) using Motion Studio(General Settings). Then go to the Device menu and click Write Settings. These settings will be loaded and the homing routine will run automatically each time the board is powered on.

Yes, that switch looks appropriate for the task. The user manual shows how to wire limit switches. You can set the limit input to trigger on a low signal(normal operation) or on a high signal(inverted operation, eg the INV check box next to the pin mode drop down).

You can leave the default duty and timeout settings or modify them if you wish. The duty setting sets the power level(or percent of maximum speed) your motor will run at during homing and the timeout sets how long it will attempt to home.

Post Reply