Jack Crossfire's blog View Details
Posted by Jack Crossfire | Aug 12, 2012 @ 12:25 AM | 5,104 Views
The time finally came to integrate another flight computer on another airframe. The IMU is limited to 60Hz, because of the wifi interfering with i2c.

I2C on the IMU can handle 29khz. At 30khz, the wifi kills it. An oscilloscope would show what's happening & probably reveal a solution, but lacking the budget, the IMU speed has to be stuck.

I2C in burst mode is an alternative way, but it has never worked.


Also spent a few hours on the TCM8240. The JPEG output seems to have a valid header & start codes, but its compressed image data is all repeating patterns which the decompressor can't read.

Here the 0xffda code for the data segment is followed by a repeating pattern.

Code:
30    e5 e6 e7 e8 e9 ea f2 f3 f4 f5 f6 f7 f8 f9 fa ff     ................
40    da 00 0c 03 01 00 02 11 03 11 00 3f 00 af 45 00     ...........?..E.
50    14 50 01 45 00 14 50 01 45 00 14 50 01 45 00 14     .P.E..P.E..P.E..
60    50 01 45 00 14 50 01 45 00 14 50 01 45 00 14 50     P.E..P.E..P.E..P
70    01 45 00 14 50 01 45 00 14 50 01 45 00 14 50 01     .E..P.E..P.E..P.
80    45 00 14 50 01 45 00 14 50 01 45 00 14 50 01 45     E..P.E..P.E..P.E
90    00 14 50 01 45 00 14 50 01 45 00 14 50 01 45 00     ..P.E..P.E..P.E.
a0    14 50 01 45 00 14 50 01 45 00 14 50 01 45 00 14     .P.E..P.E..P.E..
b0    50 01 45 00 14 50 01 45 00 14 50 01 45 00 14 50     P.E..P.E..P.E..P
c0    01 45 00 14 50 01 45 00 14 50 01 45 00 14 50 01     .E..P.E..P.E..P.

Posted by Jack Crossfire | Aug 11, 2012 @ 04:47 AM | 4,684 Views
With the 168Mhz ARM, full IMU, & JPEG camera, the hackneyed power supply is maxed out. Now a real bench power supply with current limiting is looking real good. You need current limiting to handle accidental battery connections into the power supply. With 30V sonar, it's going to be sucking serious power.

A quick IMU to handle the newly discovered instability came together. It updates at only 50Hz. The theory was there is so much interference between wifi & i2c, the IMU would use a PIC to read all the i2c sensors locally, then encode the results on a UART for the long wires to the ARM.

Like the ARM, the PIC i2c bus maxed out at 24khz before wifi started interfering. That only gave 50Hz updates. It could double it with parallel i2c busses for the accelerometer & gyro, but those are no longer made in separate chips. It would be a 1 off board. Have a feeling, if there's time left over, parallel i2c busses are coming anyway.

The PIC needs 16Mhz to get 50Hz updates.

Time for another stab at downlinking the JPEG video & then some AHRS solutions.
Posted by Jack Crossfire | Aug 10, 2012 @ 12:17 AM | 3,832 Views
So decided to bring up the TCM8240 on the latest board. Decided to use the same board for Marcy 2 & the Blade CX II. It's a lot of work to lay out a new board for each aircraft. They would both use the magnetometer & possibly camera.

Got it spitting out JPEG images at theoretically 1280x960. There is hope it can compress 640x480 in addition to the full 1280x1024. The mane issues with the TCM8240 are:

The pins are ridiculously close together, since it was obviously a surplus item intended for another product. If anything bridges, you need to desolder it & try again.

Pulse reset after power up.

PLL must be enabled for JPEG to work. Set register 0x3 to 0xc1.

Enable the data output & JPEG compression by setting register 0x4 to 0x40.

Data automatically starts streaming from the pins.

The day was spent remembering to call DCMI_CaptureCmd(ENABLE); to begin capturing on the STM32F407.

Thought this camera streaming wirelessly would make a good demo during an interview. Helas, another interview never happened, as someone else with just the right buzzword came along.

