Jack Crossfire's blog View Details
Archive for May, 2007
Posted by Jack Crossfire | May 31, 2007 @ 12:14 AM | 8,090 Views
So all roads are pointing to fixing the LM317 to the fuselage for a heat sink. Naturally, if anything 11.7V touches the fuselage, we're done.

In the 6 months since Vicacopter's first LED fitting, they came out with new ones 33% brighter and twice the price. The new ones are 15,000 mcd, 3.3V. $30 later, Vicacopter was extremely bright.

For 3x the price, they now have jumbo size LED's. Same light output but over a larger area for you LED status indicator freaks.

Finally, 4 those of you familiar with heroines, R.H.II turned around again, so that's why we had enough emotional reserve to put this nugget of LED force together. Hopefully She won't malfunction more frequently than She already does....Continue Reading
Posted by Jack Crossfire | May 30, 2007 @ 02:59 PM | 7,306 Views
So the last time we saw R.H.II was dropping her off at the Rockridge BARF station to buy clothing. 2 days later, after not hearing from Her, personally feeling endlessly exhausted, and destroying Vicacopter on the bush, we got this

Russian Heroine II wrote:
> As you keep silence as me I have made a conclusion you are as
> dissatisfied as me.
>
> Could you please send me some good pictures from hiking, as goodbyes.

Based on the logic, we can only assume she found someone better. Probably a professional dancer, a passenger on the bus, one of the Russians who correct her writing, someone she met at night school.

Separation was never easy. Initially it feels easy because you still think they're going to turn up in the future. Then reality and the intense pain sinks in. It can be devastating to productivity and careers. You end up exhausted all the time yet continue to think you're functioning at your full potential, never knowing what's really happening.

R.H.II was such a buster to fall in love with, we prayed to never have to fall in love again. Based on the increasing times between fallinlovements, she's probably the last.

Also prayed R.H.II would continue to provide all our emotional support needs for the rest of our days, but there's only so much God can do.
Posted by Jack Crossfire | May 30, 2007 @ 01:35 AM | 7,313 Views
So during a test flight in a confined space, got suddenly blown into a bush. Snapped a blade and the LED's instantly winked out. That we wouldn't fly again until June was obvious.

Why the LED's winked out was harder. The ADJUST pin on the LM317 snapped off, probably from a combination of vibration and the crash. Without the ADJUST pin, it sent out 10V, instantly zapping all the LED's. At least the heat shrink tubing was still good.

New main blades: $30.00
New LED assembly: $20.00

Things that were tried with the tail gyro eliminator:

Tried increasing the DT constant to the number of microseconds between compass updates and increased the gyro scale. This made the Kalman always overshoot and correct. This could be used as lead compensation.

Filter explosion traditionally happened with the large DT and gyro scale, but this time we defeated it by limiting the maximum gyro output.

Finally, added a minimum servo deflection to ensure every feedback caused at least some servo movement. Without the minimum, the servo wouldn't start moving until a lot of error built up.

She actually seemed to get closer to working without the GWS. Still quite a bit of oscillation and a tendancy to suddenly turn 360'. May be a problem with the turn algorithm where it builds up 180' of error and the shortest distance back is to keep turning in the same direction.

Had 1 more item on the TODO list. Test if 3*26W lights were enough to light a copter flight from the ground. Lacking a copter, that meant lighting a test subject and simulating the HD camera with The Canon.
Posted by Jack Crossfire | May 28, 2007 @ 06:49 PM | 7,331 Views
After the 2 untracked previews, it was time for Jack Crossfire to make another movie. Shooting Vesta really was a movie making campaign, with the most gear ever hauled out there.

So spent 1 hour on alignment and managed 90 minutes of data collection. Another 30 minutes were spent rewinding and realigning the trapezoid. A final 30 minutes were spent breaking down the gear, for a total of 3.5 hours in the field to make this movie.

The trapezoid worked perfectly. Had severe wind, full moon, and lots of water vapor haze. The magorator burned out, so we had to use the lead acid battery + 26W of fluorescent lighting. It was much brighter than the magorator and may be a better solution.

Vesta: the movie (0 min 26 sec)

Posted by Jack Crossfire | May 26, 2007 @ 04:55 AM | 7,930 Views
Vesta moved quite a bit in the last 24 hours. The question is, would 2 hours of photographs show enough movement? Today had high clouds and low clouds blurring the image. Low clouds will persist until mid-June when we shift back to high clouds.
Posted by Jack Crossfire | May 25, 2007 @ 03:31 AM | 7,690 Views
The LiPo's have gotten unbalanced enough that the Astro Blinky isn't doing the job anymore. Anything faster than a 10 hour charge causes them to exceed 4.2V while the Blinker blinks away. There is value in a custom charger. The problem is how to test it.

