Author: Kristoffer Richardsson

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!

The logging subsystem of the Crazyflie 2.0 is fairly flexible and easy to use, but despite its nice properties it may still be limiting in some scenarios. Two areas where it is lacking are offline- and high-speed logging. As a step towards solving these problems we are happy to announce support for micro SD-cards in the Crazyflie 2.0 firmware.

sdcard-proto

We have had a prototype for a micro SD-card expansion deck lying around in the office for a long time but have not had time to write any code for it. Finally we decided to go ahead an fix it and now there is a first basic version in the master branch of the firmware. What we have added so far is a driver for communicating with the deck and support for the FAT file system and that means that it is possible to read or write files to/from a SD-card. We have not yet implemented any means for configuring parameter logging to file but that is something we would like to do in the near future.

DIY

The hardware design for the expansion deck is very simple.

sd-card-wiring

If you are eagerly waiting for this functionality it should not be too hard to create your own deck, otherwise we plan to release one sometime in the near future. We can not promise when, but if you need it please let us know as it might change our priorities when deciding what to do.

When the deck is installed all you have to do is build the firmware with 

CFLAGS += -DDECK_FORCE=bcUSD

in the tools/make/config.mk file to enable the SD-card functionality and add your own code in src/deck/drivers/src/usddeck.c to read or write to your SD-card.

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!

 

 

It is summer time and the tempo in the office is a somewhat slow as most of the Bitcrazers are on vacation recharging their batteries for future awesomeness. This weeks blog post will not contain any cool tech stuff but instead I will tell you a bit about how we work. This is a moving target as we are continuously changing and improving, but I can share a snapshot of how it works right now.

Basics

We have two basic principles that all our work is based on: self organization and continuous improvement.

Our take on self organization can be boiled down to the simple idea that no one in the company can decide what someone else must do. That is right, no one (or every one) is a boss! The result is that we have to find solutions that everyone can accept, this in turn requires complete trust and respect within the company.

Continuous improvement means that we try to become better at what we do. If we fail we try to understand why and find a better way next time. If we succeed we enjoy the success and then we try to understand why we were successful and find an even better way. The key ingredient is feedback, based on (again) respect and trust.

How we do it

Planning can be a useful tool but it can also be expensive when overused. Plans give a shared direction but the cost is that they take time to maintain, they tend to reduce agility and most likely they will be more or less wrong. We try to balance this by planning as little as possible and making long term plans less detailed. We consider planing to be a an opportunity for discussions and the actual plan as a documentation of the discussion. The discussion is more important than the plan it self.

Our long term direction is set by our purpose – the reason we go to work and invest all these hours into this project. We have tried to form one single sentence that captures this and the latest version is “Together we innovate and explore robotics”. The sentence it self is not that important but the discussions leading up to the sentence is what matters.

From the purpose we have tried to create a one year plan and a three year plan based on what we all would like to achieve in the coming years. This is very much a wish list, pretty vague. Every quarter we create a quarterly plan based on the one year plan. This is a list of areas we think are important to work with in the coming tree months, it usually does not contain very specific goals but gives us a good idea of what to do.

board

Björn at the whiteboard writing fake sticky note and looking busy

We kick off every week with a feedback and planing meeting. We look back at the previous week and investigate what we did, why we did it, the outcome and what we felt. When we have agreed on the past we turn to the future and decide what we think are the most important things to work on in the coming week. We also decide on a few experiments that we want to try out that we think will improve the way we work and increase our happiness.

We start every day with a short standup meeting to synchronise the team, understand how we can help each other and make sure we are doing the right thing.

The rest is just hard work :-)

Some inspiration

More about self organization. and what is motivating us?

 

aman_sharma

Going out of the norm for this week, this blog post is about my experience as an intern at Bitcraze. My name is Aman and I joined Bitcraze 8 weeks ago hoping to gain more experience and knowledge in quadcopter robotics while building some new connections.

Working at Bitcraze has been a breath of fresh air compared to all my previous internship experiences. From the work environment to the five brilliant guys that run this company, I believe everything was setup for me to have one of the best internship experiences. Someone was always available to help me with any concept I did not understand and even though I was just an intern, each of the guys made sure to include me in every part of the planning process. This type of inclusion, I believe, allowed me to see my role in the company and how I contributed to the overall goals.