Then came the Blade CX II. Passed up any newer quad or flybarless copter in favor of this, because it was believed to be the most passively stable, it had the smallest size for its payload, & coaxials used to dominate academic research before quads.

For all the hype about coaxials being super stable, fuggedaboudit. It was extremely unstable & hands on to stay in position. To be sure, the tail undoubtedly stabilized the yaw & balanced it more, but there's no way that level of sensitivity is always going to be satisfied.

Marcy 1 is extremely stable. She can lift off & hover with no cyclic input. That kind of stability is way beyond anything commercially available.

The good news about the blade is the radio & flight computer were separate boards, making radio replacement easy. The payload should be plenty to handle the new flight computer.
Posted by Jack Crossfire | Aug 08, 2012 @ 10:11 PM | 4,064 Views
Sonar came out at 6g when miniaturized. A tri-state op-amp would still be a lot better. The h-bridge is a buster to solder & a real nail biter during the 1st 30V power up.

The ferrite inductor is a weight buster. Getting 30V takes either lots of ferrite or lots of ceramic. Any 6x voltage increase requires storing a lot of charge. Connecting it to the CPU requires the actual aircraft, to route the cables.


After spending a good 8 hours fabricating without even getting to the camera, the massive complexity of the electronics & boredom required to do this simple thing became obvious. The complete electronics would come to 12 hours, not counting airframe assembly.
Posted by Jack Crossfire | Aug 08, 2012 @ 02:42 AM | 4,207 Views
The sonar board is a bit larger than the Maxbotics & probably too heavy for Marcy 2. It's going to take a lot of discrete analog components & voltage boosting to get the best sonar ever made.
Posted by Jack Crossfire | Aug 07, 2012 @ 01:13 AM | 4,368 Views
Wound the wick all the way up to the 30V op-amp maximum. Even though the circuit isn't going to use the op-amp for high voltage, the transistors explode at 40V, the boost converter explodes at 37V, & the capacitor explodes at 35V, so it's about as high as it can go, before components start getting big.

Distance over carpet got better, even with a single transducer, but it sure had a lot of boost converter ripple. The current consumption is only 2mA. The mane problem is now getting 30V 2mA from an aircraft size boost converter.
Posted by Jack Crossfire | Aug 06, 2012 @ 12:21 AM | 4,485 Views
So today's lesson was another way to boost voltage with a BJT. Sonar is going to need very high voltage. The MOSFET needs a 4V gate to turn completely on & generate the high voltage sonar needs, so a straight microcontroller pin won't do.

A full set of tests with the H bridge & a single pulse driving the transducer showed a reduction in the deadband. Also tried driving 1 pin only & got a negligable reduction in deadband with a significant reduction in power. In all cases, the H bridge was held for 1ms after the pulse. When it was held longer, the deadband & power were negligably reduced.

The bulletproof, ideal system is dual transducers with both pins driven by 1/2 pulse from an op-amp & no floating of the pins. It works over carpet.

To eliminate 3 grams, the single transducer with both pins driven by 1 pulse from an H bridge can be used, but has more deadband.

There was a lot of variability from slight changes in the transducer positions & through hole soldering perils.
Posted by Jack Crossfire | Aug 04, 2012 @ 11:40 PM | 4,413 Views
So the deadband is less with dual transducers or when the op-amp or microcontroller is used to drive a single transducer. It's slightly less still when both pins of the transducer are held at a constant voltage, but not if 1 pin is floating.

It's double when the h-bridge is used, at any voltage. The ringing duration is unaffected by voltage. Only the amplitude of the entire waveform was affected by voltage. The op-amp ringing & h-bridge ringing were compared at 5V, since the op-amp couldn't go higher.

The exact cause of ringing is unknown. The transducer has some resonance. Only an oscilloscope with 20V range would reveal what's happening.


Another rebuild of the op-amp with diodes revealed some more nuggets. This configuration still died at 20V. Then came some new ideas. Instead of an oscillating waveform, drove it by toggling the pins twice, separated by 100 microseconds. That still killed the pings at 20V. Toggled the pins once & that got it working at 20V.

