Mobile robot stand still on sloping floor ?

Questions about using encoders with the Roboclaw product line
Post Reply
Posts: 3
Joined: Thu Apr 12, 2018 6:30 am

Mobile robot stand still on sloping floor ?

Post by Marc » Mon May 14, 2018 7:51 am

I'm working with a 2x30A RoboClaw controller to drive two motors on a differential drive mobile robot.
I use packetSerial through TTLserial to send commands and read parameters.
The motors are controlled with velocity commands, thanks to a remote controller.

I am trying to tune the velocity PID coefficients and observed this behavior :
when controlling the robot on a sloping floor, I am able to go up the slope, but when I stop the robot (velocity commands to 0) then it slowly move down the slope. I expected the PID to maintain the position.
I tried to change the coefficients with slightly increased P coef (at some point the motors start vibrating, so I reduced at about 1000 for P), tried to increased also I, this as little impact on this behavior.

I consider switching to position control when the robot is near immobile, but I have read a post saying that mixing position and velocity control was not a good Idea.
Could this be due to a bad setting of velocity PID coefficients ?
Have you any advice to help achieve the stand still on a sloping floor ?


User avatar
Basicmicro Support
Posts: 1336
Joined: Thu Feb 26, 2015 9:45 pm

Re: Mobile robot stand still on sloping floor ?

Post by Basicmicro Support » Tue May 15, 2018 9:21 am

To some extent velocity control will prevent this if tuned aggressively. But velocity control will not hold position(eg that is what psoition control would be for). It will just add "friction" to prevent it from going down the slope. The more aggressive the tuning the more it will do this. Depending on the combinatiuon of gearing in the motors and friction in the drive train it may prevent the robot from going down the slope when at 0 speed.

Increasing I will help with this more than P. You may not be increasing I enough.

If you application is such that no tuning for velocity control can prevent the robot from creeping down the slope you will need to consider using position control mode instead. You can mix velocity commands with position commands. I think you may have seen a post talking about mixing non-encoder commands(eg Duty commands) with encoder commands). In general you dont do that except when you want to stop the PID from operating.

Assuming adjusting the PID settings for velocity control doesnt work then I would:
1. Tune for position control with cascaded velocity(eg PIV).
2. Confirm velocity commands work as expected
3. When stopping, read the stopped position and then send a position command to that position.

Post Reply