Requirements:
- 1-6 cell support with automatic detection of the number of cells.
- Momentary pushbutton to start and stop charging.
- Charges through the balancing receptacle.
- Disabled if reverse polarity detected.
- Independant voltage readings for each cell.
- Provides minimum current until all cells are over 3.7.
- Provides user selected current if all cells are over 3.7.
- If cells are unbalanced, only the weakest cell is charged until all
cells are within limits.
- If cells are balanced, all cells are charged until all cells are 4.2.
- Once charging finishes, cells that drop below 4.2 are topped off using minimum current.
- LED's for each cell show status: flashing if charging, solid if done.
- Total cost < $50

Implementation notes:
- 1 * LM317 current regulator for each cell
- H bridges to allow individual cells to be charged
- PWM to switch current
- Apply current for 29s to charge batteries, stop charging for 1s to measure battery voltage
- Ground lowest cell when not charging.



Meanwhile, stepped up the IMU rate again and enabled compiler optimization. Using 33% CPU, she now does 5 IMU updates for every compass update. The IMU sample rate is 172Hz and the Kalman rate is still 31Hz because this is locked to the compass rate and the servos only respond at 20Hz.

Well, we've tried many different techniques but nothing seems to be holding attitude enough. A derivative 4x bigger than the proportional term actually kept her within 10ft of the target position, but she was pitching 45' each way.

It's a good time to focus on astrophotography now.
Posted by Jack Crossfire | May 24, 2007 @ 03:03 AM | 7,342 Views
So after feedback based on tilt rate fell over disasterously, went back to instantaneous tilt feedback. The latest trick was to use really big derivative feedback and really small proportional feedback to try to compensate for the slow Kalman filter. That didn't work initially.

Next, decided to focus on pitch and keep roll under manual control. This was long avoided for fear of Jack Crossfire being unable to focus on roll without trimming pitch. Fortunately, such fears were needless.

Pitch+throttle+yaw automation with the big derivative was a huge improvement. Altitude & pitch were stable enough to assuage any temptation to control pitch. She didn't have much pitch authority. A click of the trim tab still overwhelmed the pitch feedback.

To prove the automation was doing something, tried manual roll with no pitch control of any kind. That caused extreme pitch oscillations, showing the pitch automation was probably doing something. Unfortunately, yaw & altitude were also not under any control, so it wasn't a perfect test.

Previously we used the same constants for roll & pitch feedback. Roll may now need far smaller constants or it may have bad data.
Posted by Jack Crossfire | May 22, 2007 @ 04:12 PM | 7,374 Views
After trying to jump to position hold and getting disasterous results, decided nothing can really happen until attitude hold is more stable. The strategy now is to attack tilt rate instead of absolute tilt. We have the first movie of automated cyclic response to tilt rate. At least for nose up and right bank, it seems more like what a human pilot would do. Nose down and left bank don't seem to work as well.

Cyclic response (1 min 21 sec)


Lost the PIC bootloader again, even after updating the solder joints. Fortunately, the PIC hardware has been flawless for weeks.
Posted by Jack Crossfire | May 21, 2007 @ 02:26 AM | 7,742 Views
So with the IMU now bolted to the fuselage, vibration is definitely worse than the skid mounted IMU but miraculously the Kalman seems more stable and more accurate with it.

The common technique in testing attitude hold is to fix the heading to 0 so you don't have to worry about body frame conversions. What always happens with that is a pitch up, gimbal lock, and autopilot terrorism.

With the strap-on IMU, we had record attitude + altitude + velocity holds up to 88 seconds. Yet another incremental improvement but still showing unstable tilt oscillation and high velocities. The flight data shows the strap-on IMU with high sample rates to be just as slow at producing equivalent accuracy as the skid mounted IMU with low sample rates.

Instead of averaging more samples on the PIC, we're using a smaller DT/integration step in the Kalman filter with the higher sample rate. That and the fuselage mounting seems to be the magic touch.