Interestingly, in the single toggle mode, the pings peaked somewhere over 5V, died somewhere above that, & recovered by 20V. 20V still gave less amplitude than their peak. So the diodes are dying at a certain resonant frequency & voltage, but a diode free op-amp works at all voltages. Single toggling still doesn't allow it to switch off for audio sampling, so the voltages must 1st go 1 way, then get reversed, then get turned off.

In the 3 state mode, another test showed the power output decreased as the pulse length increased. So the diodes aren't knocking out the high frequencies but acting like a band reject filter.


The op-amp with diodes is important, because it has a shorter ringing time than the h-bridge & Marcy2 isn't going to fly with 2 transducers.
Posted by Jack Crossfire | Aug 04, 2012 @ 01:29 AM | 4,031 Views
This circuit is doing a pretty high level logic function with simple transistors. Looking at such a simple transistor alone, for many decades, it was hard to believe this single component could overthrow the human race.

When 7 were connected, they got incredibly more powerful. That's all it took for a voltage to be inverted & amplified, & inclusive ored. It's easy to see how trillions & trillions of transistors could easily take over the world.

Points learned: the transistors are polarized. The emitters on the PNP's go to the power supply. The emitters on the NPN's go to the ground. Since the transistors are activated by current, not voltage, the PNP bases need to connect directly to the NPN collectors, not pullup resistors.

Most importantly, the transducer needs to be right next to the receiver, not a long wire. This draconian requirement means the sonar needs a breakout board with 2 options with a lot of wires.

20V, GND, H bridge, H bridge, transducer disable, output

5V, GND, output, transducer, transducer

Suspect any long wires between the H bridge & transducer would kill it. No way to know without building & testing with all the RF sources, leading to no option besides 6 wires.

Sadly, the ringing time doubled with this design. It now has 1 meter minimum range. Though the reflected signal increased, the ringing time didn't depend on voltage. Something about the h-bridge or transducer mounting increased the ringing time. All...Continue Reading
Posted by Jack Crossfire | Aug 02, 2012 @ 06:13 PM | 3,934 Views
That was bulletproof. Even 2 meters over carpet, it got most of the reflections. Practical use over carpet would be much lower. The transmitter runs at 20V, but could go up to 30 before the op-amps explode. There's another option for making a single transducer work, but the show must go on. Parallax probably uses dual transducers because there wasn't a way to make a single one work as well. A real problem is sizing the inductor for a flyable boost converter.

Unfortunately, it didn't change the amount of magic required to detect short distances. There is still a lot of noise from the outgoing ping. Still not switching to the parallax, in order to get more omidirectional range.

A BJT H bridge was a massive improvement over the LM324 at DC. The voltage goes all the way to the rails. The outputs go as floating as can be, when disabled. Too bad it took so many hours to troubleshoot. Time to reinstall Windows & simulate more. The BJT magic is more expensive than a transducer but lighter.
Posted by Jack Crossfire | Aug 01, 2012 @ 11:01 PM | 5,104 Views


Lacking an oscilloscope to truly know what it's doing & being too lazy to reinstall Windows & run LTSpice, it appears the circuit is against the bandwidth limitation of the diodes.

The higher the voltage change, the longer it takes the diodes to switch completely on or off. At 5V, there's enough time to switch to 0V. At 10V, they only get part of the way to 0 before the voltage inverts. At 20V, they may only reach 15V before being switched off again.

Switching off all the op-amp power rails doesn't work. There's always current flowing from the output into the op-amp.

At 24khz, diodes aren't enough to switch the op-amp outputs off. The last way is to use an H bridge + op-amps. The H bridge can have high impedance output by getting all 0 inputs.
Posted by Jack Crossfire | Jul 31, 2012 @ 08:48 PM | 4,540 Views
Years ago, 10V seemed to improve the range of single direction sonar. In reflected mode now, it completely destroyed it. At 10V, the range started to decrease. By 20V, there's no detected reflection at all.

At 20V or 40V peak to peak, the sensor actually seemed to stop receiving. Maybe the diodes broke down. Maybe the sensor heated to a point where it can't receive. The ordinary Radio Shack diode breaks down at 25V. Maybe the diode magic degraded it.