While here, I mainly focused my work on the flight control software behind the Crazyflie. This included learning and understanding the framework behind the crazyflie, tweaking the existing firmware code to get location data, converting MATLAB code to Python that would provide location of all the anchors in a Loco Positioning setup by simply moving the crazyflie around, designing a filter that would provide more stability during flight operations during ‘Fun Fridays’ (definitely a great idea), etc. Also, with Arnaud’s help, I was able to learn how to juggle while I taught him how good peanut butter goes with bananas.

In my opinion, the reason for Bitcraze’s success and the reason it is such an amazing place to work is because of the way the company is setup. They follow a company structure called ‘self organizing’. Having never heard of it before or experienced it before, I was a bit thrown off when I first started working in this environment. Here at Bitcraze, there is no heirarchy, but, instead everyone is a leader of their own individual roles, a concept I believe allows them to solve even the most difficult of problems with ease. Once I acclimated to this, working for Bitcraze tenfolded in awesomeness. The only downside, though, you will never want to work anywhere else again.

During my experience here, I have gained a plethora of skills and have had many great experiences. Most importantly, however, I have built great relationships and learned that where you work and who you work with is just if not more important than what you work on.

PS: They love visitors here, so feel free to come and hangout with the guys!

–  Aman

Thanks!

We have enjoyed your internship a lot! You quickly adapted to our crazy way of working and became a natural member of the team, adding not only your technical skills but also your personality and new angles on what we do.

We hope we will see more of you in the future!

–  The rest of the Bitcraze team

Controlling the Crazyflie from the PC client through the Crazyradio gives you a lot of flexibility and power when it comes to coding and scripting. The drawback is that you need a computer and Crazyradio which is fine in the office, but not as convenient when flying on the go. As a part of our Friday-Fun hacks we have been working on a standalone controller with everything included to solve that problem.

I finished the first working basic prototype a few weeks ago and have done some test flying during my vacation. I (and the son of a friend) am very happy with the performance end ease of use, so I think it is time to move on and create a usable product.

standalone_controller

So far the controller is very basic, it is only two joysticks, an Arduino and a radio. All it does is to scan the joysticks and send controller packets on a fixed radio channel. Even though it is super simple I like that it is possible to just turn it on and fly, no other actions are required!

The product will have (many) more features, the question is what to add? This is your chance to be a product designer, if you have any input or wishes let us know!

Some ideas that we have so far:

  • Support other protocols to control other copters or robots
  • Arduino compatibility to make it simple to alter the functionality and behaviour
  • Expansion ports, maybe compatible with Crazyflie decks
  • USB and bluetooth low energy to use it as a generic game controller
  • A mode to use it as a Crazyradio connected to a computer over USB

We also need to come up with a name, please share your ideas!

As some of you might know, we are working full ahead on developing a local positioning system for the Crazyflie 2.0 ecosystem. There are many things to be done and we just took two major step by improving the stabilizer code architecture and moving the position control code into the firmware. Getting the position from an external system is fine and dandy, but we also have to control the pitch, roll and yaw of the Crazyflie to keep its desired position. Up til now we have been running this control algorithm outside the Crazyflie in an external computer, but now we have moved it into the Crazyflie itself. The controller is a simple PID controller and can definitely be improved, but the main purpose of the work has been to improve the architecture in this area. We know there are people in the community working on position related features and we hope the new architecture will make it easier for us all to implement the bits and pieces needed to get an autonomous Crazyflie. The estimation of the position has not been implemented in the firmware yet but the architecture now has support for it.

The general layout of the new architecture is as follow:

  • The sensors are gyroscope, accelerometer and pressure sensor. More could and will be added in the future like position and altitude measurement.
  • The state estimator calculate an as good as possible estimate of the Crazyflie state using the sensor values. The state contains the Crazyflie orientation (roll, pitch, yaw), its position and speed. Currently the state estimator has complementary filters for the orientation and the altitude. In the near future the full position will be estimated as well.
  • The commander generate a setpoint to be followed by the Crazyflie. Currently this is only done by receiving commander packet from the ground using Crazyradio or bluetooth low energy.
  • The state controller generates control output to achieve the requested setpoint from the current state.
  • Finally the power distribution is translating controls from the controller into driving the actual motors.

This is implemented in stabilizer.c and each block is implemented in there own file. Stabilizer.c used to be very verbose and complex to read and modify, it has now been greatly simplified and the above architecture is implemented in one short loop (see the full code in GitHub):

