HobbyKing.com New Products Flash Sale
Jack Crossfire's blog
Archive for April, 2007
Posted by Jack Crossfire | Apr 30, 2007 @ 11:23 AM | 3,335 Views
Well, OK. Pain in our left arm started a few weeks ago and grew until it was pretty unbearable. It was periodic since 1995 but this time it was horrible. Finally figured out it's probably from dancing with R.H.II.

The prolonged left arm raising from dancing has aggravated a cyst from 1995. Apparently it never improved and we just avoided it by not using our left arm the last 11 years.

The treatment is a long, hard surgery campaign involving steroids which kill our emotional reserve. Suppose the need to finally have medical insurance should be enough motivation to stop thinking about Kalman filters and focus on Web 2.0 scripts.

Otherwise, we have to dance less with R.H.II, get Her to hold up our left arm, or avoid the closed position. The loss of that emotional support is a tough one to reconcile with the chance of a fracture.

Miraculously our scan of the cyst survived for 11 years, on a 1.44MB floppy, in none other than raw tar format. It was scanned long before anyone knew about digitizing X-rays but we thought digitizing X-rays was valuable. Still a complete waste of time like Kalman filters. Take a look.
Posted by Jack Crossfire | Apr 30, 2007 @ 01:07 AM | 3,323 Views
It looks like the 4Ah is in its final exponential death stage. We can assume $500/year is going to be the battery consumption rate, factoring in inflation. Seeing 20% annual electronics inflation in the short term. MaxAmp went up 10% since December but is still cheaper than Hyperion.
Code:
Battery            Total flight time         Total Recharges
-------            -----------------         -------------------
3.3Ah Hyperion     32 hours                  92
4Ah MaxAmp         38 hours                  108
Hyperion and MaxAmps seem to be going at the same rate.

Vicacopter got CPU profiling today and the result is she's using 5% CPU to do 17 inertial navigation system iterations/sec with no compiler optimization. A 200Mhz Gumstix seems to be enough.

The compass heading appears to be the biggest culprit behind zigzag artifacts. When pointing North, we get less zigzags. The heading isn't being used to correlate acceleration with position. Forward acceleration is always interpreted as acceleration North or an increase in Y, even when she's pointing South.

What probably needs to happen is rotation of the GPS position based on Vicacopter's heading, so her nose always appears to point North. Then Kalman filtering with the rotated GPS position and rotation back to absolute coordinates for the user.

Interestingly, Vicacopter records every remote control input received. She could theoretically store inertial navigation and flight control input for...Continue Reading
Posted by Jack Crossfire | Apr 29, 2007 @ 01:53 AM | 3,507 Views
Finally got position data that looks like reality. It took scaling the GPS latitude and longitude to meters and zeroing the GPS coordinates on the starting point. Scaled GPS output alone is very easy to read but highly quantized. GPS output after Kalman filtering is so noisy in the X and Y as to be equivalent to raw GPS output, but altitude is greatly improved.
Posted by Jack Crossfire | Apr 28, 2007 @ 07:49 PM | 3,500 Views
So got the first daylight pictures of Vicacopter under manual control and the longest flying campaign since fallinlovement. Really owe this campaign to R.H.II. Wouldn't have the energy to do it without Her.

Also the first shoot with the normal lens. Despite fearing lens terrorism, it was quite easy to keep Vicacopter in frame.

Unfortunately the situation with Max Amps and battery safing algorithms isn't good. After a pathetic 13 minutes, Vicacopter lost altitude too fast and crashed. Try a slightly lower min battery voltage.

What we have is a condition where every GPS update is causing a glitch in the Kalman output. Take out the GPS updates and the attitude stabilizes, but position output explodes. Seems to be a matter of ECEF units vs GPS units, but it shouldn't matter.

ECEF coordinates caused total filter suicide. LLH coordinates keep the filter stable.

After some success, it looks like surges were indeed erasing the bootloader and the Xena diode stopped the PIC erasures. So the LM7805 really was passing through surges. Saw this phenomenum when using a large capacitor for the output of an LM317. It oscillated at some high voltages before settling....Continue Reading
Posted by Jack Crossfire | Apr 26, 2007 @ 11:52 PM | 3,574 Views
With the battery safing now functional, you can see on the graphs where it kicks in, keeping the battery voltage over the minimum. The time difference between 61000 and 60000 is only 4 seconds, so she's pretty close to crashing, but hasn't crashed yet. We can raise the cutoff voltage, but a higher cutoff voltage is more prone to glitching out.

Also learned the radio loses contact when Vicacopter's antenna is pointing directly away or towards the transmitter. Bad news for steep pitch angles.

