Questions about using encoders with the Roboclaw product line
2 posts • Page 1 of 1
The example in Arduino(Packet Serial Encoder Position) which has SpeedAccelDeccelPositionM1 does not work. I tried out ForwardM1 ,BackwardM1, ReadEncM1, SetEncM1 and ReadSpeedM1 and all these functions work except the SpeedAccelDeccelPositionM1 function. I can't seem to find what the possible issue could be. It would be great if someone points out where the fault is. I am using the default arduino example. Motor is robotzone 12v planetary geared motor and has encoder inbuilt. I tested out two motors and two roboclaws and tried changing baud rate to 9600 and 19200, tried changing values of SpeedAccelDeccelPositionM1. All of them give the same result. Even in the Basic Micro Studio, the position control notch could not be moved up and down. Is it a connection issue or a config issue, cause they motors used to work fine using the same function in my friends project using roboclaw, unfortunately he doesn't have the code or the config with him.
You need to make sure it works in Motion Studio first. Based on your description you have not set a min and max position limit. This means the movement range is 0 so it will not move. Change the min and max position limits to something reasonable and then re-test in Motion studio. Once you get it working in Motion Studio, remember to write the settings to the board(Device menu/Write Settings) and then you should be able to get the example working.