Category: Loco Positioning

Last week we reached a milestone for our Loco Positioning System: we got 5 Crazyflie 2.0 to fly in a swarm with Time Difference of Arrival measurements. This is a great step closer to making the LPS leave the early-access state.

Until now, positioning has been done using a method called Two Way Ranging (TWR). The advantage of TWR ranging is that it allows us to easily get ranges to the anchors by actively pinging them in sequence. Based on these ranges we can then calculate the current Crazyflie position and control the Crazyflie to move to a wanted position. The big drawback though is that since each Crazyflie has to actively transmit packets to ping anchors, flying many Crazyflie means sharing the air and so the more we want to fly the less ranging each Crazyflie can do. In other words: it does not scale.

TDoA measurement consist of measuring the difference of flight time between packets coming from different anchors and this is harder to achieve since the anchor clocks must be synchronized to each other. The killer feature of TDoA is that it can be implemented using unidirectional packet sent from the anchor system and received by the tag/Crazyflie. It means that as soon as you get one Crazyflie flying with TDoA, you can get as many as you want since the Crazyflies do not have to transmit anything.

This is what happened last week: on Thursday evening we got 1 Crazyflie to fly with TDoA measurements. On Friday we tried 3 and then 5 without much effort. It was just matter of modifying the ROS launchfile to connect more crazyflies, a copy-paste operation.

Then

There still seems to be a margin for progression to get even more stable flight with TDoA and we are also working on making the LPS and Swarm work with our Python client which will make it easier to use outside a robotic lab.

If you want to try the (very experimental!) TDoA mode with your loco positioning system we have documented how to get it to work on the wiki.

Thanks a lot to the growing community that is supporting us and allow us to move faster towards a Crazyflie swarm.

Last week was interrupted, disrupted and generally chopped up as a few of us had to stay home fighting germs and viruses. Today all of us were present again and hopefully we will all be well this week to participate in the fun. Even though last week will not make it to the hall of fame when it comes to productivity we still made some progress.

TDoA mode of the Loco Positioning system

We are happy to announce that we have calculated the first TDoA (Time Difference of Arrival) based position in the Crazyflie. This might not sound very spectacular but it is one step closer to being able to position an infinite (in theory) number of Crazyflies simultaneously. We used test driven development (TDD) to implement the functionality and we think it helped us to manage the complexity and write better code. We have written a few unit tests earlier, but this is our first serious attempt at test driven pair programming. We have based the unit tests on Unity and mocking on CMock from Throw The Switch.  The result of our efforts can be seen in lpsTdoaTag.c and TestLpsTdoaTag.c.

New Logo

We have used a few different variations of logos up to now, the historical logo was good for electronic boards (PCBs) but hard to make look good in other contexts like the webpage and so we ended up in a situation where we do not have a consistent logo for everything. We have decided that we probably should try to find one that we all like and want to use everywhere. Björn has made a bunch of different designs that we all have discussed together and after a few iterations we are converging towards something really good. We will not show any previews, just stay tuned to see the final result.

bitcraze_logo_white_back_sq_spaced_1400x1400

The logo currently used on Bitcraze PCBs

Marcus Greiff

We want to welcome Marcus to the team, he will work with algorithms one day a week. Marcus is currently studying at LTH where he has been using the Crazyflie 2.0 platform in his studies.

SD-card expansion deck in production

Production materials for the SD-card expansion deck has been sent to the factory. Hopefully it will be available in the shop in a few weeks time.

We attended Øredev last week and showed off our demo with an autonomous Crazyflie with a light and sound show. It was the same demo as we had in Maker Faire Berlin earlier this autumn that we wrote about last week. It is noticeable how much better the system has become since Maker Faire Berlin when it comes to performance, the Crazyflie is almost completely static when hovering in one spot now and the motions are much more snappy and exact. Hats off to the community that contributed the improvements!

 