We have the autopilot enable switch debounced in the avionics to work around the physical noise. So far, it's taken a 1 second debounce to stop the glitching.

Stepped up the magnetometer rate so the 14 state Kalman is now running at 17Hz on the Gumstix. We've learned there is a 1 minute setup time in which the filter either stabilizes or explodes. Its volatility is controlled by the noise constants. Higher noise constants and it's less volatile but less accurate.

Once the 1 minute setup time is finished, the filter is stable for the entire test flights.
Posted by Jack Crossfire | Apr 26, 2007 @ 01:04 AM | 3,694 Views
Well when we went to review the autopilot.sourceforge.net module dealing with position, found instead of being an add-on module, it actually uses a complete reimplementation of the AHRS loop with position information.

They actually started over after doing AHRS and left the AHRS loop in there. The state matrix with position data has a nihilistic 196 members. No wonder US can't win any wars.

So after a marathon session, got the integrated position + attitude Kalman filter ported. Apparently GPS never worked in their source code release because it's commented out. The position estimate without GPS deviates catastrophically.

Don't really care if the attitude rewrite works, but right now it looks pretty awful. Position estimation and any extensive maneuvering doesn't work. It blows up constantly. Position estimation seems to be the new Leo Tolstoy tragedy.

In other news, for the first time Vicacopter's battery safing algorithm worked. With the 3.3Ah, after 16 min she started throttling down until she couldn't take off anymore. There was no spontaneous cutoff.
Posted by Jack Crossfire | Apr 24, 2007 @ 06:07 PM | 3,775 Views
Recall the mag's X axis showed significantly less gain than the Y & Z. It appears the X axis is the only one directly on top of the power bus. At 5V it must be feeling a lot of current.

Well, we have the magnetometer running about as well as it can. By studying the direction cosine matrix, got it correlating the right tilt angles with the right heading angles. All the matrix does is construct each of the XYZ axes with bits of the other axes, depending on the tilt. For example, X is now a blend of 50% X and 50% Z if she's tilted 45'.

Took a lot of fudging of the autopilot.sourceforge.net code to get useful results. She now gives good 0-360 heading results when level and sometimes for very shallow tilt angles, but even now when Z gets close to parallel with the flux lines, she starts going crazy. It's highly questionable whether she's using the $140 gyro output at all.

With the first intelligable Kalman output in 3 axes, a certain tilt is obviously required for stationary hovering. A second Kalman filter, the position filter, probably needs to be ported before any autonomous operations.

It's a vectorious day at least in the inertial navigation department. The battery department is still in purgatory.
Posted by Jack Crossfire | Apr 24, 2007 @ 10:56 AM | 3,506 Views
In other news, after the dashingly short flight time of 16 minutes, finally had some dead battery voltage telemetry. We have a 1/3 voltage divider feeding a 3.3V A/D converter for the battery safing algorithm. If minimum battery voltage is 5V, the theoretical minimum A/D reading should be 50% but she's crashing at 90%. Maybe battery voltage oscillates far above the analog sampling rate.

The second flight with the battery safing algorithm was 15 lousy minutes before another dead battery crash. Fortunately new electronics shielding seemed to work.

The autopilot switch is glitching off many times during flight recordings. The only way that could happen is if the switch is physically noisy. Finally, it appears the Gumstix already uses a compressed filesystem so it can record quite a long flight.

CNN wrote:
> Suicide bomber kills 9 U.S. troops

It costs Bin Laden around $200,000 for 1 suicide bomber. $100,000 goes to the family. $100,000 goes to training. Alternatively, a low cost UAV can do the same thing for $30,000. If money was the only factor, selling UAV's to Bin Laden would be a no brainer. You could become very wealthy and you might force US to surrender by Oct 1, the goal of most Americans.

The point is, wealth isn't the only reason we do things. You could make far more money selling UAV's to Bin Laden than any American yet you don't because there are other factors.

FoxNews wrote:
> Emergency war funding legislation requires troop withdrawal beginning Oct. 1

These guys should have surrendered on Oct 1, 1776.
Posted by Jack Crossfire | Apr 23, 2007 @ 09:14 PM | 4,779 Views
So because the magnetic field lines are almost vertical, Vicacopter's magnetometer is prone to gimbal lock. X & Y are only nonzero for the shallowest tilt. It is impossible to get a heading if she's tilted as we saw yesterday.

Physically tilting the magnetometer so X & Y are parallel to the flux lines works, but only when Vicacopter faces North.

