PID control in crazyflie_controller_bridge.py?

All discussions related to the Loco Positioning system
Post Reply
szx0112
Beginner
Posts: 15
Joined: Thu Feb 23, 2017 6:59 pm

PID control in crazyflie_controller_bridge.py?

Post by szx0112 »

Hi,

Currently, I put several waypoints that lets crazyflie autonomously fly by modifying the "crazyflie_controller_bridge.py" with ROS and LPS. The craft can roughly complete the job but with low accuracy. By reading the code, It seems that the PID position control is in the TODO list. Because I am not a control guy, not sure if adding it will increase the performance. Also interesting to know if it works, will you guys update it? Any other methods that can help are appreciate.


Thanks
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: PID control in crazyflie_controller_bridge.py?

Post by arnaud »

Hi,

The position PID control is already implemented in the Crazyflie. You can find it there: https://github.com/bitcraze/crazyflie-f ... ller_pid.c.

What inaccuracy are you seeing? If you are seeing much inacuracy in Z you can try to add a big of 'ki' in pidz, for example setting this line to 0.5 or 1: https://github.com/bitcraze/crazyflie-f ... pid.c#L129. We have seen that this improves the Z accuracy (tested in ICRA, we are about to push the change).

Best,
Arnaud

Ps. What TODO list are you referring to?
szx0112
Beginner
Posts: 15
Joined: Thu Feb 23, 2017 6:59 pm

Re: PID control in crazyflie_controller_bridge.py?

Post by szx0112 »

Thanks for your reply.

I see the code, I will try.

Sorry, it is not a TODO list, just the TODO in comment: https://github.com/bitcraze/lps-ros/blo ... idge.py#L5

That makes me confuse about whether it has implemented position control.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: PID control in crazyflie_controller_bridge.py?

Post by arnaud »

Hum... I wrote that and I am not sure what I meant...

My guess is that I wanted to make the Crazyflie PID compatible with the PID controller that was present in the Crazyflie ROS driver (there is a PID controller there as well), so it could be possible to set the PID parameter from the launch file the same way it could be done with the ROS PID controller. I have never needed this functionality though.
szx0112
Beginner
Posts: 15
Joined: Thu Feb 23, 2017 6:59 pm

Re: PID control in crazyflie_controller_bridge.py?

Post by szx0112 »

Not a problem. Chaning ki indeed helps stablize the craft. Thanks.
Post Reply