Nothing has worked over carpet. It's hard to believe anyone is using reflected sonar over carpet, unless it's a ridiculously low altitude.

Reflected mode goes at 20Hz, by shortening the pings to the absolute least amount of time. The sensor rings for a fixed amount of time after the voltage is cut off, so the idea of driving it is just to get it started, like a hammer hitting a string. It may work with only a single pulse.

The Maxbotics probably gets shorter ranges by measuring how long the sensor rings, then for distances below 14", it measures the end of the ringing.

There's also the chance reflected & single direction can be combined to produce a more accurate distance. Lots of things to try, with the winner whoever picks the right things 1st.


In other news, the next laptop arrived ahead of schedule, a 2.3Ghz Intel I3 with 4 hyperthreaded & 2 physical cores. When it dies, the super slow EMachines with 1Ghz AMD dual core will finish the rest of its life. Having this upgrade definitely makes the last year with the EMachines look like a simpler, impoverished time.

As with the Intel I2 from 2008, it's much faster & smoother than the AMD at the same clockspeeds, but has only 1/4 the battery life of the AMD. It's much faster than the 1st 2.4Ghz laptop, a super expensive 2.4Ghz AMD single core from 2005.

Hyperthreading has improved drastically, over the years. In 2010, hyperthreading slowed down compilation. Now look at the difference:

4 cores: 48s
2 cores: 1m29s

The Intel requires a 4S battery where the AMD used a 3S battery.
Posted by Jack Crossfire | Jul 29, 2012 @ 09:29 PM | 4,694 Views
Reflected sonar data is required for any 3D sonar system, so it's time to design 1 sensor to transmit & receive. The Maxbotixes are too directional. The Parralaxes are too heavy.

The mane problem with using 1 sensor & probably a mane reason why Parralax uses 2 sensors is 1 of the transducer leads has to be switched to an input to receive, limiting the drive voltage to the microcontroller voltage.

Your best bet is a motor controller which directly passes the input to the H-bridge, so you can generate rapid toggling & high impedance mode on 1 pin while grounding the other pin. None of the existing motor controllers seem to do that.

Another idea is driving it with its full peak-peak voltage in 1 direction only. A boost converter is required either way & it's cheaper. Mechanically, the transducer probably can't produce as much SPL with a half wave.

There is some diode magic which can be applied to op-amps to make them tri-state.

Finally, there is the Leap Motion solution. That seems to use 2 IR cameras to detect distance & oscillating IR leds to separate an object near the sensor from the background. It would have a lot of restrictions on its use in a space larger than immediately above the sensor. The larger the space, the more likely the LEDs can't separate the foreground from the background.

Dual cameras are still an intriguing option for vision. It would still require an expensive gimbal.
Posted by Jack Crossfire | Jul 29, 2012 @ 03:45 AM | 4,871 Views
Because of the lack of jobs, the Marcy class aircraft have tended to shift more towards a product than an open source hobby.

15 years of doing 1 open source project or another have never yielded any career benefits from the open source aspect of it. They might care about the final product or the experience from developing it, but no-one ever offered a job because the source code was free & no-one who copied my source code to advance their job ever offered a pat on the back.

Part of the problem is it takes a lot more support than development for the open source aspect to gain enough popularity that it enhances your career. You have to be more of an organizer & the development has to be more in line with what the masses look for in other products right now, not a science project. Compromises like a 4Hz update when you'd like 30Hz or a clunky touch screen interface when you'd like a bulletproof tactile interface have to be accepted, because the platform has to be what the masses want right now.

In open source RC projects more than web servers, the developers tend to have jobs other than programming. They're competent enough at programming to make a career out of it, yet they're not offered jobs & they don't seem to seek any.

What seems to be happening is people who work on web servers are interested in software for its own sake. People who work on RC projects are using software as a tool to solve another problem that they're more interested in....Continue Reading
Posted by Jack Crossfire | Jul 28, 2012 @ 08:20 PM | 4,768 Views
A lot besides sonar was done in the last 3 years, but the matter of making something bulletproof for an ordinary consumer requires revisiting it. The PCB fabrication has improved, since those days.