So with the weather and the lack of open space, 1 test flight per day is the most that we can pull off even without a day job. With the amount of data generated by these flights and the preparation for each flight, 1 flight per day is probably the best in any circumstance....Continue Reading
Posted by Jack Crossfire | May 20, 2007 @ 04:11 AM | 7,248 Views
Today we learned the Kalman filter expects really small accerometer values on the order of 0.1. Still more tweeks to the accel & gyro scale factors got the filter a bit more stable. The trick is to rerun the filter on a flight recording with explosions until it stops exploding.

Looks like the gyro values need to agree reasonably closely with changes in tilt detected by the accels and that means every change to the accel constants changes the gyro constants.

Managed to step up the MEMS rate to 1.5x that of the magnetometer. That seemed to be the limit for stability. Though stable, the filter showed too much noise. The Corona skids act like springs, amplifying vibrations for the MEMS. Mounting the MEMS on a more stable part like the tail boom is the only solution.

With the updated filter rate, Jack Crossfire let her fly autonomously for a record 47s before oscillations got severe enough, and that was the end of skid mounted MEMS.
Posted by Jack Crossfire | May 19, 2007 @ 03:54 AM | 7,300 Views
Autonomous hover is ever so slowly improving in the lightest winds possible. Velocity error is converting to tilt offsets. She's clearly adjusting tilt based on velocity but not nearly fast enough. Still no position error converting to target velocity, so she slides quite a distance down the field.

A bigger problem was altitude hold not doing so well, causing her to descend towards the trees in every autopilot test.

Also, the INS loop now resets when it detects a NaN from a filter explosion, with respective flashing of the status LED.
Posted by Jack Crossfire | May 18, 2007 @ 03:31 AM | 7,147 Views
Cyclic automation is moving forward ever so slightly. With perfect trimming and a very carefully placed manual start point, she can briefly hold attitude in 5mph wind. The mane problem is in a fixed attitude, she always translates in 1 direction.

We know attitude hold is working because the translation direction can be changed by changing the starting point. The translation causes tilt to increase beyond limits. She needs 2 dynamically change the attitude target to keep translation under a limit.

There lies the problem. the delay in INS output is so long, she doesn't know the current velocity until it's too late. Unfortunately the weather, magnetometer failures, and continued Kalman instability are keeping progress at a standstill. Rain Ramon is lucky to get 1 hour of calm winds at 11pm. This most severe wind lasts from March-June and again from August-December.
Posted by Jack Crossfire | May 17, 2007 @ 02:13 AM | 7,415 Views
So with the higher MEMS sampling rate, got filter explosions every time after performing some aggressive flying. Combined with the garbage output when it wasn't exploding, it wasn't worth it. Went back to the 4:5 ratio between MEMS samples and magnetometer samples.

Also found by changing the MEMS scale factors, the jaggies in the Kalman output could be reduced.

With everyone reverted to 5/13, time to disable all cyclic input and see what Vicacopter sees in a cyclic automation test. As expected, she became a mad copter. Disable all control input and she actually does better.

Her autonomous throttle causes yaw feedback. Yaw feedback causes horizontal acceleration from the tail rotor. Horizontal acceleration causes tilt oscillation.

NASA wrote:
> We are looking for observations of the asteroid Vesta (and Ceres).
> However, because they will appear starlike in most single frame images,
> we hope to get images that are somehow combined/ stacked either showing
> the streak of motion or an animation.

Unfortunately Calif* has been under a constant layer of high clouds since 2005. On the clearest night, there is always a faint layer of water vapor of some kind. It's like an early form of Venus.

Also, the Dawn mission is happening during a full moon.
Posted by Jack Crossfire | May 15, 2007 @ 02:34 AM | 7,277 Views
The PIC failed because hours of vibration caused 2 weak solder joints to finally break. The programming header had so many weak solder joints, spent all night repairing them all and fixing other damage.

Proceeding in the belief that higher inertial sampling rates would improve cyclic responses, according to Vicacopter's diagnostic tools, she was getting more magnetometer samples than inertial samples.

Stepped up the analog sampling and the baud rate on the PIC. Now she's doing 3x more inertial samples than mag samples. The CPU is now up to 30% and the Kalman filter down to 31Hz. The compiler is up to -O now. Any optimization beyond -O causes division by zero. Dumping console output slows her down dramatically.

The Kalman now settles by 30 sec. The higher the inertial sampling rate, the greater the influence of the gyros. Scaling up the gyros also increases their influence. Too much gyro influence and the Euler angles overshoot.

Tried stepping up the servo update rate, which in turn slowed down the magnetometer update rate and the radio reception rate to horrific levels. The PIC doesn't have enough horsepower to go any faster.

