Blog

With the help of our new intern Mattias we finally got around to shooting a short video and taking photos of the Crazyflie 2.0 prototypes. We are really excited to finally show the new version and we are looking forward to getting some feedback from our readers. We are currently finalizing the design of the motor mounts, so for the video and photos we are using 3D printed prototypes printed in our Ultimaker. The design used in the photos is pretty close to the final design, which will also be transparent. The Crazyflies shown doesn’t have any expansion boards attached, instead there’s just a PCB that holds the battery.

 

 

[pe2-gallery album=”http://picasaweb.google.com/data/feed/base/user/115721472821530986219/albumid/6038515743776561441?alt=rss&hl=en_US&kind=photo” ]

 




 

When working with hardware there’s always a very intensive phase when you do the initial design, find the correct parts and finally order your prototype. Then you sit around waiting for a month or two until the board shows up with the mail. For a first prototype there are always errors, so you want to minimize the time before you do another round of prototypes. Already during the work with the initial hardware design we use various development boards to check that we won’t run into any problems. Normally there’s something you didn’t think about and there’s always something ugly that shows up in the errata. To test some of the hardware you might need a lot of firmware, like how well do the sensors work when flying. To speed things up we normally continue the development using our hackish set-up of development boards even after the prototype is ordered. This way we have made lots of progress with the firmware until the first prototypes show up.

Since we did a lot of changes for the Crazyflie 2.0 we verified many things already before ordering the fist prototype, but for others we needed more firmware and we didn’t have the time do finish it all. So after ordering we continued the development using our initial set-up. It contains roughly the same sensors we use in the final design and also the two MCUs (STM32F405/7 and nRF51822), everything is wired up using roughly the same pins and buses we have in our design. While we were doing more work on the firmware we found a couple of errors we made in the hardware that we needed to fix when the prototype arrived. Finally we had the old firmware ported and running on the STM32F4 and some new firmware for the nRF51. Together this built up almost a complete system which we could connect the client to and log data from the sensors. Obviously there was one thing we couldn’t really test, the actual flying :-)

Prototyping the Crazyflie 2.0

Prototyping the Crazyflie 2.0

Finally the new prototypes arrive. If you have been in this situation before you recognize the feeling, it’s great! Even though we had the firmware working we didn’t want to start trying to flash it, there was probably other issues we haven’t found. So we had also prepared a blinky program which just starts the oscillator and blinks the LEDs. While taking small steps it’s a lot easier to find out what went wrong. After successfully blinking the LEDs we got a bit more confident and flashed the full firmware, and it was working! But then we already knew about the error that kept the STM32F4 in reset and had patched it :-) After attaching the 3D printed motor-mounts for the new 7mm motors and fixing the PWM we gave it a try. Crash! A bit too optimistic.. we fixed the sensor orientation and it was finally in the air. After a quick glance at the clock we realized that it had only taken 8 hours from ripping the package open (yes, ripping) until we had the first prototype of the Crazyflie 2.0 in the air. After a couple of days all the hardware was tested, the changes were made and a new prototype was ordered (which coincidentally showed up today).

So where’s the video of it flying? It’s still in the making. This fall we are very happy to have the help of Mattias that is doing an internship at Bitcraze. He’s worked with media and graphical design before, so you can expect images and video with better quality than we normally manage to produce :-)

Early on in the Crazyflie 2.0 design we decided on using a double-MCU architecture. The main reason for this was to add Bluetooth low energy (BLE) to the platform to permit new use-cases like controlling the Crazyflie 2.0 directly from a mobile device. It just so happens that Nordic semiconductor some time ago released a chip that perfectly matched our requirement: the nRF51822 can run a BLE stack and is still compatible with the nRF24Lx1 that we are using in the current Crazyflie and Crazyradio. This nRF51 chip contains an ARM Cortex-M0 microcontroller, powerful enough to implement the radio functionality and power management, but not powerful enough to run a fully featured Crazyflie. The resulting system architecture can be seen here:

Crazyflie 2.0 system architecture


The nRF51822

