Category: Video

A while ago I started working on a brushless motor control driver for the Crazyflie. I implemented most of it but did not really have time to test it. Recently we have gotten some request and questions about it so we took some time to do some further testing.

Implementing a brushless motor control driver can be done in many ways. If you have brushlesss motor controllers that can be controlled over I2C that could have been one way but usually the brushless motor controller (BLMC) take a PWM input. This is most commonly a square wave with a period of 20ms and a pulse width of 1-2 ms high, were 1 ms is 0%, and 2 ms is 100%. A period of 20 ms means a frequency of 50Hz. This is most often a high enough update rate for R/C electronics like servos etc. but when it comes to BLMC that is not the case. Therefore many new BLMC can read a much higher update rate of up to 400 Hz were the pulse still is 1-2 ms high. That way you can match the BLMC input to the update rate of the stabilization control loop and increase stability. In the code we added a define BLMC_PERIOD where this can be set.

To test this we wanted a frame which was quick to setup and found this. It is based of a PCB just like the Crazyflie and has the four motor controllers with it, perfect! The built in BLMC are based on an the Atmel MCU Atmega8 which is very commonly used in the R/C BLMC which means it is possible to re-flash them with the SimonK firmware. This is know to be a great firmware and enables fast PWM update rate etc. So we built and flashed the firmware configured for the tgy6a which is compatible and it worked right away, yay!

Now we only had to connect the Crazyflie to the BLMC:s on the frame. The BLMC electrical interface for the PWM signal is often a 5V interface but the Crazyflie runs on 2.8V. 2.8V would in most cases be treated as an high input and can probably be used directly but there is no simple way to connect this signal on the Crazyflie. Instead one way is to use the existing motor connectors and the pull-down capability that is already there. Then it is also possible to pull this signal to 5V with a resistor to get a 5V interface so this is what we did. To power the Crazyflie we took the connector of an old battery and soldered it the 5V output of the frame.CF to BL Frame connections

Now it was just a matter of testing it! However as size increases so does the potential damage it can make. We therefore took some precaution and tied it down. First we tested the stability on each axis using the stock values and it worked really well so we decided to not tune it further. The only issue was that suddenly one of the BLMC mosfets burnt. We replaced it and it worked again but don’t know why it burnt. Later when we flew it something was still strange so we have to investigate this.

We will upload the code as soon as it has been cleaned up. Please enjoy a short video of the journey :)

A couple of weeks ago we moved into the Malmö based business incubator Minc. It’s a great chance to get some extra help developing Bitcraze and also to get a chance to meet people from other start-ups. Below is a picture of a bunch of Crazyflies in our lab (i.e the table designated lab).

Bitcraze Lab

On a more technical note, here’s a video of a blimp that was hacked together with some left over party-balloons and a broken Crazyflie that we had lying around. It’s the day after the party, so there wasn’t that much lift left in the balloons (that’s why we have a bunch of them). After a few hacks to the firmware it actually works pretty well! The motors power has been redistributed and only the Yaw regulation is active, which explains that the yaw is still pretty stable, we are thinking about pushing the ‘blimp-mode’ at some point (first we will need more balloons and Helium though :) ).

Before it’s time for the holidays we thought that we would do a new video with a Christmas theme, showing our vision of Christmas gift delivery. For anyone that has seen the Amazon Prime Air video, it’s pretty easy to see where we got the inspiration for our video. Needless to say we didn’t have the same budget as Amazon, but to be fair our quad does cover more ground :-)

Merry Christmas, and don’t forget our holiday challenge!

This Monday post we are devoting to the community development and we will try to give a short summary of what is going on there. We recently haven’t our selves had that much time to help out with this development, something we intend to change, so all credit goes to the community!

  • A port of the OpenPilot CC3D firmware to the Crazyflie done by webbn. Still under development but video already shows promising results.
  • Altitude hold functionality which is being developed in parallel by many, omwdunkley, phiamo, et. al. We hope we soon can contribute to this as well.
  • Improved thrust control which is being discussed a lot and hopefully we will soon see some ideas realized.
  • A Ruby cfclient written by hsanjuan.
  • The Android client with a lot of work from derf and sebastian.
  • The FPV implementation driven mainly by omwdunkley and SuperRoach. Omwdunkley has made an awesome HUD (Heads Up Display) which we hopefully sometime will see integrated into the cfclient. Check out the video!