At Øredev we met Ray Arkaei, the DJ that played at the party in the evening. When he realized that we used MIDI to control the position of the Crazyflie and the color of the LED-ring, he immediately offered to create his own sequence to a bit more contemporary music. This is what we love with events like Øredev, we meet people and exciting (and unexpected) events take place! He plugged in his machines and we set the goal of making a short sequence, film it and upload it to facebook. After just 10-20 minutes of experimenting (and recap from our side of how we had implemented the demo) Ray got going and soon he had had a pretty cool sequence going!

 

We shot this video with a phone

 

Ray Arkaei
Arkaei shot the sequence with his 4K camera (yes, we would love to have one too!) but unfortunately did not have time finish the editing. We are eagerly awaiting the final results and will publish a link here on the blog when it is live!

Thanks to Ray and Øredev for a memorable day!

Bitcraze forum

We have been discussing the information architecture on the Bitcraze forum after getting some really good feedback from Fred (derf) one of our forum members. Before starting to make changes to the forum we thought it would be a good idea to take the opportunity and ask all of our forum members for feedback about how the forum is structured. The forum should be easy to navigate and comprehensible for both new and old members so feedback from people actually using our forum is very valuable. So if you have any suggestions post a comment to this post or send us an email.

Öredev

Also this week on Thursday 10/11-16 we are going to the developer conference Öredev that is taking place here in Malmö. We are exhibiting the same demo as we did at Maker Faire Berlin so if you are going to the conference expect to see an autonomously flying Crazyflie 2.0 enabled by our Loco positioning system (code and doc for demo published here). We are there the whole day so come by and have a chat :-).

infographics-oredev

New Crazyflie 2.0 firmware release

We released a maintenance release of the Crazyflie 2.0 firmware last week. The new release improves the stand-by time for the Crazyflie 2.0 and doesn’t effect the Crazyflie 1.0. The release can be found here.

Progress on TDoA for Loco positioning

We’ve started working towards positioning using TDoA and last week we pushed updates to both the Loco positioning node and to the Crazyflie 2.0 firmware. The changes are still largely untested but we’ll be continuing the work during this week. We’re really excited about the possibilities this brings, virtually unlimited number of Crazyflie 2.0s being positioned at the same time!

Loco positioning system is still in Early access which means that things are moving fast. Since the release of the loco positioning system a Kalman filter has been contributed by Mike Hammer at ETH Zurich. The Kalman filter allows to calculate the position estimate in the Crazyflie and merges the Loco positioning system information with internal sensor to generate a much better estimate. We also worked on improving the anchor firmware, it is now ranging faster and we fixed a bug that was making the anchor hang sometime. Finally stephanbro on github pushed an improved position controller that improved the stability of flight a lot.

Because of all these changes we have decided to make a new video and to rewrite the documentation on the wiki a bit. Enjoy!


On the development side, we have extended the Loco Positioning system to position 2 concurrent Tags by using TDMA (Time Division Multiple Access) where each Tag is allocated a time slot to use to range to the anchors.

2crazyflies

This works fine for a few Tags, but does not scale very well for a larger numbers of tags. If you want to experiment by yourself there is some instruction in the git commit. Be aware that this is still experimental enough for us to break it without warning so keep track of the git commits when you pull the latest version of the firmware. Currently we are working on a TDoA (Time Difference Of Arrival) mode that will scale to concurrently position virtually an infinite number of tags, hopefully you will soon be able to see commits on that on our Github projects.

One week ago we where presenting Crazyflie 2.0 and the Loco Positioning System at Maker Faire Berlin 2016. It was a lot of fun being there, we enjoyed it very much, and it also required a couple of weeks of preparation. The preparation was both mechanical and markerting: out booth was built with and outdoor tent frame and we featured the first roll-ups of Bitcraze history (almost felt a bit too ‘corporate’ for us :-).

On the technical side it was an opportunity to test Crazyflie and the Loco Positioning System in real event situation. This required stabilizing the system and testing it so that no bad surprises would happen during the faire. The result is pretty good: we flew more than 91% of the opening time, we had 2 fly-away the first day, fixed the problem and had none the second day. We were flying with 2 Crazyflie sequentially and had not broken any motor mount or other part during opening hours (some crazyness did happen after-hours though, maybe more on that on a later post ;-).

