Limit the moving velocity in world coordinate following

Firmware/software/electronics/mechanics
Post Reply
thasu
Member
Posts: 31
Joined: Wed Oct 18, 2017 7:16 am

Limit the moving velocity in world coordinate following

Post by thasu »

I'm trying to move the CF to certain positions in a constant velocity using the send_position_setpoint command. But I noticed that at the start CF accelerates to a higher speed and trying to reach the destination as soon as possible. Is there a way to set a maximum velocity limit so that I can maintain a nearly constant velocity throughout the movement.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Limit the moving velocity in world coordinate following

Post by arnaud »

If you are using the PID controller, it already has a limit of 1m/s (in each axis, so in X/y you can get up to 1.41m/s).

You can change this setting with the parameter posCtlPid.xyVelMax for X/Y and posCtlPid.zVelMax.

The PID used with send_position_setpoint will try to reach the setpoint as fast as possible on each axis independently, this means that the Crazyflie will not necessarily go in a straight line. The Crazyflie contains a high-level controller that would solve that: it contains a goto command that would make and follow straight line trajectory to the setpoint. The easiest right now to use the high-level commander is to use the position commander: https://github.com/bitcraze/crazyflie-l ... er_demo.py.
Post Reply