So with her capacitor destroyed, it was time for another overhaul of Vicacopter's brain. Got rid of the A/D reference potentiometers. Added a battery voltage lead to the final A/D converter. Installed the Xena diode for surge protection. Strapped it all down with some new tape....Continue Reading
Posted by Jack Crossfire | Apr 22, 2007 @ 03:44 PM | 3,426 Views
So, looks like Vicacopter has a mag bias issue. The Earth's magnetic field isn't level but actually heads down into U. Know. Where., so the horizontal axes are more like vertical axes. The mag output needs to be rotated somehow to correspond with gravity. This is normally done by multiplying by a magic rotation matrix.

The magnetometer used by autopilot.sourceforge.net probably had the rotation matrix built in because they certainly don't have it.
Posted by Jack Crossfire | Apr 22, 2007 @ 12:40 AM | 3,693 Views
So a bug caused her to reinitialize the gyro bias values in every iteration. With that fixed, we have good orientation data in the hand held tests but only without the Kalman. With the Kalman it's now all noise.

1 - The Z accel result needs to include acceleration due to gravity.
2 - Acceleration due to gravity is negative.
3 - autopilot.sourceforge.net transposed roll & pitch in accel2euler.
Hopefully that was a bug in their accelerometer output.

The idea is to dump accel, gyro, and mag data separately, fudge the calibration constants until the euler angles for each data set look similar, then combine them in the Kalman.

Unfortunately the mag produces wildly varying data. One other thing. We have the AHRS loop running at all times now. That may have reduced flight time to 17min.

Why does NASA get the most fruitcakes and freaks? We think it's because the smartest people in government work for NASA. With increased brain power comes increased imagination, increased eccentricity, and increased defiance. With thousands of employees in the top 1%, they probably have more fruitloops than the normal government issue.

Also we have more Utah photos processed....Continue Reading
Posted by Jack Crossfire | Apr 20, 2007 @ 02:48 AM | 3,529 Views
Poor Jack is finally going through a phase that all humans go through. He dodged it for many years but it finally caught up with him. Fortunately, with the increasing age, the increasing delay between heroines, the narrowing definition of what we fall in love with, and the monumentally increasing pain of falling in love, R.H.II is probably going to be the last spark.
Posted by Jack Crossfire | Apr 19, 2007 @ 12:22 PM | 3,340 Views
So got the onboard Kalman up to 10hz. The mag is the limiting factor. The mag is so slow, it's now the trigger for Kalman processing instead of a timer. The Gumstix seems to have plenty of horsepower, but we have the Kalman in a separate thread anyway, to make sure a freak floating point stall doesn't lock up Vicacopter.

Very small floating point numbers have stalled x86 and PA RISC processors in the past. Using threads in avionics is a whole new world of risk, but for a very long, complicated math sequence, easier to debug than event loops.

Also have more of Vicacopter simulated on the PC by delivering sensor values in the order they would have arrived on the actual airframe and using fake timer values. The PC simulation seems to give the same results as the Gumstix.

Using a slow floating point division wrapper to avoid any chance that a NaN could kill the flight.

Kalman doesn't seem to use the gyro data at all, relying entirely on accel data. That's why it can't see yaw. Theoretically all the answers about which axis with which sign to plug in where are in a book from the 1970's.
Posted by Jack Crossfire | Apr 16, 2007 @ 01:22 AM | 4,203 Views
So the ideal PID equation contains a proportional feedback term, integral feedback term, and derivative feedback term. The derivative provides lead compensation. autopilot.sourceforge.net has only proportional feedback enabled.

Gave up on automatic calibration for the moment. Using hard coded constants, the Kalman now generates something. After reading through more literature, was satisfied again that the Kalman is required. Also discovered the output of our implementation is just attitude. Based on the output from Vicacopter, it's absolute attitude.

In chasing floating point bugs, it seems with the Gumstix you can't just download the SDK and compile programs in it while running them on the stock installation. You have to reflash the entire installation with the SDK filesystem image. Seems the C library and compiler point releases have to match for floating point to work.

Weekends continue to be difficult. No contact with R.H.II for over 48 hours. Dread the day She is no longer around a computer and no longer has any free time during weekdays.
Posted by Jack Crossfire | Apr 15, 2007 @ 01:53 AM | 3,606 Views
Put a good 4 hours into chasing the PIC flash erase problems. The Dean connector used to power on Vicacopter has more transients than normal. It arcs. It bounces. It sends a lot of current into the LS7805. This causes the PIC to enter unknown states.

Delaying MCLR a few seconds has no effect with a full bootloader. Without a bootloader, we have more stable flash. Clearly an issue with Vdd. Next will be a 5.1V Xena diode to protect Vdd.

