Author: Tobias

We have had numerous request to get a transfer function from the motor PWM output to propeller RPM. The next step would then be to get the propeller RPM to thrust transfer function as well. With that it is easier to do calculations on the system and mathematical models. So this and probably next post will be about how to obtain this function and also give a bit of insight in how one can do development with the Crazyflie 2.0.

First thing how do one do propeller RPM measurement? A quick search on the internet and you will find that using an optical switch is a common method. I also found this guide written for Arduino which was a great start. Since I preferable wanted to measure the RPM while flying the switch needed to be small and lightweight. I found two types that could be useful. A slotted type and a reflective type. The reflective type, QRD1114, is small and promising but would it work? I got some of each type just in case.

Now the optical switch needs interfacing and power. Sparkfun made a good tutorial using the QRD1114 sensor so I will not go into details. Since we use 3V instead I adjusted the resistor for the LED to 82 ohms instead. This will give me ~20mA emitter current. I also played a bit with the sensor output pull-up resistor. If you go with a to strong pull-up, the sensor will need a lot of light to pull it down and if it is to week, it will rise to slow. 12k pull-up seams like a good compromise in my lighting conditions.

Optical switch circuit

 

As a first thing I wired it up on a breadboard using the Crazyflie 2.0 breakout board to get a sense if it would work or not. My finding by measuring the output signal with a multimeter is that it is pretty sensitive to surrounding light but that could be solved by flying in a dim room since it is mainly intended to be used for research.

Now it was time to build a circuit using the prototyping expansion board. I also multiplied the circuit 4 times so I can measure all 4 motors. The inputs I use was TX2, RX2, IO2 and IO3. This because they are all connected to timers so I could use the input capture timer functionality later when I get to the software part. Bending the legs on the QRD1114 was a pretty fiddly job but worth it as it came out so cool in the end. Before I connected it to the Crazyflie 2.0 I measured the current draw and it all seamed OK, ~80mA (4 x 20mA). I also double checked all the connections since it is easy to put a lot of time thinking it is a software fault later if things aren’t working as they should.

As a first test I just turned on one of the motors at a PWM of 10000 and measuerd the sensor output with a scope. The black color of the propeller wasn’t so good so I searched around in the office and found some reflective paint we used a while ago. I painted the backside of the propeller and it made a big difference. In the pictures below you can find the scope picture using a 12k pull-up and some pictures of the painted props.

Next part I will start doing the software and analysis so stay tuned!

Well its hard to believe that yet another year has passed. Maybe because it’s been such an hectic year for us at Bitcraze things has been moving so fast. It has not only been hectic but very exiting as well, we managed to release the Crazyflie 2.0 platform just in time for Christmas. That was our goal when we started working on it in March and we can’t really believe we made it. Sure, there are still lot’s of things to be done but now we can all unleash our creativity and start having fun while creating the future for small drones. So what does that mean? Well we don’t know what you have planned but we can at least share some of our ideas for 2015

  • Improve documentation and instructions
  • Develop new expansion boards where GPS and Camera are on top of the wish list
  • Improve the smartphone apps
  • Master thesis in dynamic mesh networks
  • Improve firmware and merge it with Crazyflie 1.0
  • Support for on-board scripting languages such as micro-python and Lua.
  • Improved ROS support
  • And much more!

With that said we thank you all for your support and wish you all a great 2015.

xmas_2014_cf2

This week is going to be an exiting week! Crazyflie 2.0 has started to ship and we are pushing out a lot of code during the week. We wish that we would have gotten more time to work on the code before releasing it, but all three of us have been really busy with production. With the first units now shipping we can finally switch focus to software and documentation. Since there’s quite a few source code projects we are releasing, they each get its own bold headline below. As we role out the different releases we will update this post and post the link in social networks.

iOS Client

main_screen_joysticks_appimg

iOS joystick screen – Download on Appstore

This is our first ever iOS app, and it’s just been released. It got accepted just in time and you can get it from the AppStore, free of course. Currently it is pretty simple, you can connect to a Crazyflie 2.0 and fly it with thumb controls. There is a settings menu where you can adjust sensitivities and configure mapping. The app is all open source and the code can be found here on Github.

Android Client

main_screen_with_app

Android joystick screen – Android app on Google Play

This is more or less the same as the client that has been available for the Crazyflie Nano Quadcopter, but now we have added Bluetooth LE support. Since this app has been manged by our community member Fred for a while it has more functionality then the iOS app, such as tilt control. One cool feature is that you can connect a gamepad with a USB-OTG cable to the phone to get better flight precision with real thumb sticks. The app is all open source and the code can be found here on github. Thanks to Fred Sauer the Crazyflie app has been available for a while now on the market, but now we have taken over the ownership of it. Due to a change in the certificate used to sign the app you will have to re-install the application to get the latest version (market link).