while(1) {
  vTaskDelayUntil(&lastWakeTime, F2T(RATE_MAIN_LOOP)); // 1KHz

  sensorsAcquire(&sensorData, tick);
  stateEstimator(&state, &sensorData, tick);
  commanderGetSetpoint(&setpoint, &state);
  stateController(&control, &sensorData, &state, &setpoint, tick);
  powerDistribution(&control);
  tick++;
}

Our philosophy with this new architecture is to keep the code as simple as possible and to allow customisation at compile time. The high-level functions have as simple as possible interface and so can be exchanged easily. So if tomorrow, we have a shiny new controller we just have to compile it instead of the current PID controller. We think that this fits the way the Crazyflie is used, as a development tool.

This is just the beginning: there is still some more to clean-up in the functions and we will most certainly enhance the code from feedback. Please tell us if this is useful and how it can be enhanced even more.

We have stared to look at what is needed to make the Crazyflie position aware and to integrate the upcoming positioning system. The rough idea is to add a position estimation module to the firmware of the Crazyflie that will be responsible of estimating the current position based on data from internal or external sensors. The sensors could be mounted on the Crazyflie but it should also be possible to inject the position over radio from an external system. A control module will use the estimated position to try to navigate the copter to a desired position that could be set for instance by a user or by some navigation algorithm. If you want to participate in the design discussions or implementation head over to github where we will use issues for this conversation.

We decided that a suitable first step was to improve the altitude hold, so that is what we did last week. The code has been refactored and improved and we think the altitude hold is now working much better than before. It’s not perfect, still room for improvements :-)

Tilt compensation

While we were at it we also added a thrust compensation to avoid loosing altitude when tilting the copter. It turns out it makes flying easier as the pilot does not have to add extra thrust when moving around. Good for both human and automatic pilots.

Hackster.io

Have you checked out our projects on hackster.io? Help out and make Bitcraze a featured platform by adding your own project or just follow us, we need 10 projects and 25 followers to be featured. You can make a difference!

During the autumn we introduced the docker based builder images that are used for builds on the CI server. They make sure the build environment is well known and reproducible which is key on the build server, but they can also be very useful when building code locally on your machine. The obvious upside is that if a build passes in the builder on your local machine, it should also pass on the CI server but the really nice thing here is that you don’t have to install compilers, frameworks or tools on your machine, the builder handles all that for you! The drawback has been that it requires some typing to use docker, for instance building the crazyflie-firmware project would require you to type

docker run --rm -it -v ${PWD}:/module bitcraze/builder tools/build/build

That is quite a lot of typing and to solve that we now introduce the Toolbelt, it makes it dead simple to compile or test any bitcraze project.

The Toolbelt is a set of scripts that fires up the correct builder image and then executes your build script in that container. When done, the container is shut down and disappears. For instance to build the crazyflie-firmware project with the toolbelt, locate your self in the root of the project and type

tb build

Thats it!

So how do you install it? How does it work? The toolbelt it self is also running in a docker container(!) so all you need is to install is Docker and add an alias to your .profile or .bashrc file. Run a toolbelt container to get instructions on how to install

docker run --rm -it bitcraze/toolbelt

or read the (limited) documentation on the wiki, the github repo and the help.

The toolbelt works with almost all our projects such as firmware for the Crazyflie, the radio and even our website project! The toolbelt is tested on linux and OSX. It will probably work on windows as well but we have not tested it, so if you fell inclined, please contribute any insights or fixes to the repository.

Does the Toolbelt replace the VM? No, the toolbelt is simply another option, the VM will still be around. The VM offers a more complete solution than the Toolbelt, while the toolbelt is more light weight and lets you work with your normal editor and other tools you are used to.

Let us know what you think and happy hacking!

logo

Greetings all community members!

This week we have a couple of requests that we hope you can help out with. First of all we would love to hear about all the cool projects you are using the Crazyflie for out there. We have wanted to collect this for a long time and now we have found hackster.io. Go to https://www.hackster.io/bitcraze/projects and add your favourite project. Also make sure to follow us at https://www.hackster.io/bitcraze, if you don’t have an account already it’s quick to create one, our hope is to use hackster.io to create a new way for our community to grow.

glove_closeup

Secondly we are curious of how the Crazyflie is used in education. If you are using it as a teacher or as a student, we would be very happy if you send us an email to education@bitcraze.io and describe how you use it and any other feedback you have.

Last week we finished the manufacturing of the first alpha builds of our new positioning system. A few systems have been shipped to selected users for initial trials but we still have a few left, so if you are interested in trying one out, drop us an email at contact@bitcraze.io and describe what you would use it for.