For our demo the Crazyflie was flying autonomously with the loco positioning system using the Kalman filter to fly towards a given x/y/z set-point. We made a midi-to-crazyflie bridge in ROS that allowed to give control of the Crazyflie position via a midi cable. We actually used a physical midi cable which was the safest and simplest. On the other side of the midi cable was a computer running a midi sequencer, lmms. Part of the sequence was playing actual music to make the Crazyflie dance and part was just silent movement. The setup looked like that:

Bitcraze Maker Faire Berlin 2016

Midi can encode notes pitch (ie. where in the piano you play) and velocity (ie. how hard you press the piano key). The midi track contained 4 tracks: X, Y, Z and LED-ring. In X, Y, Z tracks the note pitch converted into a position and we don’t use the velocity. The led ring track maps the note pitch to a color and the velocity to a brightness. It looks like that:

llms_mfb

This setup was a bit of a test, we found it to be very reliable. Some functionality were implemented on-site after Friday morning experience: automatic landing when the battery was low and reconnect on take-off to allow taking off without restarting anything in the PC just at a press of a button. The midi link worked well even though it feels a bit hackish to setup a choreography like that. If you have any better idea what to use to make a Crazyflie dance please tell us!

Last but not the least we have share all the codes, files and documentation for this demo on github so that you can run it yourself with an loco positioning system. We also made a short video showing the demo in action:

 

icon_berlin_dt

The Maker Faire Berlin is coming up and we are starting to get ready for showtime!

The last couple of weeks has been really busy getting ready for the Maker Faire Berlin. The plan is to show multiple Crazyflies flying autonomously enabled by the Loco positioning system. To spice up the experience of autonomous flight and to inspire the visitors to imagine future applications we have made a small light and sound show where the Crazyflie is dancing to a soundtrack Kristoffer made.

Here is a teaser where we are maybe stretching the limits a bit too far ;-):

Taking the opportunity to exhibit what we do at events like the Maker Faire Berlin is really exciting and we are looking forward to hanging out with cool people and getting feedback about what we do.

So come and visit us at Maker Faire Berlin is Sept 30 to Oct 2 at Station Berlin. You will find us in hall 3, stand 149.

See you there!

Until now, the Loco Positioning System have been limited to flying only one Crazyflie autonomously. In this post we will try to explain the reason of this limitation and what are the way forward.

The loco positioning system is based on Ultra Wide Band (UWB) radios that can very precisely measure the time of departure and arrival of a radio packet. This allows us to do two things:

  1. Use these times directly to calculate the flight time of the radio packet. This is called time of arrival (ToA) measurement, it can be done by simply pinging one anchor. No extra synchronization is required.
  2. Use the difference between the arrival of packets from two different anchors. This is called time difference of arrival (TDoA), it requires the system of anchors to be synchronized together.

The method 1) is simpler to implement since it does not require the anchor system to be synchronized, though it requires bidirectional communication between the tag (eg. Crazyflie) we want to locate and the anchors. It means that if you want to locate more than one tag you have to somehow share the air by not ranging all at the same time. The method 2) requires extra work to synchronize the system of anchor and is theoretically more sensitive to measurement noise. However TDoA measurements have a huge advantage: they can be made to work with unidirectional signal sent from the anchors. This means that the tag only has to listen to the air to receive all information needed to locate itself. This allows to scale the location system to as many tag as we want since adding a tag do not have to share the air, they are not transmitting anything.

So far we have been concentrating on ToA measurement since it could easily be implemented and gives us the best theoretical ranging performance. This allows to develop the algorithms to calculate position estimates and stabilize the autonomous flight. The problem is that, since we are just ranging as fast as possible with all the anchors of the system, one Crazyflie will take all the available air-time and we cannot fly another Crazyflie at the same time. We have just implemented a solution to fly more than one Crazyflie with ToA measurement using time-slots, this is called TDMA for Time Division Multiple Access, and it can be done without anchor code modification. We are working on the Maker Faire demo using this method and it is starting to work quite well:

For TDMA we define frame and time slot. One time slot is a space in time where one tag will be allowed to communicate without risking collision with others. One frame is a group of timeslot. Each Crazyflie is configured to use one time slot in each frame.