PC Client

The PC client written in Python has got some new features to support the Crazyflie 2.0. E.g. the bootloader in Crazyflie 2.0 is different as it now contains two MCU. It also has a EEPROM which needs new functionality, but other then that we are trying to keep things as common as we can to make things easier. The code is all open source and the code can be found here on Github. Edit: We have made a new tag (2014.12.1), source-code is available here and a windows installer is available here.

Crazyflie 2.0 Firmware – STM32

This firmware is based from the Crazyflie Nano Quadcopter firmware and the aim is to merge the old and new code, but we haven’t had the time to do it yet. Therefore it is now located in its on crazyflie2 branch on Github. We plan to merge them together but more work needs to be done before this is possible, a perfect job for the cold and dark winter months here in Sweden.

Crazyflie 2.0 Bootloader – STM32

This is the code that can flash new code into the STM32F405 MCU. Now the data comes from the nRF51 MCU over the uart, so the booatloader had to be updated. The code is all open source and will be released later this week on Github.

Crazyflie 2.0 Firmware – nRF51

This firmware is completely new and handles the radio communication (Bluetooth LE and Shockburst, compatible with Crazyradio). It also handles the power management and the expansion boards 1-wire memories. The code is all open source and will be released later this week on Github.

Crazyflie 2.0 Bootloader – nRF51

The program to load new code into the nRF51 over the radio link. It also boots the STM32 in bootloader mode and serves as a radio gateway to be able to flash it. The bootloader handles Bluetooth and shockburst so that not only the PC client but also future version of the mobile apps will be able to update the Cazyflie 2.0 firmware. The code is all open source and will be released later this week on Github.

Hardware

We have not yet had time to finalize the hardware files. We are reorganizing the kicad lib and we need to clean things up properly. The hardware projects therefor have to wait, but the schematics has been released if anyone needs to see how things are connected.

Winner of the expansion board naming contest

We have now done a local vote. We are almost hundred percent sure this voting was not tampered with. And the winner is… Flykit. So even though Flykit got a lot of “proxy” votes online it seems the local people liked the same thing. Deck finished second, strange, maybe the voters had read the online vote results… Anyway congratulations to Ramin who will receive a Crazyflie 2.0! We still have not decided if we should go with Flykit or Deck for the real expansion board name. As soon as we have decided we will let you all know.

We are sitting here at Doha airport in Qatar writing our Monday post after a very hectic week visiting Seeedstudio in Shenzhen, China. And it’s been really hectic week, I can honestly say I don’t think any of us has worked this many hours in 7 days in whole our lives. It’s been worth it though, because we did it! We got everything working and ready in time and production is up and running and it’s all on schedule. We have just seen to many kickstarters and pre-order campaigns deliver to late and we do not want to be one of them, and If nothing unexpectedly happens, we will deliver as scheduled.

As we think many of you know of, using internet in China can be a bit difficult. It is often refereed to as the “Great Fire Wall”. We had some clues about it before our visit and tried to take some measures but without much success. We are heavy users of Google services and most of them are either extremely slow or blocked. So is Twitter, Facebook, Youtube and similar social medias so our plan of posting frequent updates failed miserably. Next Monday post we plan on making a summery post of the trip when we organized all photos and when we are a bit more clear in our heads (sleeping on an airplane is not our specialty). Until then here is one photo of us in the Seeedstudio production floor and the new Crazyflie 2.0 box.

 

Another very interesting thing we have tired to follow (yes Bitcraze website has been blocked by the GTW as well) is the expansion board voting process. We’ve seen now that it has been a bit to easy to manipulate and we will use the following week to figure out what to do about it. You guys are just to clever and we see now that we should have done an investigation of good voting processes before we launched it. Well, it’s been exiting to follow and we are pretty happy to see it got people involved!

As you might already know we have added a 20dBm RF amplifier to the Crazyflie 2.0 as well as to the Crazyradio PA. We have had high hopes of getting a more stable link and much better range with this. We have done a lot of tests in the building we are sitting in and already experienced a big improvement in range. However radio range is a tricky thing as it depends on so many things and when we have tested it outside of the office we could only get a stable link for about 80m. This is very different from the documents we read where we could expect up to a kilometer of range! Maybe the fifteen wifi networks that where present outside our office played an effect.

So this weekend I set out to do some test on the country side. I packed my bag and mounted the Crazyradio PA on a 1m stick which I put in my bag so it could reach higher than my head. Then I took the bike to get to the country side. I got a lot of strange looks while bicycling. It was first when I reached the country side, it came to me that bicycling around with an antenna sticking out your backpack might be interpreted the wrong way :-o. After a while I reached a good spot and decided to put the Crazyflie still somewhere and instead take the computer with me so I could see what was happening. As the nRF51822 can take RSSI measurements we made a simple python program where the computer pings the Crazyflie and the Crazyflie responds with the RSSI measurement. We save the data in a CVS file which can be plotted in real time. I hang the Crazyflie in a bush, started the Crazyflie 2.0 at channel 10 and 250k air data rate, fired up the plot and took the bicycle and started pedaling.