Also wrestled with alternative names and decals for Vicacopter. Apparently the k in Russian names is a hated government decision so we don't use k. Still need to see our nectar of life floating in the air. None of the names have the power of Copters***a.

Finally, looks like the Kalman filter is dead. Going to go back to synthetic gyro with a full PID loop.
Posted by Jack Crossfire | Apr 14, 2007 @ 02:08 PM | 3,357 Views
So another dancing campaign with R.H.II. Realized if you want the required energy, you have to think about R.H.II, but was afraid to do so the first time because She might find out. This time, had enough courage and the energy came.

This time R.H.II put up with us more so Jack was slightly more on track. Was truly soaring. Through Her, had a vicarious absence of need, separation, or pain at the moment, but realization that on Saturday She wouldn't be there and it would be purgatory.

It's remarkable someone who appeared so beautiful and impossible the first time you saw Her could eventually become so important.
Posted by Jack Crossfire | Apr 13, 2007 @ 01:33 PM | 3,483 Views
Whew. So R.H.II found out about Copter----a and Copter----a is a bad word. Haven't seen so much anger since Hillary Clinton on July 4. Nothing to do but print new decals, dump the domain name, dump the sourceforge project, stare at the ceiling, try to put the pieces back together, and try some other names. That's a lot of files to edit.

Wonder if Cinelerra would have had the same result if Hardware Heroine found out.

They say the world didn't marry Jack Crossfire so it could marry Scott Peterson instead.

Managed to reproduce the PIC flash erase by repeatedly plugging and unplugging U.S.S. Victoria's battery. Definitely not a static issue. Some transient on startup is erasing it. Maybe the LS7805 can't handle the high current of a LIPO so it briefly spikes to 11V before settling at 5V.

The LS7805 is also used on the trapezoidian equatorial mount and it never has flash erases, but it's also used NiMH. The trapezoid is definitely going to use LIPO in the future.

So yet another software debug to record sensor data and now we have good accel + gyro + mag readings but awful GPS readings. Cleaned more flux from the gyro pins and all 3 bounced right into the middle range. Those IDG300's have really low output current.

Also, Vica had significant radio dropouts on this flight, according to the radio graph. Need an alternative to the GWS breakout connector.

GPS was a fiasco. It took 136 seconds for it to initialize and it only got 3 satellites. It may have been damaged in yesterday's crash.

Rerouted the autopilot enable switch away from the antenna and that stopped the anomolies there, for now.

Things don't look good for Mr. Kalman. The Kalman probably has a bug, it's really complicated, and there are lots of failure points. Results from the synthetic gyro experiment show you can get pretty good data from raw sensors. Just need functioning leed compensation and a way to maintain the center point.
Posted by Jack Crossfire | Apr 12, 2007 @ 12:53 AM | 3,071 Views
So today Coptershyna became Coptercrashyna for the first time. Engaged the flight recording loop when 20ft away and ascending. Immediately lost radio contact.

She just kept ascending no matter what we did to the throttle. Then realized the radio was dead. She headed over the trees. Then heard the throttle start falling. Failure mode engaged as programmed.

Fought desperately as $600 of avionics descended into the trees but clearly there was no point. She managed to get blown 5ft away from the trees and hit the deck sideways before throttle cutoff. Her main spur gear was chewed up and servo headers were bent but the expensive stuff was shielded by heroine decorated balsa.

Flew 2.5 hours on Coptershyna firmware without a problem. The flight recording ended after 3 seconds, exactly as it's supposed to in a radio failure at time 0. Nothing could have crashed because the flight recording wouldn't have been saved and the throttle would have been cut instantly.

Only continued problems with the GWS breakout connector can explain the failure.

Also, the current PIC is losing its bootloader after every campaign.

Coptershyna has a lot of gremlins, but at least we finally got useful accelerometer data. It was a successful failure.

There was a real good reason for not announcing coptershyna.com but we can't remember it, so here U go. Go get some source code for Coptershyna on coptershyna.com.
Posted by Jack Crossfire | Apr 11, 2007 @ 11:15 AM | 2,928 Views
One of the floating A/D converter pins was dead on Coptershyna's 2nd PIC. Her first PIC had no good A/D converters. The only explanation is that she's seeing extreme static discharge. Maybe airflow across the flight surfaces is building up energy and it's getting channeled through the avionics.

At least now we have data from the ADXL330.

Was forced by a certain event to tell R.H.II a lot more, a lot faster than intended. Think R.H.II handled the fallinlovement discovery pretty well. Americans just chop your head off.