We have probably forgotten some of the great development that has been going on recently and if that is the case please write a comment about it and we will update the post with it.

For the last couple of years (!) we have been discussing on and off about automatically flying the Crazyflie from a PC using OpenCV and a camera. We did a try a while ago using a PS3 Eye camera that wasn’t very successful. One of the issues we were having was detecting the distance from the Crazyflie to the camera. Another issue was a lag of about 1 second which made it impossible to control the Crazyflie using the video as input. So last week this discussion came up again and we finally decided to buy a Xbox360 Kinect. The image resolution is higher than the PS3 Eye and of course it has the ability to detect the distance from the camera to the objects it’s seeing.

Crazyflie and Kinect

The goal was to create a proof-of-concept application that shows that it’s possible as well as providing a stub for anyone that’s interested in doing more development. The application uses the normal image as well as the depth image from the Kinect to estimate where the Crazyflie is. This can easily be done by attaching a small colored ball to the Crazyflie and using a white background for flying. The images are processed and the current X/Y/Z co-ordinates given to a control loop. The control loop consists of thee PID regulators that will correct the roll/pitch/thrust that is sent to the Crazyflie to reach a X/Y/Z set-point in the image. The X/Y set-point can be selected by clicking the image or you can hold down the mouse button and drag it around. A cool feature that we would like in the future is to draw a geometric shape that the Crazyflie could follow. But there’s still a lot of work to be done with the control loop before we can achieve that.

After seeing the video you might be asking yourself where the James Bond theme music or the inverted pendulum is. Well, we are’t quite there yet and we will probably not even get near it. But still, this shows that the concept works. And for anyone that’s interested, it’s possible to do some basic trajectory planning algorithms at home with a Crazyflie and a Kinect.

For a more technical details have a look at the Kinect page in the hacks section of the wiki.

The first time we saw the video for the Leap Motion we instantly thought “Wow, we have to fly the Crazyflie with this!”. So finally last week a fresh Leap Motion landed on our desk and we went to work. We were really happy to see that there was an SDK for Linux. Leap Motion listened to the community that thought that an early release of the code was better than nothing at all. The API is very nice to work with and you can easily get metrics for you hand (like elevation and roll/pitch). So we created a Leap Motion driver in the joystick layer that replaces the normal input device, and it’s flying! We are going to be honest, at first it wasn’t that fun. It was more the concept that was very exciting. But as we flew more and more it started getting really great! There’s just something magical about it :-)

You fly the Crazyflie using a single hand. Thrust is calculated using the elevation of you hand from the sensor, so holding your hand higher means larger thrust. Pitch/roll is controlled by tilting you hand the same way you want the Crazyflie platform to tilt. So tilting your hand forward tilts the Crazyflie forward. Lastly the yaw is controlled by rotating your hand in the X/Y plane (around the Z-axis). For thrust/pitch/roll the control values are absolute, but for yaw it’s the rate that you control (just like the normal controls in the Crazyflie client).

As a safety mechanism the Crazyflie will only respond if the Leap Motion detects 4 or more fingers. So holding your fist above the sensor does nothing, but the instant you open up your hand you can start to control the Crazyflie.

The code for flying with the Leap Motion is still on a development branch but if you are eager to try it then have a look at the instructions in the hacks section of the wiki for documentation on how to get flying! The plan is to merge the Leap Motion code into the main track once we are finished with the development.

Crazyflie and Leapmotion

The community interest for FPV flight made us buy a light weight analog FPV kits a while a go. We bought the 5.8GHz micro combo set from fpvhobby to do a first test. It took a little while to solder things together but it wasn’t that bad. We soldered the camera and the transmitter power to the VCOM voltage on the Crazyflie which is available on the expansion port. Then we taped the camera and transmitter to the Crazyflie and did a test flight.  The FPV kit is only about 3 grams which doesn’t affect the flight performances that much.

It was almost too easy, but as soon as we took off we noticed some vertical lines on the TV so maybe it wasn’t that easy. There seems to be some electrical interference, probably from the motors. Also the battery voltage drop generated by fast accelerations cuts the video feed after a couple of minutes of flight. We still think that there are some improvements to be done so hopefully it will work better in the future.

As for the production, so far it is still going forward as planned.

Finally an Alpha version of the virtual machine has been posted on the forum, you are welcome to test and report any problem/suggestion you may have :-).

