This is my first proposal as an acceptable April 1 video. It did in fact take off, move forward, turn, and land. I needed to hold it by the tail because the tail rotor part isn't done yet, and for safety.
Wednesday, March 30, 2011
Tuesday, March 29, 2011
Names
Everything needs a name. For instance, on the Space Station, we have the Destiny lab, Unity node, Quest airlock, basically every nut and bolt has a name.
Likewise for this project. The over-arcing name for all my projects since 1998 is Kwan Systems. This is from Tagalog, where kwan is basically the same as English "whatchamacallit" except it isn't intended to be funny in Tagalog. Kwan Systems is therefore a valid home for any conceivable project.
My work in electronics is under a subdivision of Kwan Systems called St Kwan's Home for the Terminally ADD, loosely inspired by a line from Harry Potter (His guardians denied sending him to a magic school to their friends, and instead claimed he was going to "St. Brutus' Secure Centre for Incurably Criminal Boys"). The terminally ADD part is in relation to my ocean of unfinished projects. One of my main goals with the AVC is to actually FINISH SOMETHING!
All my computers have names, including the controllers I use. Almost all of them are cute little girls or women characters from various anime shows, usually secondary characters. The two computers in this project that I am directly programming are called Arisa and Kyoko, as I mentioned before after the crew of Poison 1 in Nuku Nuku. Arisa was the pilot, and Kyoko was in the back seat, managing the engines, weapons, sensors, etc. Since Arisa is the pilot, the whole project is called "Project Arisa". Arisa is the name of both the Logomatic and sensor hardware, when involved with this project, and the name of the software running it. Likewise, Kyoko is the name of both the Arduino and engine room board, and the program running on it.
The aircraft itself doesn't have a name yet. Poison 3? Well, it's a helicopter, not a fanjet. Howbout... "The Flying Resume!" If I needed a job, sure, but I have one right now, thanks. I'll probably just call the whole thing Arisa.
When the Logomatic is being used as a rollercoasterometer, it is called Isabella, from Phineas and Ferb. When it is used as a rocketometer, it is called Candace, also from Phineas and Ferb. The rocket it rides in is also called Candace.
Likewise for this project. The over-arcing name for all my projects since 1998 is Kwan Systems. This is from Tagalog, where kwan is basically the same as English "whatchamacallit" except it isn't intended to be funny in Tagalog. Kwan Systems is therefore a valid home for any conceivable project.
My work in electronics is under a subdivision of Kwan Systems called St Kwan's Home for the Terminally ADD, loosely inspired by a line from Harry Potter (His guardians denied sending him to a magic school to their friends, and instead claimed he was going to "St. Brutus' Secure Centre for Incurably Criminal Boys"). The terminally ADD part is in relation to my ocean of unfinished projects. One of my main goals with the AVC is to actually FINISH SOMETHING!
All my computers have names, including the controllers I use. Almost all of them are cute little girls or women characters from various anime shows, usually secondary characters. The two computers in this project that I am directly programming are called Arisa and Kyoko, as I mentioned before after the crew of Poison 1 in Nuku Nuku. Arisa was the pilot, and Kyoko was in the back seat, managing the engines, weapons, sensors, etc. Since Arisa is the pilot, the whole project is called "Project Arisa". Arisa is the name of both the Logomatic and sensor hardware, when involved with this project, and the name of the software running it. Likewise, Kyoko is the name of both the Arduino and engine room board, and the program running on it.
The aircraft itself doesn't have a name yet. Poison 3? Well, it's a helicopter, not a fanjet. Howbout... "The Flying Resume!" If I needed a job, sure, but I have one right now, thanks. I'll probably just call the whole thing Arisa.
When the Logomatic is being used as a rollercoasterometer, it is called Isabella, from Phineas and Ferb. When it is used as a rocketometer, it is called Candace, also from Phineas and Ferb. The rocket it rides in is also called Candace.
BatchPCB
What can I say about BatchPCB... I submitted my design 10 Feb 2011, and received the boards on 2 Mar 2011. They were actually available on 1 Mar, but I didn't check my email early enough in the day
Waiting for the boards is part of the fun, I guess. Not a lot of feedback, there are only about 4 points in the process that are notified.
I needed one of each of the bridge and engine room boards. I ordered two copies, and got two copies of each of my copies. Two copies of two copies of two boards equals a total of 8 boards. I was surprised to get two copies of each thing I ordered, as I did not see this mentioned anywhere on the site. Now that I have four of each board, I am happy that I do.
The boards are faithful reproductions of my design. About half of them had really thin, sharp silkscreening, and the other half were quite a bit bolder but a little bit fuzzier. At one place on all four copies of the bridge board, the soldermask is a bit thin, and on one copy, the copper shows through.
All the boards worked as designed with no green wires, thanks both to my accurate design and BatchPCB's accurate reproduction of the design. This doesn't count the design flaws mentioned below, or the ultrasonic rangefinder I am going to wire to the bridge as an altimeter.
If I were to do it again, I would order from Dorkbot PDX. Not that I am dissatisfied, but Dorkbot promises faster turnaround and three copies of each board ordered. The price per square inch is higher, but it is free shipping and no setup cost.
Waiting for the boards is part of the fun, I guess. Not a lot of feedback, there are only about 4 points in the process that are notified.
I needed one of each of the bridge and engine room boards. I ordered two copies, and got two copies of each of my copies. Two copies of two copies of two boards equals a total of 8 boards. I was surprised to get two copies of each thing I ordered, as I did not see this mentioned anywhere on the site. Now that I have four of each board, I am happy that I do.
The boards are faithful reproductions of my design. About half of them had really thin, sharp silkscreening, and the other half were quite a bit bolder but a little bit fuzzier. At one place on all four copies of the bridge board, the soldermask is a bit thin, and on one copy, the copper shows through.
All the boards worked as designed with no green wires, thanks both to my accurate design and BatchPCB's accurate reproduction of the design. This doesn't count the design flaws mentioned below, or the ultrasonic rangefinder I am going to wire to the bridge as an altimeter.
If I were to do it again, I would order from Dorkbot PDX. Not that I am dissatisfied, but Dorkbot promises faster turnaround and three copies of each board ordered. The price per square inch is higher, but it is free shipping and no setup cost.
April Fools!
The AVC approaches. I think I can write a Kalman filter and control loop by then. However, the April 1 due date for the vehicle autonomously turning a corner approaches even faster!
Is there any way that I can finish it by then? If I get the control loop and filter running on April 1, I am basically done. What do I do for the next 22 days? Besides, I'm not sure that even I could do that much coding in the three remaining evenings by then. Especially if I keep writing this blog instead of code.
I think I can do it open loop. By running the motors on a schedule, I think I could get it to travel the 15 feet around my basement to meet the letter of the law. It wouldn't be anything like the final program running it, but it would be something.
From test flight 3, I was able to measure the approximate hover thrust needed, about 145 when fully charged. So, the program is, run at about 155 for a couple of seconds, then back to 145, tail rotor up a bit to tilt forward, then run at 155/135 to make the turn, back to even, fly a couple more seconds, then set it to 135 until it lands.
I don't even need the bridge for this.
Is there any way that I can finish it by then? If I get the control loop and filter running on April 1, I am basically done. What do I do for the next 22 days? Besides, I'm not sure that even I could do that much coding in the three remaining evenings by then. Especially if I keep writing this blog instead of code.
I think I can do it open loop. By running the motors on a schedule, I think I could get it to travel the 15 feet around my basement to meet the letter of the law. It wouldn't be anything like the final program running it, but it would be something.
From test flight 3, I was able to measure the approximate hover thrust needed, about 145 when fully charged. So, the program is, run at about 155 for a couple of seconds, then back to 145, tail rotor up a bit to tilt forward, then run at 155/135 to make the turn, back to even, fly a couple more seconds, then set it to 135 until it lands.
I don't even need the bridge for this.
Voices of a Distant Star
Am I re-inventing the wheel? Of course. IMUs are known technology. I could probably buy all the electronics I wanted from DIYDrones, or something. But, if I did that, it wouldn't be DIY now, would it?
I am inspired in part by an anime OAV called Voices of a Distant Star. It's pretty highly critically acclaimed, but I didn't like it much, mostly because it didn't have an ending. The interesting part is that it is a 45 minute OAV which is written, directed, animated, edited, by ONE PERSON! There are three voices, but the director did one of those also, and the other two are female.
I want to do this myself, even if I am reinventing the wheel. It will be my wheel, and I will understand it from the resistors to the logic gates to the Kalman filters and the control loops. Besides, the world needs some triangular wheels.
I am going to publish everything when it is ready, EAGLE files, source code, lots of notes on Kalman filter math, everything. But, if you just blindly follow it, you won't learn nearly as much as if you do it yourself.
Remember: If you have even half as much fun reading about this as I had doing it, I had twice as much fun as you.
I am inspired in part by an anime OAV called Voices of a Distant Star. It's pretty highly critically acclaimed, but I didn't like it much, mostly because it didn't have an ending. The interesting part is that it is a 45 minute OAV which is written, directed, animated, edited, by ONE PERSON! There are three voices, but the director did one of those also, and the other two are female.
I want to do this myself, even if I am reinventing the wheel. It will be my wheel, and I will understand it from the resistors to the logic gates to the Kalman filters and the control loops. Besides, the world needs some triangular wheels.
I am going to publish everything when it is ready, EAGLE files, source code, lots of notes on Kalman filter math, everything. But, if you just blindly follow it, you won't learn nearly as much as if you do it yourself.
Remember: If you have even half as much fun reading about this as I had doing it, I had twice as much fun as you.
She canna take much more o' this, cap'n!
I'm givin' 'er all she's got, Cap'n!
All she's got isn't good enough. What else do you got?
The supposedly "low power" part of the engine room is quite low-powered compared to even the tail rotor, but: it draws about 50mA for the CPU, probably about 20mA for each light on the arduino, and 20mA for EACH of the little infrared LEDs inside the opto-isolator. When all the motors are running, this means that the engine room is drawing ~200mA at 5V, or one full watt.
This was originally designed to be powered by the LiPo battery and 3.3V regulator on the Logomatic, run through a boost converter to get it up to the 5V that the Arduino wants.
Something interesting though: The regulator on the Logomatic is set to deliver only 150mA. Now this is enough to run the LPC chip, a couple of sensors, and maybe a GPS, but certainly not 200mA above and beyond that (actually a bit more, since it is at 3.3V instead of 5V). So, it tries to go into thermal shutdown (the part is uncomfortably hot on the board!) but that darn boost converter just keeps sucking as much power as it needs to get 200mA for the 5V side. The Arduino is humming along like nothing is the matter, while the 3.3V line on the Logomatic drops to a mere 1.7V! This puts the LPC into brownout reset, of course.
So, teensy tiny design flaw number 2: The Bridge cannot power the Engine Room. Well. We have a tempting 11.1V just on the other side of the line in the engine room, but three motors made of pure inductonium ready to put nice big fat voltage spikes on the wire at the slightest provocation. I am serious about protecting the low-power controllers from the motors. So, attach a 9V battery to the VIN of the Arduino, by soldering it in to the engine board underneath the Arduino socket.
Monday, March 28, 2011
Design Flaws
I prototyped the bridge and engine room on breadboards, using a smaller motor to stand in for a main rotor motor. I wanted to be careful to set everything up so that when the PWM was high, the motor ran fast, and vice versa. This meant doing a polarity switch across the opto isolator, and another one across the MOSFET or bridge.
Everything worked great on the breadboard. I wasn't prepared to run the multiple amps necessary to spin the main motors through the breadboard, so I waited until I had the PCBs. The engine room PCB has some ultra-beefy traces (something like 100mil) to handle the current.
Safety first: detach the rotors! The bench I am working on doesn't have a lot of clearance, so swinging the rotors around there is not happening.
Now, solder the motor wires to the terminals on the engine room board, solder the battery terminal, plug in the battery, and....
The thing tries to jump off the bench and bite me! I still have scars where the main rotor shaft (with swash plates) clawed into my arm. The tail rotor smashes a glass of water, and I am still picking pieces of it out of my basement.
There's a teensy tiny design flaw: When the Arduino is off, and the motor half of the engine room board is powered, the motors spin at full throttle. This never showed up on the breadboard because I never turned on the motor battery alone. Can't wait for another re-spin of the engine room board, we'll just have to be careful when powering the system up.
Everything worked great on the breadboard. I wasn't prepared to run the multiple amps necessary to spin the main motors through the breadboard, so I waited until I had the PCBs. The engine room PCB has some ultra-beefy traces (something like 100mil) to handle the current.
Safety first: detach the rotors! The bench I am working on doesn't have a lot of clearance, so swinging the rotors around there is not happening.
Now, solder the motor wires to the terminals on the engine room board, solder the battery terminal, plug in the battery, and....
The thing tries to jump off the bench and bite me! I still have scars where the main rotor shaft (with swash plates) clawed into my arm. The tail rotor smashes a glass of water, and I am still picking pieces of it out of my basement.
There's a teensy tiny design flaw: When the Arduino is off, and the motor half of the engine room board is powered, the motors spin at full throttle. This never showed up on the breadboard because I never turned on the motor battery alone. Can't wait for another re-spin of the engine room board, we'll just have to be careful when powering the system up.
The Bridge and engine room
The Bridge is meant to be the control center, like the bridge on a ship. It carries the Logomatic, the inertial and magnetic sensors, a LiPo battery to power this all, and plugs for the GPS and BlueSmirf.
The bridge board is a custom PCB designed with Eagle and made through BatchPCB. It is exactly the same size as the Logomatic board, and is designed to sandwich the sensors between itself and the Logomatic.
Due to an unfortunate choice of pinouts on the Logomatic, only one PWM is available to control the motors. I need 4. Search, search, what do you call a part which takes I2C input and produces multiple PWM outputs... Oh yeah! Arduino!
So, there is a second board called the Engine Room. This board hosts an Arduino Nano, an opto-isolator, a quad half-bridge circuit for the tail rotor, and a pair of beefy MOSFETs and diodes for the main rotors. The engine room board is cleanly split into two parts: One for the low-power electronics, and one for the motor controls. Only an opto-isolator bridges the gap. No Electrons Allowed Past This Point, in either direction. The low-power part was designed to run on power supplied by the bridge, while the motor part runs on the 11.1V high-discharge motor battery which came with the helicopter originally.
The bridge board is a custom PCB designed with Eagle and made through BatchPCB. It is exactly the same size as the Logomatic board, and is designed to sandwich the sensors between itself and the Logomatic.
Due to an unfortunate choice of pinouts on the Logomatic, only one PWM is available to control the motors. I need 4. Search, search, what do you call a part which takes I2C input and produces multiple PWM outputs... Oh yeah! Arduino!
So, there is a second board called the Engine Room. This board hosts an Arduino Nano, an opto-isolator, a quad half-bridge circuit for the tail rotor, and a pair of beefy MOSFETs and diodes for the main rotors. The engine room board is cleanly split into two parts: One for the low-power electronics, and one for the motor controls. Only an opto-isolator bridges the gap. No Electrons Allowed Past This Point, in either direction. The low-power part was designed to run on power supplied by the bridge, while the motor part runs on the 11.1V high-discharge motor battery which came with the helicopter originally.
The Airframe
The Airframe: G-Tec 8005 - Just a cheap-o Brand-X Chinese RC helicopter. Two-speed, 3.5 channel, gyro, I don't know what the heck it is. Most importantly, it has two counter-rotating main rotors and a tail rotor mounted such to give vertical thrust, rather than horizontal as is typical on a real helicopter.
And, it's big. 42 inches, 18 inch rotor span, 950 grams when I first got it out of the box. I want it big so that it can carry 50+ grams of additional electronics.
I was originally planning on building my own airframe from scratch, following the design of Poison 1 in "Cultural Cat-Girl Nuku Nuku". This aircraft mostly looks like an airplane, or an Apache Helicopter with no main rotor. It has, in place of wings, two large fans, and at least one smaller fan at the tail.
The more I thought of it, the more I couldn't justify building my own airframe. I don't really have the tools to do it. And, I had the opportunity to purchase a G-Tec 8005 at just the right time.
I kept all of the structure, all of the rotors, the two main motors, the one tail motor. I removed the blinking lights and the original RC receiver and motor control.
The thing has a canopy, but I am painting it, and also it just gets in the way while I am working on the guts.
And, it's big. 42 inches, 18 inch rotor span, 950 grams when I first got it out of the box. I want it big so that it can carry 50+ grams of additional electronics.
I was originally planning on building my own airframe from scratch, following the design of Poison 1 in "Cultural Cat-Girl Nuku Nuku". This aircraft mostly looks like an airplane, or an Apache Helicopter with no main rotor. It has, in place of wings, two large fans, and at least one smaller fan at the tail.
The more I thought of it, the more I couldn't justify building my own airframe. I don't really have the tools to do it. And, I had the opportunity to purchase a G-Tec 8005 at just the right time.
I kept all of the structure, all of the rotors, the two main motors, the one tail motor. I removed the blinking lights and the original RC receiver and motor control.
The thing has a canopy, but I am painting it, and also it just gets in the way while I am working on the guts.
Test Flight 3
This test is to determine the throttle setting that causes the vehicle to lift off.
This time the throttle was brought up much more slowly, 100ms between steps. Also, the yellow light blinks every 10 steps, so this shows what the throttle level is.
The aircraft lifted off at about throttle setting 145 (of 255).
Test was a complete success!
This time the throttle was brought up much more slowly, 100ms between steps. Also, the yellow light blinks every 10 steps, so this shows what the throttle level is.
The aircraft lifted off at about throttle setting 145 (of 255).
Test was a complete success!
Test Flight 2
Test Flight 2 included two major changes.
Test flight 2 was a complete success!
- A 9V battery is hooked to the Arduino. The choices were either that, or bring a wire across the "Do Not Cross" line on the engine room board. Doing that would expose the Arduino, and the Logomatic, to potential voltage spikes, so that's a no-no. 9V it is. So, now there will be three batteries in the flight setup. One 11.1V rechargable for the main rotors, one 3.7V rechargable for the Bridge, and one 9V disposable for the Engine Room.
- The program was set to set all rotors to zero explicitly in setup(). I think that this is what really went wrong in Test Flight 1.
Test flight 2 was a complete success!
Basic Design Philosophy
I've had a Logomatic for going on two years, and my main plan for it is to finally complete my college senior project, the "Rollercoasterometer". This device has three axes of accelerometers and three of gyroscopes. My senior project was building a fiber optic strain-gage accelerometer, but since then, MEMS technology has revolutionized the world and the sensors I described above now fit in two chips, a couple of milligrams and microamps each. Now, the device I imagined will fit into my pocket instead of a backpack. So, I bought a Logomatic and a set of analog MEMS sensors from Sparkfun, and put together the Mk1 Rollercoasterometer.
I've taken this device on roller coasters all over the country, from Disneyland to Disney World. It has gone through several revs, from one that fits into a small fishing box to one that fits into a much smaller box. However, I have never accomplished the full mission of the device, to actually measure the track. I have in mind carrying this device on something like Space Mountain, and running the recorded data through an integrator to get position and velocity information. I just haven't done it yet.
With the device being small enough to get into a small box (about 2.5x1.5x1 inch), new all-digital sensors, an additional 3-axis magnetometer as a compass, and a GPS, which made it the Mk4 "Rocketometer". I then packed it into the nose cone of a model rocket and launched it. Now when I integrate it, I would get the track of the rocket, from which I could get interesting things like peak altitude, top speed, and peak acceleration. This still didn't motivate me to write the filter, although I did write a pure integrator of the gyro data, to produce a movie of the orientation of the rocket.
I know that a Kalman filter, in particular a nonlinear unscented Kalman filter is the right way to do it. I just haven't been motivated to do it yet. Are you beginning to see what I mean by terminal ADD?
So, to get a deadline, to get into the local electronics community, to give me a project, to impress people, and TO ACTUALLY FINISH SOMETHING, I decided to enter the Sparkfun AVC 2011. My plan is to get a cheap but large RC helicopter, strip out its electronics and connect my Logomatic to the motors. Now I will have a deadline to actually write that Kalman filter, since it will be the navigation routine in a Guidance, Navigation, and Control (GNC) system for the robot.
I've taken this device on roller coasters all over the country, from Disneyland to Disney World. It has gone through several revs, from one that fits into a small fishing box to one that fits into a much smaller box. However, I have never accomplished the full mission of the device, to actually measure the track. I have in mind carrying this device on something like Space Mountain, and running the recorded data through an integrator to get position and velocity information. I just haven't done it yet.
With the device being small enough to get into a small box (about 2.5x1.5x1 inch), new all-digital sensors, an additional 3-axis magnetometer as a compass, and a GPS, which made it the Mk4 "Rocketometer". I then packed it into the nose cone of a model rocket and launched it. Now when I integrate it, I would get the track of the rocket, from which I could get interesting things like peak altitude, top speed, and peak acceleration. This still didn't motivate me to write the filter, although I did write a pure integrator of the gyro data, to produce a movie of the orientation of the rocket.
I know that a Kalman filter, in particular a nonlinear unscented Kalman filter is the right way to do it. I just haven't been motivated to do it yet. Are you beginning to see what I mean by terminal ADD?
So, to get a deadline, to get into the local electronics community, to give me a project, to impress people, and TO ACTUALLY FINISH SOMETHING, I decided to enter the Sparkfun AVC 2011. My plan is to get a cheap but large RC helicopter, strip out its electronics and connect my Logomatic to the motors. Now I will have a deadline to actually write that Kalman filter, since it will be the navigation routine in a Guidance, Navigation, and Control (GNC) system for the robot.
Test Flight 1
Posted on the Sparkfun forum:
I am building a helicopter which is almost certain to win the low altitude competition, except if it is facing another helicopter. I basically just chopped all the electronics out of an existing helicopter, leaving the battery, motors, and airframe. I replaced the electronics with a Logomatic and Arduino-based motor controller, and just got the thing in the air todayUnfortunately, it is open-loop and still not controllable, but I still have time, right? Months and months, right?
First Post!
This is the build log for Project Arisa, my entry into the Sparkfun 2011 AVC. I keep all my own notes on various private blogs and wikis on my own system, but I grabbed a free blog here so that I don't clutter Sparkfun's forum.
I guess your question is, if I have been working on this for months, why do I have so many entries dated March 28? I just decided on this blog today, so I am doing a brain dump of what has already happened. I am currently almost finished with the hardware, and it is time to write the guidance, navigation, and control part. I will document this as it happens.
Also, I have just gotten the thing in the air, and I feel strongly that if you talk the talk, you have to walk the walk. So many projects are started, then abandoned. Only finished projects count. I wanted to make sure I actually had something to talk about before I started blabbing about it.
I'll tell you about the attitude of the knife some other day.
I guess your question is, if I have been working on this for months, why do I have so many entries dated March 28? I just decided on this blog today, so I am doing a brain dump of what has already happened. I am currently almost finished with the hardware, and it is time to write the guidance, navigation, and control part. I will document this as it happens.
Also, I have just gotten the thing in the air, and I feel strongly that if you talk the talk, you have to walk the walk. So many projects are started, then abandoned. Only finished projects count. I wanted to make sure I actually had something to talk about before I started blabbing about it.
I'll tell you about the attitude of the knife some other day.
Subscribe to:
Posts (Atom)