Roboclaw 2x5A Position Control using quadrature+index

Questions about using encoders with the Roboclaw product line
Post Reply
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by Basicmicro Support »

On the new model Roboclaws we've added S4 and S5 signal pins. Im currently working on a firmware update that addes homing support using these pins. The home function will move the motor in reverse at 1/10th power until the index/home switch is detected. If the signal is already triggered the motor will first move forward at 1/10th power until the signal turns off and then the home function will run. If the home/index is not detected within 5 seconds the home sequence is terminated.

We are currently not able to support this functionality on the S3 pin so this functionality is only available on the V5 Roboclaws.
jonas-
Posts: 2
Joined: Tue Aug 04, 2015 8:10 am
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by jonas- »

Dear acidtech

I am looking exactly for this functionality for homing support with limit switches attached to the S4 S5 pins. How far are you with the firmware update supporting this feature?

Best, Jonas
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by Basicmicro Support »

We are finished with the new firmware. At this point it is just waiting on time for all the final testing that is required before we can release a new firmware. I cant give an exact timeline on that but in the next two weeks is likely.
ZR910
Posts: 3
Joined: Thu Sep 03, 2015 10:39 am
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by ZR910 »

Any update on commands for the Home function? Also, is there any way to modify the speed at which the function executes; for example if I wanted to move the motor at the slowest speed possible? I want to be as accurate as possible, and be able to stop exactly on my index location. What is the command number to execute the Home function, and can I reverse the trigger voltage from low to high? It would be nice to send the Home command and include data bytes for speed and trigger voltage as high or low (1 or 0). Thanks!
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by Basicmicro Support »

Homing support has been added but not as separate commands. The unit will home the motors on power up when the S4 and/or S5 pins are setup as home signal inputs. S4 will home motor 1 and s5 will home motor 2. This is in firmware 4.1.8 and newer. The S4 and S5 pins have internal pullups. The home switch must be a active low switch. An external pullup can be used if necessary. Like the other pins they are 5v tolerant.

On power up the signals are checked. If the signals are triggered(eg low indicating the motors are home), the motors will move forward until the signal releases. Then the motors will move backwards until the signal triggers at which point the encoder values are zero'd and the motors are stopped and the rest of the board init finishes.

Power to move the motors is set to 25% duty.

Currently there are no commands to manually execute the home function or to change the power level used during homing.

You must enable homing on the pins using the IonMotion software. Once the setting is set and saved to NVM each reset of the unit will initiate a home sequence. The primary purpose of this feature is for those using RC or Analog mode to control encoder driven motors. We still recommend implementing your own home routine if you are controlling the Roboclaw with packetserial.
ZR910
Posts: 3
Joined: Thu Sep 03, 2015 10:39 am
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by ZR910 »

So is there any way to read the index channel from the RoboClaw outside of the Home function?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Roboclaw 2x5A Position Control using quadrature+index

Post by Basicmicro Support »

Through the roboclaw, no. There is no separate command to read the signal pins(eg to see if the index is triggered). After experimenting with an encoder with an index output I found it to be nearly impossible to use it manually in that regard. Most index pins are triggered for 4 edges(eg one line resolution). Some are only triggered for a single edge. The roboclaw uses an edge triggered interrupt to detect these accurately even at speed.

This is still a new feature so I may make changes to it in the future(as much as I have code space for anyway).

If you use an index signal from an encoder as the home signal trigger, It will also reset the encoder count on each rotation. This basically means your home is in the middle of your min and max position range. Your positioning range will be +- whatever encoder count is for one revolution. As long as you don't rotate forward(or backward) more than a single revolution of the encoder you will have accurate position information using that setup. If you need more than that much position range then you will need to use a standard external limit switch style home.

I'm thinking off adding the option to enable the index pin reset function without the automatic homing on power up. If there is a use for that functionality it is fairly easy to add.

Post Reply