Crazyflie goes Ardupilot

For a drone swarm project we bought swarming drone Crazyflie drone kit from Bitcraze, and start developing using the Crazyflie eco system. Using the Bitcraze system with LOCO UWB indoor positioning system it flies okay(is).

Not entirely satisfied with the flying characteristics of Crazyflie. We decided to port the Ardupilot flight stack to Crazyflie. There is support for the Crazyflie 2.0 drone within the Ardupilot project. The Crazyflie 2.0 has been discontinued and Bitcraze released the Crazyflie 2.1 which changed the IMU and barometer sensors.

The Crazyflie 2.1 uses the Bosch BMI088 IMU and BMI388 barometer, which is supported by the Ardupilot flight stack. We had to change the hwdef of Crazyflie to include these sensors, and modify the BMI088 driver to use I2C instead of SPI.

Using an ESP with the MavESP8266 firmware for telemetry we were able to fly the Crazyflie through MAVProxy and QGroundControl using a Frsky Taranis over USB.

And it flies :slight_smile: . Had to tune the PID a bit to get it flyable, but it flies. We have the feeling that if flies better, and more stable than the Crazyflie flight software. PID’s could be a bit better, but it flies decent.

Then we had the idea to convert the Crazyflie with brushless motors. We thought that using brushless motors, the flight characteristics should improve due to that brushless motors has more torque and can change motor speed faster than brushed motors. Besides the flight characteristics, the brushless motors should be more durable than brushed motors.

We bought the Sensi Micro V2 drone frame from DroneJunkies with the Eachine Lizard95 1104 6000kv motors and the Eachine Minicube 10A 4-in-1 ESC. The idea was to mount the Crazyflie hardware on the Sensi drone frame.

And it flies… horrible :laughing:. This drone is waaay overpowered and very aggressive. This frame-motor-prop-battery combination is destined for racing drones. Currently still working on the PID’s. And it is either violent oscillations or extremely sluggish. But I just finished this drone the other day, so I am still working on it.

Overall it has been extremely fun developing on the drones and Ardupilot. As a former Linux kernel developer I am extremely content with the structure of Ardupilot and the sources (props to the developers!). Do need to improve my knowledge regarding C++ though. I am a low level HW/SW developer. Learning it on the job!

Further challenges in our development:

  • Porting the Syslink driver (serial communication between Nordic nRF chip and STM) to transport MAVLINK
  • Porting the UWB driver for positioning
  • Realizing a swarming communication telemetry link with 100+ drones
  • Developing our own drone

Thanks all, and we will keep you guys updated!

16 Likes

That is really fantastic. Sounds like you found some issues with the hwdef for the new crazyflie so we’d love to get that in master when you’re ready to create a PR.

Really great work!

1 Like

really nice, thanks! A PR to update the hwdef would be nice. You could include some better default params in the defaults.parm in the hwdef directory so it is flyable without tuning.
Warm welcome to the world of ArduPilot development!

2 Likes

Nice work! Love the UWB integration

1 Like

Thanks guys.

I have created a PR:

The only issue I have is that I had to remove the return value check of write_register() for a soft-reset command of the gyro. Somehow this fails when using I2C. Perhaps others have more insight regarding this. I have stated this in the PR as well.

1 Like

These are my PID settings. This should get people airborne (4.0.3). As for the other tuning settings I followed the Excel sheet from xfacta.

1 Like

for a frame like this it is best to put those settings in a defaults.parm in the hwdef directory, so that they get embedded as defaults in the firmware

1 Like

Super cool! To get something like that flyable you’ll most likely have to use the dynamic notch. Keep up the good work :slight_smile:

1 Like

Hi Duccan! How are things going on this project?
I’ve followed your instruction and finished uploading ardu firmware and connect to QGC. But because i’m a newbie so i just cant get the rest òf your blog( the MavESPN8266 for telemetry and fly CF2 with Frsky over USB) , can you give us more information about how you can make things work ?
And, one more problem about cf2.1 is that it has no compass, so that there’s no reference for yaw angle, so that yaw drifts a lot ( about 1 degree/1sec), did you notice the problem and how what would you say about it?
Thanks again for all your hard work it is much appreciated!

Apologies for the late reply. I was on holiday for the past weeks.

Our drone project is a bit halted. Due to covid-19 we are focusing on other projects. Unfortunately not that much progress…

As for the telemetry. I am using USART2 for the MavESP. USART1 conflicts with the Crazyflie UWB Loco Deck. USART2 are pin PA2 and PA3 on the STM. Or pin 1/2 on the right extension pin header. You should configure SERIAL3 in Ardupilot as MAVLINK.

You should also take care to power the ESP properly (3V3 regulated or 5V). Are you able to connect to the ESP and open it configuration webpage? Verify that first before configuring Ardupilot.

As for the compass, indoor it has no use. You have to fly it yourself :wink:

Snippets from the Crazyflie schematics:

image

image

1 Like