The two main tasks for the nRF51 is to handle the radio communication and the power management. We use the radio for both CRTP and BLE, but the hardware also supports other protocols like ANT. The CRTP mode is compatible with the Crazyradio USB dongle and it provides a 2Mbit/seconds data link with low latency. Our initial tests of the Crazyflie 2.0 implementation shows that the latency of the radio link is between 360us and 1.26ms, at 2Mbps without retry and a packet size of respectively 1 and 32 bytes. The main benefit of the CRTP link with the Crazyradio is that it’s easily implemented on any system that supports USB host which, makes it the first choice to hack and experiment with the Crazyflie. To that we have added BLE, mostly with the use case of controlling the Crazyflie 2.0 from a mobile device. The idea is of course to be able to fly easily and on the go with BLE, but we also see lots of opportunities for fun hacks and experimentation with mobile devices. One idea we came up with is to be able to place the mobile device up-side-down on a table and to autonomously hover the Crazyflie above it using the camera on the back.

One of the other particularities of the nRF51 chip is that it was designed to run from a coin battery, which means that it is pretty well suited for low energy operation. So we decided to give the nRF51 the responsibility for power management as well. In the current version of the Crazyflie we have a small chip handling the ON/OFF button and cutting power to the complete board. On Crazyflie 2.0 the button is connected to one GPIO pin on the nRF51 and power to it will never be cut, it just goes in “power down” mode. This permits to reproduce the current ON/OFF functionality and the button can be used for more function like long press and double click. We have also added the possibility to wake up the system from one of the pins in the expansion connector, which allows wake-up by an external source. It also adds more possibilities like waking up the system at regular time-intervals to perform some function.

The STM32F405

We also updated the main MCU to a fast Cortex-M4 with a lot of memory. The CPU power is not a big limitation in the current Crazyflie, but the memory could become a limitation if users would like to implement new functionality that needs a lot more memory. We ran into this problem when we were trying to implement SD-card support for logging, as this required too big buffers. The new MCU has 196kB of RAM which should be enough for anyone (famous last words…). The MCU power will also allow for more computationally intensive algorithms, the first that comes in mind is sensor fusion between inertial sensors and the GPS data.

This amount of memory and computational power also open the doors for new things: the STM32F4 has a Memory Protection Unit, which allow to run tasks in a protected environment and intercept bugs before they can crash the full Crazyflie control firmware (like what  happens on PC operating system). One use of this could be to to allow for “user code” that runs in a protected environment to allow easier development of advanced behavior. As always this kind of functionality spawns lots of crazy ideas :-) The leading one is to run a Lua interpreter in such a protected task. If there was a good API that could be used from Lua you could imagine lots of fun stuff to do. Like adding a new board with sensors, reading them and then controlling the Crazyflie from that, without having to go into the actual control algorithms or risking to crash the firmware. This is of course still a dream but at some point in the future we will definitely give it a try (when we have the time for it that is :-) ).

Inter-MCU communication

Working with a system with multiple MPU is hard. As embedded system developer we know that, so we designed the Crazyflie 2.0 with at least some idea of how to limit the problems related to debugging two inter-dependent MCUs. We have defined as precisely as possible the responsibility of each MCU, which permits to develop and test things independently:

  • The nRF51 is responsible for
    • ON/OFF logic
    • Enabling power to the rest of the system (STM32, sensors and expansion board)
    • Battery charging management and voltage measurement
    • Master radio bootloader
    • Radio and BLE communication
    • Detect and check installed expansion boards
  • The STM32 is responsible for all the rest, among other things:
    • Sensor reading and motor control
    • Flight control
    • Telemetry (including the battery voltage)
    • Additional user development

The nRF51 will act as slave and the STM32 as master. Using a radio bootloader it will be possible to wirelessly update the firmware for both MCUs.

We will write more details and post photos in the following weeks. Do not hesitate to tell us what you think about it, we appreciate all the feedback we get and we already have a couple of verification that we made after previous feedback (ie. radio latency and magnetometer usability).

At Bitcraze we often get into discussions about crazy ideas that we would like to test out. Most of them are just that, crazy ideas, that are hard to realize or that we never have time for and the discussion ends (and a new one begins). But one of these discussions have been popping up time and time again, the idea of a flying sensor array based on the Crazyflie. Imagine a situation where you would need to distribute a large number of sensors over an area that you don’t have access to. You could also imagine a situation where you would like the measurement points to move over time. In these cases manually placing sensors at different points might not be a feasible solution.

During the initial design of the new Crazyflie we tried coming up with different use-cases for the new platform. We are not designing a “end-user” product that is intended for a specific end-use, instead we are designing a platform that is aimed at giving us and other users as much flexibility as possible to define the end-use themselves. But we still needed something to aim for, to try out our design on, and see if it could be done. One of these use-cases ended up being a flying sensor node. This might seem like a very specific usage, but we thought that if we come up with a design that would fulfill our basic idea and also a few far fetched ideas, then we would have something good. Hopefully this will be the case :-)