Jumper resisters of varying sizes have replaced most vias. Where vias are unavoidable, magnet wire has replaced wrapping wire. Chip capacitors have replaced through hole capacitors. ARM has replaced PIC. Single layer boards have replaced dual layer boards. They're lighter & cheaper when home made. Upside down etching has replaced manually shaking the acid. Leaving bare board has replaced flood filling, to reduce weight. Isolating solder points with small traces has given better solder balls. Having all connection points on the edge of the board has replaced scattering them throughout the board. Soldering molex connectors directly to the board has replaced umbilical wires. 1200dpi has replaced 600dpi. Landscape mode has replaced portrait mode, because the printer warps the long direction.

3D sonar using all 4 transducers for reception is the latest experiment. Surely, all these experiments have been done & given up on, before.
Posted by Jack Crossfire | Jul 27, 2012 @ 02:00 AM | 5,492 Views
Manually flying Marcy 1 in a large room (5 min 18 sec)


Had a rare opportunity to fly her in a large room, at a cost of $100/hour. For the 1st time, could see how stable she really is. She's so stable, manual flight with a keyboard is possible. The hardest part was controlling altitude. The autopilot still does a better job, even compared to a human with proportional sticks. It's a wonder humans still fly airlines.

Marcy 1 flies herself in a large room (2 min 10 sec)
...Continue Reading
Posted by Jack Crossfire | Jul 26, 2012 @ 12:47 AM | 5,064 Views
Had a rare opportunity to fly Marcy 1 in a large room, at a cost of over $100/hour, revealing for the 1st time that she was extremely stable in every direction except altitude. Horizontal position holds really solid. Vertical position needs constant tweeking. Using a keyboard instead of a proportional stick made it very challenging to control altitude.

Also revealed was that the cyclic phase seemed to be different in the air than on the ground. It may have always been offset, but unnoticeable on the ground.

Horizontal position was super stable, yet translation was very effective. Pull the cyclic & she moved pretty fast. Center the cyclic & she stopped immediately, all without any electronic stabilization. The aerodynamics of Marcy class vehicles have certainly been hashed out.

Where the Picco Z rotor was the breakthrough in cheap cyclic damping which made toy copters popular, the next wave will be cheap altitude stabilization.

Sadly, autopilot in this room was a complete failure. It was certainly no fault of the aerodynamics. Something has gone wrong with the autopilot in the last 6 months.

The memory of being able to guarantee a stable takeoff, hover, & landing with every single autopilot run is still fresh. It was so reliable, I would walk around with a camera while the autopilot took off & hovered, unattended. It would be nice to work on getting back to that state, with the proven machine vision system, but financial reality dictates focusing on a better position sensing system.
Posted by Jack Crossfire | Jul 25, 2012 @ 02:15 AM | 5,285 Views


Without Marcy 1, there would be starvation. The Marcy Mogul is insane, but when you need to pay the rent & she's the only way, there's no more budget for argument.

With rare access to a larger room, these aircraft have done some pretty impressive flying with preprogrammed horizontal translation & ground based vision. There are lots of problems with ground based vision & control, but when it works, it works.

The control problems definitely put you off of ever selling it as a product, but there is hope that the problems are manely with position sensing rather than the airframe design.
Posted by Jack Crossfire | Jul 20, 2012 @ 02:45 AM | 5,215 Views
Quickly bringing the sonar airframe up to a minimal flying condition showed all those extra clockcycles & radios still didn't get sonar over the hill. It may have been marginally better, but already getting a Marcy aircraft to fly indoors showed it took absolutely glitch free, razor accurate altitude data. The problem with ground based sonar is not the range or the directionality, but it glitches.

Horizontal data seems good enough. There's definitely a future for it if it's combined with a straight down sonar for altitude. Straight down sonar would work, if an amplifier was put on the flight board. The processing would have to be done in software, since hardware to detect reflected sonar on 1 sensor has been patented out of existence. It may be patented in software, too.