TDMA frame structure. Image from the Wikipedia TDMA article.

TDMA frame structure. Image from the Wikipedia TDMA article.

Normally implementing TDMA would require some kind of synchronization to make sure each Crazyflie knows when its time slot starts. With the LPS we are in luck though since transmitting time is part of the way the ranging is working: we do not have to implement new messages or even to modify the anchors to implement TDMA.

We chose the timer in anchor 1 as our master clock for TDMA. When a Crazyflie starts it ranges with anchor 1 which allows to get the current time in anchor 1, then the start of the next frame can be calculated and the Crazyflie can schedule to range in its next time slot. We range with one anchor per time slot and each time we range with anchor 1 we get a chance to re-synchronize.

The TDMA has been pushed to the Crazyflie master branch. It is documented in the commit message so please feel free to test it, report, and pull-request ;-). We have tested running in 2 slots mode with success. Very quickly though, when adding more time slots, the performance deteriorates because the rate of ranging per Crazyflie decreases. Then TDoA will lead to better performance which is the next target, after the Maker Faire Berlin :-).

 

 

icon_Berlin_dt-150x150@2x

Maker Faire Berlin 2016 is coming up and we will be there to show of the latest and greatest from our lab. The plan is to show:

  • the Loco Positioning system and autonomous flight
  • a (small) swarm – we hope to get more than one Crazyflie in the air at the same time, even though the space is very limited
  • there are ideas of some sort of synchronized sound- and light show with an autonomous Crazyflie, all controlled from a MIDI sequencer
  • a virtual cage to stop a Crazyflie from escaping when flown manually
  • a preview of the Arduino based controller to fly the Crazyflie
  • a Loco Positioning tag that can be used to track other devices/robots than the Crazyflie
  • ROS integration with the Crazyflie and Loco Positioning system

We’re not sure we will succeed with them all, but let’s hope for the best. Is there anything special you are interested in? Please let us know!

Maker Fair Berlin is Sept 30 to Oct 2 at Station Berlin. You will find us in hall 3, stand 149.

We love your feedback and are looking forward to meeting you all and talk about your projects, what we do and future ideas.

See you in Berlin!

 

 

As noted in a previous post, Mike Hamer from ETH Zurich has been implementing an Extended Kalman Filter (EKF) for the Crazyflie. The beginning of this week I am visiting Michael at ETH and we have now pushed the EKF to the Crazyflie master branch!

Visiting ETH is really nice, and it is very impressive to see the Flying Machine Arena in real life. Though, owing to the Crazyflie’s size, we do not need such a big space and can work in a more regular-sized room.

The EKF has now been added to the master branch but is not enabled by default. It is currently intended to be used with the Loco positioning system (although it should be easy enough to integrate with onboard GPS, or potentially offboard motion capture measurements). While it does fly better than the currently used, offboard particle filter for autonomous flight, it requires some care to work properly. I am going to update the wiki description for the loco positioning to document how to get started with the EKF during the week. Our hope is that through community engagement and feedback, we can continue to improve and tune the filter, now that Mike has put the basic functionality in place.

The greatest enhancement is that the Crazyflie is now able to estimate its own position, without the help of an external computer. Coupled with the onboard controller, the Crazyflie can now fly fully autonomously. I have also pushed a new example in the Crazyflie python lib that shows how to send an X/Y/Z set-point to fly the Crazyflie, allowing it to fly through waypoints.

In the near future we (Bitcraze, and hopefully, the community!) need to work on a couple of more things to make it fly even better

  • Revamp of the controller: the current controller is a position controller, splitting it in two controllers, one for position and one for velocity, would allow for a more stable flight and to finally use TheSeanKelly new PID settings!
  • Implementing TDOA positioning on the LPS would allow more than one Crazyflie to fly at the same time
  • Implementing the new commander packet in the Crazyflie, python lib and ROS driver. This will allow us to stop hacking the current commander each time we need a new functionality (such as onboard position control) — and since I have push rights, only my hacks get pushed, which is unfair ;-).

Mike will describe the Kalman filter in greater details in a future post. In the mean time we will update on the progress in the Loco Positioning mailing list.