So finally it’s Monday again :-) As you might have noticed the Crazyflie got released for pre-release last week! All our code has now been pushed onto Bitbucket and our repositories can be found here. Since we did some restructuring of the code before pushing there might be some bugs that we are currently hunting. The Crazyflie is mainly a development platform where you can either add new features/hacks or improve the current features. We added a feature wishlist to the Wiki for features that we never had the time to implement and also to add new features that you suggest. So if you feel like getting you hands dirty there’s still lots of stuff to do! In order to make development easier we have:

  • Wireless Radio Bootloader: This will enable you to easily update the firmware in the Crazyflie. The bootloader cannot easily be erased without using  a JTAG so don’t worry about bricking your Crazyflie when testing new firmware
  • Crazyradio USB bootloader: The Crazyradio contains a USB bootloader for easy update of the firmware
  • Well documented: We are currently doing our best to update the documentation on the Wiki and our goal is to create a well documented platform
  • Parameter setting/getting: This is detailed a bit more here but in short it’s a framework where you can easily add parameters/variables that can be set or fetched from the client. The tab in the client where you can change PID controller parameters on the fly is implemented using the parameter framework.
  • Variable logging: This is also detailed a bit more here but in short it’s a framework where you can easily log variable values to the client. You select variables that you want to log and the rate you want to get them and the Crazyflie will automatically send you updates for these variables. The attitude indicator and roll/pitch/yaw values on the FlightTab are implemented using the logging framework.

In the upcoming week we are planning on posting a video showing some of these features.

Wait, what? Is it Monday again already?! Well no, don’t worry you didn’t miss the weekend. The reason for breaking our “Monday post” tradition is that we couldn’t wait to announce that the pre-order has started for the Crazyflie!!

 

Crazyflie Nano Quadcopter

 

The last couple of weeks has been really busy finalizing as much as possible and finally the time has come. In the end we couldn’t decide on whether we should add the extra sensors or not so we decided on making two versions, one with the basic sensors and one with the extra sensors. Keep in mind that there’s no firmware for the extra sensors yet but if you are interested in more advanced regulation algorithms and performance then you should get the kit with the extra sensors.

We put together two bundles for the different “sensor packs”. One is called Crazyflie Nano Quadcopter Kit 6-DOF and the other 10-DOF. They both include the Crazyradio USB dongle and a 2.4GHz antenna for it. The price for the kits are $149 for the 6-DOF and $173 for the 10-DOF. For full product descriptions head over to Seeedstudio and have a look. There’s also spare parts available to pre-order which could be a wise choice depending on what you are planning on using the Crazyflie for :-)

Here’s the link to the Crazyflie pre-order at Seeedstudio.

Here’s the time schedule for the pre-orders:

  • Pre-order: Jan 31st – Feb 18th
  • Shipping: April 25th

To be totally honest we are not sure how to handle the transition from pre-order to “normal” orders. This depends a bit on how many we sell and how fast we can get a “normal” stock up again. So if you are interested in getting a kit make sure to get one during the pre-order!

Like we’ve said earlier we wanted to release the source for the firmware/software as well as the schematics so you know what you are buying and can already now think of hacks and projects for when your Crazyflie arrives. The choice fell on Bitbucket where all our repos and bugtrackers are located. The only thing we are not releasing yet is the complete KiCad hardware design, but once the pre-orders ship it will be in the repos as well. We are currently pushing the code into the repos on Bitbucket but haven’t had time to complete all of them so we will keep publishing them during the weekend.

So if you want a Crazyflie for flying, doing development or just to help support our project then head over to Seeedstudio and pre-order one.

Last but not least: What would an occasion like this be without a new video :-)

Back in November when we got the pre-series we shot an assembly video showing how to assemble a Crazyflie kit. We shot it in Tobias shed in his back garden where it was about 10*C, that’s why Marcus is wearing a winter jacket. It was also pretty late and it’s the 7th Crazyflie in a row that we have tested and assembled, so we where pretty tired. We are not trying to find excuses but it might not have been our best work. For example the words “the best way” is frequently used, and due to our Swedish heritage, “one good way” might have been more appropriate, but that day we where just feeling confident :-).

If you have ~8 minutes to spare have a look at the video, so you know what to expect in terms of assembly, when you pretty soon will be able to pre-order the kit.