Position and Velocity Control on PC

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

Position and Velocity Control on PC

Post by Calvin Chua »

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: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Position and Velocity Control on PC

Post by kimberly »

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
Member
Posts: 33
Joined: Sun Mar 01, 2020 1:28 am

Re: Position and Velocity Control on PC

Post by Calvin Chua »

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: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Position and Velocity Control on PC

Post by kimberly »

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
Member
Posts: 33
Joined: Sun Mar 01, 2020 1:28 am

Re: Position and Velocity Control on PC

Post by Calvin Chua »

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: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Position and Velocity Control on PC

Post by kimberly »

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://www.research-collection.ethz.ch ... 850/214143

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