Unfortunately our goal of averaging variable numbers of samples to keep the CPU at 100% seems impossible. The Kalman filter can't handle the glitches from dynamic averaging.

This higher sampling rate puts out nothing but garbage of course. Finally ordered another $104 of replacement parts to build back the last 5 months of damage.
Posted by Jack Crossfire | May 14, 2007 @ 03:01 AM | 7,645 Views
Did another energy calculation based on charge time. Vicacopter comes in at around 14A, hauling all the avionics and running the Kalman filter. It's equivalent to hauling the HD camera by itself.

Altitude hold department:

Doubled the I component and increased the PD components by 50% to handle normal wind better. There is definitely a correlation between satellite count and stability. Early tests are the least stable because she has only 4 satellites. The last test is the most stable because she has 8 satellites.

In 20mph gusts, a normal day for Rain Ramon but very hard for a copter, she managed to stay in the air. Heading hold is a big problem in these conditions. She swings 90` from gimbal lock with the compass.

The derivative definitely has a huge impact. You can hear her giving throttle pressure followed by checking, just like a human pilot.

Cyclic hold department:

Did some tests to unsuccessfully hold a specific tilt. She could probably do it in a 300 sq mile unobstructed field, but this is U. Know. Where. the most crowded country in the universe.

Flipped the sign for pitch so it would match forward velocity. Now a + pitch is nose down, which causes a + in forward velocity. That did absolutely nothing but make the graphs logical. Other than that, her tilt data has a 1-2 second delay. This causes her to speed horizontally out of control.

One other thing. Recalibrated the gyros to give readings extremely roughly approximated as radians/sec. That seemed to increase the gyro relevance in the final result from 0 to something. Maybe the accels need to be scaled to match the GPS units, too.
Posted by Jack Crossfire | May 13, 2007 @ 03:34 AM | 7,007 Views
Well cyclic automation isn't going so well. As hard as throttle automation was, cyclic automation is even harder. After some control losses, cluelessness about why Vicacopter malfunctioned, went back to doing altitude holds.

She had serious GPS drift and headed way way up. Then the battery died and the battery failsafe kicked in higher than it ever did before. The algorithm was modified to reduce throttle at a much slower rate. Despite this, she fell too fast and performed the most gear stripping ever.

It looks like cyclic automation is going to be a matter of determining the values for a level tilt, targeting those values for tilt, and ever so slightly biasing the level tilt to maintain position.
Posted by Jack Crossfire | May 12, 2007 @ 06:30 PM | 7,069 Views
The answer is yes. You can generate 110V AC from a LiPo. It's a very expensive and short lived power supply. The point is, we're going to need copious amounts of light to shoot video of Vicacopter's first autonomous operations. It's too windy to shoot in daylight.

The LiPo generates 106V through the inverter. The lead acid only generates 100V. Seems to be a matter of instantaneous current response being better on the LiPo. Unfortunately, it's too expensive.
Posted by Jack Crossfire | May 11, 2007 @ 03:59 AM | 7,268 Views
Today we lit up the derivative term of the PID loop and Vicacopter had the best altitude hold ever. This time, there was no ground effect to save her. It was in dead calm winds, but still better than anything achieved in dead calm winds before. Even the mighty Jack Crossfire could never dream of holding such a stable altitude, as seen in the many overhead lighting shots.

Clearly, full PID loops with hand picked constants are the way we're going to do all positioning. The big question is does cyclic require

horizontal position -> target velocity
velocity error -> cyclic deflection

or

horizontal position -> target velocity
velocity error -> target tilt
tilt error -> cyclic deflection

or

horizontal position -> target tilt
tilt error -> cyclic deflection

The hand picked constants follow general rules:

P and D factors are around 0.02 and equal.
I factor is around 0.0001.
The derivative is based on the current sample - the sample 1/2 a second ago.
Output limit is around 0.1
Other limits aren't necessary, but we limit the integral to 0.1 just in case.

This all depends on the sample rate being 35Hz. The derivative is really the rate of change of the Kalman filter climb rate, a very noisy value but effective.

Sonar altimeter may be used as a boundary sensor in case GPS drifts high and Vicacopter comes down to head level. The trick with any sonar altimeter is switching it on only when Vicacopter is in the air. It needs ground clearance to calibrate itself.

Well the PIC stopped accepting any new programs at all. Maybe the code protect bits got flipped on by a static discharge. Maybe its in circuit serial programming BIOS got destroyed. Time to order another salvo of PIC replacements.