Position and Velocity Control on PC

Firmware/software/electronics/mechanics
Post Reply
Calvin Chua
Beginner
Posts: 7
Joined: Sun Mar 01, 2020 1:28 am

Position and Velocity Control on PC

Post by Calvin Chua » Tue Mar 24, 2020 6:08 am

Hi all,

I wish to ask a question, I wish to develop a pid controller on controlling the position of the drone. Is it possible to develop a controller for it and not using the one on board?



kimberly
Bitcraze
Posts: 255
Joined: Fri Jul 06, 2018 11:13 am

Re: Position and Velocity Control on PC

Post by kimberly » Wed Mar 25, 2020 9:22 am

Hi,

So you want to develop a controller offboard on your own computer? Sure, that would be perfectly possible with the crazyflie python library. You can then send set-points for roll pitch yaw rate and trust (see examples/ramp.py as an example), if that was the level of control you are looking for.

There is a cascaded onboard PID controller so you can choice at which 'level' you want to build your own controller. If you want to control the rpm of the motors itself, this would be also possible but maybe considering the delay is not advisable to go that low level.

Calvin Chua
Beginner
Posts: 7
Joined: Sun Mar 01, 2020 1:28 am

Re: Position and Velocity Control on PC

Post by Calvin Chua » Sat Mar 28, 2020 10:19 am

Hi Kimberley,

I wish to control the rpm of the motors but I dont see any examples on the python library. Is it possible to do that

kimberly
Bitcraze
Posts: 255
Joined: Fri Jul 06, 2018 11:13 am

Re: Position and Velocity Control on PC

Post by kimberly » Mon Mar 30, 2020 9:37 am

Then you should look at the motorPowerSet parameter. https://github.com/bitcraze/crazyflie-f ... #L114-L120.

If you set these parameters from a script (don't forget to enable it), you are able control the raw PWM values per motor. It is not RPM, but you can find the relationship here: https://wiki.bitcraze.io/misc:investigations:thrust

Calvin Chua
Beginner
Posts: 7
Joined: Sun Mar 01, 2020 1:28 am

Re: Position and Velocity Control on PC

Post by Calvin Chua » Wed Apr 01, 2020 4:29 am

Hi Kimberley,

Thanks for your reply. I have designed a kinematic model that output thrust, yaw, pitch and roll. Besides, I am currently setting up simulation in Matlab. Is it possible to provide me the mechanical specifications of Crazyflie 2.1 such as moment of inertia to increase the accuracy of the simulation please? Besides, do you have any recommendation for simulator other than Matlab or CrazyS.

kimberly
Bitcraze
Posts: 255
Joined: Fri Jul 06, 2018 11:13 am

Re: Position and Velocity Control on PC

Post by kimberly » Wed Apr 01, 2020 7:47 am

Hi!

So in this paper there was a full system identification done on the crazyflie 2.0 by eth zurich, which is very similar to the 2.1 for the exception of the IMU: https://polybox.ethz.ch/index.php/s/20d ... 93a55a91c7

For simulations: you can also consider using Gazebo and the hector quadrotor ros package. You can adjust the hector quadrotor measurements to match those of the crazyflie.

Post Reply