But we don’t only want to use the sensor array as a use-case, we want to build it! But as always time is in short supply. What’s the second best thing after doing something yourself? Seeing someone else do it! So we thought that this would be a great opportunity for a master thesis, where there would be room for both a theoretical part and a practical implementation part. Therefore we are hosting a thesis together with the consultant-company DevPort and the faculty of engineering at Lund University this fall semester. The theoretical part of the thesis includes investigating mesh-algorithms that could be used for a flying sensor array to relay commands to the nodes and to relay back sensor data. The goal is not to relay direct control commands though the mesh, but instead relay target positions for sensors or area that the array should cover. The goal of the practical part of the thesis is to implement basic functionality of the selected design using our new Crazyflie. The radio used in our new design is the nRF51822 from Nordic Semiconductor, we will go into more detail on the new radio in upcoming posts. We realize that this is a huge task, but we will do our best to help out. Between the three of us we cover mesh, radio, embedded systems and of course lots of knowledge about of the new Crazyflie and the nRF51822.

The thesis will be based on location in Lund/Malmö in Sweden, but we will of course share the progress and results on our blog. If this sounds like something that is interesting and you are looking for a thesis, then check out the description here (PDF here). Contact information for questions and applications can be found in the description.

So how did using this use-case when designing the Crazyflie effect the result? Well, one thing is that one of the pins in the expansion connector can be used for charging and powering the system. Think solar-cell, inductive charging or any other alternative source of power. It also sparked lots of discussions that effected the complexity of the power-management system, something that is now handled by the new radio MCU.

 

It’s been more than a year now since the Crazyflie Nano Quadcopter was released and it’s been a great journey! It’s been great to see users all over the world assembling their Crazyflies and doing all kinds of things with them. The list of cool things that have been done is long! During this time we have gotten feedback on what we can improve. We have also had time to reflect on what we think we could do better. So since some time now we have been discussing what we should change if we had the chance to make a second version of the Crazyflie. We think the time has come for an upgrade, so during the last 6 months we have been trying to sort out what we can do (and what is just too crazy..) and we have finally landed on a design that we hope you will like.

So it’s finally time to announce our new Crazyflie, the Crazyflie 2.0! Honestly we tried coming up with a cool name, but 2.0 just felt so geeky we couldn’t resist :-) During the upcoming months we will write lots of post detailing the features and design of the new version, but here’s a quick overview. First some of the things that we have seen users requesting:

  • No more soldering: The new design features connectors for the motors so you will not need to do any soldering.
  • More robust shape: We redesigned the PCB shape to withstand more punishment by changing the + shape to an X shape and also making the “wings” thicker.
  • Bluetooth Low Energy: Lots of users would like to fly the Crazyflie directly from their phone. To accomplish this we decided on adding Bluetooth Low Energy support while keeping compatibility with the current Crazyradio.
  • More payload: Lot’s of users would like to lift more payload than the current Crazyflie can handle. To accomplish this we have upgraded the motors from 6 mm to 7 mm, which increases the payload with about 2-4 times. It also makes it a lot more aggressive and fun to fly ;-)

Aside from user requests, we also have a couple of things that we wanted to improve and would give users much more possibilities to experiment and explore flying robotics:

  • Improved expansion-port: We have removed the old 2×10 header and instead added an expansion interface that has better mechanical stability and is easier to use. The interface is two 1×10 2.0 mm pitch connectors, spaced 22.0 mm apart. To maximize the flexibility users are able to stack boards on top of each other, both on the bottom and on the top. This will of course affect aerodynamics and flight time, but gives users lots of exciting possibilities.
  • Improved radio range: To be able to do more experiments using the Crazyflies outside we wanted to improve the range of the radio. This has been done by adding a radio power amplifier to the Crazyflie and also to the Crazyradio.
  • Dual-MCU architecture: Dedicated MCU for power-management/radio-communication and updated main MCU for control and application.

When moving to the new platform we don’t want to have two different firmwares for the new and current Crazyflie. Therefore we are doing major changes to the firmware in order to support multi-platform. Our goal is to keep full compatibility with the current Crazyflie as far as the hardware will permit, so any improvements done on the new Crazyflie will also be available on the current Crazyflie. We are still hashing out the details of what this will look like, but we are looking at abstracting all hardware-related code from the core platform.

