Came across a project, the LIDAR-Lite by PulsedLight on the crowdfunding site Dragon Innovation (not to be confused with Drogon, the quadcopter). It is an optical distance measurement device for accurate high performance sensing with many advantages over IR or sonar range sensors. Looks pretty impressive and perfect for quadcopters among many other applications.
I decided to create a Wiki for the Drogon Quadcopter project to have something that is better suited for that type of content. Blog posts on the topic will stay at joemonti.org, but all information, documentation, etc will be at drogonquad.com. Just in case you forgot:
Check it out!
I started working on a new little robot called Gremlin. It is based on a Parallax Boe-Bot base with an Erector set and plexiglass frame. For electronics it has a Raspberry Pi w/ WiFi adapter, 16-channel I²C Servo controller and the Raspberry Pi Camera Module. Power comes from 10 AA batteries (4 for servo controller and 6 for Raspberry Pi), but I will likely upgrade to LiPos. Here’s a short video showing the Android control app (sorry for the crummy production quality):
It’s currently missing the 6 AA batteries for the Raspberry Pi (I’m waiting on a few parts), so the tether is just there to power the Pi.
The Android app is a little something I wrote which connects to the robot over the network (WiFi). It has a live video stream and virtual joystick controls. Once I get the whole mobile power assembly hooked up I’ll be able to use it for telepresence.
With my primary robotics project, the Drogon Quadcopter, grounded for the winter, I’ve started Gremlin to keep some of the work going The goal is really to have a smaller, easier to work with mobile robot for building a general purpose robotics software platform for Drogon and any other robotic projects I pursue. Also I’d like to use it as a test-bed for building learning algorithms and working with the camera, also applicable to Drogon.
Here are few more photos:
Had an awesome time at Maker Faire NYC 2013!! Tons of cool projects and cool tech.
I posted my photos on my Google+ page:
Here is a few samples
It has been too long since my last update, so here is what’s been going on. Up to my last update where I was testing under full manual control I was in a hurry to get the robot running. In that, I was successful. I got the hardware assembled, access to the hardware via the Arduino, and verified it all worked. The next big step was to develop the flight control software to keep the robot stable in flight and to be able to move where I want it to move. That is what I am working on now.
I have made a few attempts at flight, mostly tethered. There was one untethered test with unsuccessful results although I did get off the ground for the first time which I was not able to do under manual control:
The flight control algorithm approach I am using has three components:
- Position — Determines the position of the robot from the sensors.
- PID Control — Uses the current position versus the desired position to make adjustments to motors using a PID feedback control algorithm.
- Continual Learning — Measures success of PID Control to make adjustments to PID algorithm parameters.
I am approaching these components in order, with as much flight testing as I consider safe during the process to work out bugs, see how it performs, and gather data. I plan on developing a relatively simple Position algorithm so I can develop the PID Control algorithm and model the best PID algorithm parameters I am able to manually tune. Hopefully with that I will get more flight data to improve the Position algorithm and gather data for the Continual Learning algorithm. Then I will tackle the software for the Continual Learning algorithm. I don’t yet have a full plan for that, but I have many ideas on where to start.
The first challenge is simply getting accurate positional data from the accelerometer and gyroscope. First, the sensors measure different things. The accelerometer measures acceleration, which can give some indication of position by effect of the acceleration due to gravity since the acceleration due to gravity is constant. The gyroscope measures rotational velocity in degrees per second. Second, both are fairly noisy, especially with the motors going and the copter starts moving. Right now I have a very simple algorithm to combine the two sensors into a single angular offset of the pitch and roll (ignoring yaw for now) with a running average filter. I have also developed the main PID control algorithm, with some potential improvements to try once I get it running.
To tie these pieces together and to turn them into final motor adjustments, I have a series of translation steps that need to be made. First I have to translate the coordinate space of the robot, which is how the position of the robot is tracked, to the coordinate space of the motors because the motors are offset 45 degrees from the axis of the robot (called an “x” configuration quadcopter as opposed to a “t” configuration). This translates the position of the robot, through rotation matrices, to determine the position of each motor. To determine the error value to use in the PID algorithm, I use the arc-length of the offset of each motor from the zero-position (to achieve robot motion, instead of the zero-position, the offset will be from a target position which would cause the desired motion). Two error adjustments are calculated and applied oppositely to opposite motors by adding (or subtracting for the opposite motor) to a target motor speed. The target motor speed is currently determined by the receiver channel 3 value.
I am currently modelling the PID algorithm to guess at good PID algorithm parameters by feeding position changes into the algorithm and analyzing the results. More on this later.
As part of the development process for Drogon, I wanted the first attempt at flight to be under full manual control. I did not expect to be able to fly, I wanted to see what happened. At the very least I hoped to validate things like the motors providing enough lift and to collect sensor data to help build the stabilization algorithms.
During the manual control testing I am only working from the Arduino. The Raspberry Pi is only acting as a logger, reading the stream of sensor and control data from the Ardruino over the serial connection. The Raspberry Pi won’t really be used until I get further along with the stabilization, control, and management software.
The first set of tests were tethered to a wood pallet. The pallet is large and heavy enough to give the quadcopter a safe and restricted environment to test flight controls. In my first attempt, the tether lines were too long so it ended up just tipping over and the propellers slammed into the pallet. Fortunately it came away with no real damage.
Here’s a picture:
And here’s a short video clip:
The next tethered test was more successful. I shortened the tether lines and was able to gain lift off the ground and even verify the manual direction controls worked.
Now that the controls were validated with tethered testing, I moved on to outdoor un-tethered flight testing. As expected, full manual control did not achieve flight. Just a lot of tipping over. Below is a shorter clip from the test session.
Next steps are to begin work on the stabilization algorithm. I expect that to be a gradual process as I build out, tweak, redesign, tweak some more, and optimize the code and algorithm constants. As it stands at the time of this post I have made some progress on the stabilization algorithm and even made a few test flight attemps. I hope to write up a post on it soon. Check out my YouTube playlist with all of the test videos:
Check out the github project for the work in progress
Assembly is just about complete now on the Drogon Quadcopter at least to be able to do initial flight tests. Motors and speed controllers are all mounted with the wires secured. The speed controllers have been programmed with the programming card and have been verified that they spin in the correct direction. Next steps are to finish up the coding and attempt first flight.
Here are some photos:
I did run into a few issues. The big one was that when I first hooked everything up I setup a test to make sure the motors, speed controllers, etc worked. Well, they didn’t. None of the motors from any of the four I/O pins I was using worked. I couldn’t even arm the speed controllers which I thought I had worked out. After testing everything from the control signal to the basic I/O of the I/O pins, I traced it back to not even being able to read 3.3v with a multimeter when setting the pins with digitalWrite to HIGH. I may have reversed polarity when I was first making sure everything got power. Whatever the cause, those pins (2-5) were dead. To work around the issue so I didn’t have to buy and wait for a new Arduino quite yet, I rewired the 4 pins (8-11) intended for the LEDs instead to the motors, updated the code, and right away I got the speed controllers arming and spinning up without issue. I still need to re-wire the LEDs. I added a new header to the Arduino shield to borrow 4 unused pins.
I also still need to mount the Raspberry Pi Camera module. I have the mount, screws, and standoffs. I just need to drill everything out and mount it. But I think I will hold off until I make first flight. As an alternative, how about a Google Hangout? I can mount an old Anrdoid phone on the Quadcopter. Let me know if you’d like to join the hangout.
Next post I hope to be flying!
I have started mounting and wiring more parts on Drogon. Here’s a photo:
The first is that I have mounted and wired the LEDs for each arm. They will blink relative to the speed of their corresponding motors. Also, the two front arms have red LEDs and the two back arms have green LEDs so I can better tell the front from the back. The LEDs came mounted in a small plastic housing meant to pressure fit into a hole, so I chose to drill through the arms (hopefully this wont compromise the strength too much!) so the LEDs came out the bottom. This way they would be most clearly visible while the quadcopter is above you.
Second, I had only enough screws to mount one motor (the rest are coming soon) so that is now mounted along with its speed controller. For now the wires are a little loose because I may need to reverse the direction of the motor.
Next I added the USB hub to manage power for the Raspberry Pi. And finally I made the wire and connected the serial line between the Raspberry Pi and the Arduino.
Still more work to go but making progress.
Quick project update. The boards (arduino+custom shield, RaspberryPi, and receiver) now have their holes drilled and are mounted on the frame. I also have added the rigging for the battery (rubber mat and velcro strap). Here are a few photos.
I needed to order a few additional parts for mounting motors and Raspberry Pi camera module. So now waiting on those.
The HoverDrone project has been given a new name: Drogon. Named after one of Daenerys Targaryen‘s 3 dragons, Drogon, from the A Song of Ice and Fire book series (A Game of Thrones, A Clash of Kings, and others) by George R.R. Martin. I think the name is fitting for the project, although I hope it never breaths fire (either intentionally or unintentionally). I’m not a big fan of the word “drone” given its negative connotations and implication that it is unintelligent and/or human controlled.
I have started a few new Github projects for the Drogon software systems:
- drogon-arduino : Arduino sketch for handling low-level flight stabilization, navigation, and sensor management.
- drogon-master : A Java web application to run on Drogon’s Raspberry Pi providing high-level control and management.
The project is still in very earl stages. Drogon cannot yet fly but it is coming together.