After 100m I still had a solid connection, very good sign. After 500m the RSSI had dropped to about -80dBm but still a stable connection. After 1300m it got really shaky, about -100dBm, as the line of sight was obstructed by some trees and the road turned as well, 1.3km, LOS, that’s a huge improvement from the 80m we got back at the office. We know these circumstances are very optimal but at least it shows us we are not way off and hopefully we can expect half of that range in a more real situation. We have still not tuned the matching network for the antenna, which we will do soon, so hopefully we can expect yet another improvement. I also did a test with a hacked Crazyflie 2.0 with a duck antenna. With this one I got about -70dBm at the same 1.3km spot. This could be a great hack for special applications that require long radio distance as it could probably go beyond 2km range LOS, both up- and downlink.

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

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 :)

Last week was a hectic but exiting week for me. First I visited Embedded World in Nürnberg and then made a visit to TUM university in München.

I was actually visiting Embedded World because ST Microelectronics contacted us and wondered if we could do a Crazyflie version with the more powerful STM32F3 and use ST MEMS sensors. So during the winter we did some prototypes where we fitted the pin compatible STM32F303CB and a LSM9DS0 9-axis MEMS module. Porting the code was pretty straight forward and took about a week. It was manly the drivers that needed porting but getting the FPU running also took some time. Our quick bench-marking test showed an ~35% increase of the floating point intense code and by using further speed boosters like the core coupled memory (CCM) it could probably be increased a lot more. Right now these extra CPU cycles aren’t really needed but for the future when more complex sensor fusion algorithms might be used they will be valuable. Therefore the STM32F3 series it very interesting as it packs plenty of processing power in a small package.

Having the ST-prototype on display in the ST booth at embedded world was quite a strange feeling. Something that started out as a fun thing to do on our free time is now sitting on a wall at big cenvenstion as EW, kind of hard to grasp. Unfortunately we where not allowed to fly around and play with it due to restrictions but I had a great time there anyway. I also participated in a short interview which ST arranged, really strange seeing yourself like that. I should probably focus on my engineering career instead… :-)

After the EW I went to visit the Techische Universität München TUM, as one of our most active users Oliver is studying there. Oliver made an awesome HUD and also contributed with most of the altitude hold code, and since München only is an hour away by train it was a great opportunity to go visit him. Oliver arranged so that Jacob from the computer vision group invited me to their department where they demonstrated some of their work, especially their work done with computer vision and quadcopters. Amazing stuff! I really hope we can do something together in the future and make this technology widespread.

For a while Invensense’s gyros has been the MEMS sensors to use in multirotor  applications due to their good performance and vibration rejection. ST Microelectronics are also big when it comes to MEMS sensors but their gyros has not been that good when it comes to handle vibrations. In the beginning if 2013 they released the 3-axis gyro L3GD20 which are advertised to improve this and we thought we finally would do an investigation. So we bought a Pololu  AltIMU-10 board which has ST sensors and also the iNEMO module, LSM9DS0, which is a very sweet 9-axis 4x4x1mm chip. After a bit of a soldering exercise we got them both attach to an accompanying Crazyflie. The AltIMU-10 board we glued to the bottom and connected to the expansion I2C buss. The LSM9DS0 was a bit trickier and we removed the MPU6050 and used some of its components for the LSM9DS0 so we could glue it up-side down to the board. I think the picture speaks for itself. After some quick and dirty coding we managed to get them both working and flying. The flying capability is very similar to the MPU6050 and we can’t really tell the performance apart. We will have to investigate it in more detail and for that we are adding a SD Card breakout to write raw data from all sensors at full speed. That will be the exercise for next week so stay tuned!

 

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

Our products at the Seeedstudio Bazaar are almost out of stock. Currently there are still some 10-DOF bundles in the Seeedstudio US warehouse, but the 6-DOF is old out. Below is the estimations for when things are back in stock. If you are eager to get any of the products that are out of stock, then you can always check with our distributors. If the bundles go out of stock it is also possible to buy the 10-DOF kit and Crazyradio separately.

  • 10/6-DOF bundles and kits will be restocked mid November
  • Spare motors will be back in stock mid October

The new motors have a little neat update, the top bearing is concealed inside the motor housing. This will make it much more crash resistant from forces to the top since there is no bearing to depress. The small downside is that it might be little bit more difficult to remove hard sitting propellers.

Bitcraze bazzar stock