Much of the design is in place for the Crazyflie 2.0, but there still some things we don’t know yet. Here’s a list of things we will haven’t decided on or tested, that we think you might be interested in:

  • Flight time: We still haven’t decided exactly on the battery so we have no measurements for this yet, but we are aiming for something similar to the current Crazyflie.
  • Weight: The size of the bounding box of platform will be the same (i.e. length and height) but the board is packed with more things, the PCB is a tiny bit larger, the motors are heavier and the motor mounts are different. Due to these things not being finalized we don’t have a final weight yet.
  • Radio performance: We are still tweaking and measuring the radio performance, so we don’t have any exact measurements that we can share.
  • Release date: We are always careful when promising specific dates, since we know it’s hard to keep them. At this point we could still hit some major roadblocks, but so far things are going according to plan. That being said, our aim is doing a pre-order of the new version at some time during the late fall.

We think that all of this sounds great (of course :-) ), but we are very eager to hear what you think about it. Does the Crazyflie 2.0 sound interesting? Is there something you would like to add or remove? Leave a comment below and let us know what you think!

Like we mentioned a couple of weeks ago we went to Devoxx UK last week exhibiting the Crazyflie. We got a chance to do lots of fun things, like flying the FPV quad in the keynote and also over the exhibition floor. The image is a bit faded, but we had the luck of having a projector next to us that we hooked up the FPV receiver to so the video feed was projected on the wall behind our booth. Our booth was next to the NFC ring exhibition which had a nerf gun that was unlocked when wearing their NFC ring. We quickly came to the conclusion that trying to shoot the Crazyflie down with the nerf-gun was the way to go :-) It can actually take a couple of direct hits before going down!

On Thursday night we jointed the IoT hackathon hosted by IBM. We got an Arduino with lots of sensors that we were supposed to interface from Java. Unfortunately we didn’t do too well on the Java front, but we managed better with the Arduino. We decided to use on the thumb-joysticks for controlling roll/pitch and a light sensor for controlling the thrust. Our first plan was to use a microphone for controlling the trust with the sound-level, but we realized that might be a bit too tight with time. The joystick and light values are sent via the UART to the PC and picked up in the Crazyflie Python Client using a modified version of the joystick drivers. Instead of reading events from PyGame we read data from the serial port. This makes it alot easier to debug since we get feedback from the input-device directly in the UI. In the end we got it working (kind of..) so we could fly and actually won the hackaton! So now we have a box of sensors that we can  play around with. Below is an image of the sensors connected to the Arduino.

arduino_devoxx_uk

We are glad to announce that we got a reinforcement to our team. His name is Miguel Piteira Gomes and just got out of school where he studied mechanics. Now we can finally do other stuff then electronics and software! Miguel comes from Portugal and will help us out during the summer. We wish him a big welcome!

Miguel

We are always looking for fun things to hack together using the Crazyflie. The last couple of weeks we contributed to two exciting open hardware campaigns on Indiegogo that we are hoping to get our hands on soon.

The VoCore

First up is the VoCore, a coin-sized SoC breakout with WiFi running Linux. Based on the RT5350, it could be used for WiFi control (with AP support) or to add extra power for doing calculations.

The second one is the 3Dpad, an open source gesture controller. We have been using the Leap Motion for flying before, and we are really eager to try the concept but with an open source project. Even tough the 3Dpad doesn’t support the same hand/finger tracking as the Leap Motion, we are hoping that we can hack together a usable controller for the Crazyflie. It uses capacitive technology that makes it possible to place it behind materials that are not transparent. Imagine placing it under the desk and flying with your hand above the desk!

Best of luck to the projects with financing and development!

This week we were planning on recording some FPV videos around the office with a new transmitter that gives us better range. But after battling with our USB capture device for a while we finally gave up. We will have to try to find a better one (that hopefully works in Linux!). But until then here’s two videos. First one from BBC is about the exciting future for flying robots (thanks to phenoptix for tipping us off to this one) and the second one is the recording from our presentation at Devoxx France a couple of months ago. The presentation is in French and you can pretty quickly guess who is the native French speaker and who is not :-)

Last year we presented the Crazyflie at Devoxx Belgium and last month we got a chance to do it again at Devoxx France (but in french). To complete our Devoxx tour we also accepted an invitation to Devoxx UK. But this time we won’t be presenting, we will only be flying :-). Normally when we speak conferences we hang out at the conference before and after the presentation. It’s a really great way to meet other geeks, discuss and have a lot of fun. So this time around we will only be hanging out in the exhibition hall. If you are going make sure to come by our table and do some flying!