Thursday, June 30, 2016

Sport Air/Engine Data Collector

So I've written a new "firmware" (yeah it's just an Arduino sketch) based on the old SportVFR sketch.  This is designed specifically to be a generic data collector/emitter.  The idea is that SportVFR board when paired with an ATMega32U4 Pro Micro dev board is a multi-purpose data collection tool.

Here's how it works.  There are 25 "Channels", 3..21 are numbered after the actual channel (see picture)


0,1,11-13,16,22-24 are not usable as such.  22-24 are "virtual" and represent the Tachometer, Altimeter and Compass virtual output channels.

It is entirely commanded externally via 9600 baud serial.

Commands:
* NAME- Name channel
^ Val - Set Max
v Val - Set Min
< Val - Set channel value (for output)

All channel configurations are saved into EEPROM and are restored on reboot.

Channel names are 4 character and the first denotes its purpose.


Channel 1st character enumeration:

> Digital Input
$ PWM Output
~ Analog Input
< Digital Input
^ Input w/Pull-Up resistor
| Virtual (for internal only, don't use)

Overall grammar:

{MsgId}{Command}{Channel},{Parameter}

Example:

1*1,~TST    Names channel 1 to "~TST" which an analog input field  
3^2,100       Calibrate max 100 is the mapped output value of current reading

For its part the device serially dumps the polled data in this format;

-HDR-<TST-DAT-32

Here's the CodeBender Source

Monday, June 27, 2016

Avare update and Pitch

Early on in the AP idea, I thought I'd need a standard pitch servo for the AP function.  I've discussed and I'd like to try using the pitch trim to drive the hand-flown trim as well as the vertical autopilot functioning.  A good R/C servo is strong enough to set the tab and fast enough to control the pitch axis.  So I'm going to start there.

Avare..  I've posted to the group and found they are very receptive to the changes I've proposed.  I'm going to make my changes to that project, either directly or through an Avare-aware Add-On.  Either way, it's a good Android app platform to start from.  It already supports much of the functionality I'm looking to leverage.

Wednesday, June 22, 2016

How's this all going to work together?

I've been throwing around a lot of boxes, boards and ideas... but I hadn't really technically nailed down how all these parts fit together and if they do actually fit together.  Good news... it does, and very simply and I can leverage existing software for 90% of the functionality.

The key to this are two Arduino Mini ATMega32U4 based controllers.  The first is one is obvious... SportVFR's, collecting engine and airspeed data.  That data is sent to Android device via serial communications on a dedicated USB.  This could potentially be Bluetooth, that is a future development.

As I started composing this architecture, I found I was missing two interfaces... First, the pilot's joystick input to the CarPC (programmable stick buttons).  Second, the interface to the Naze was not very robust.  Sure, I can connect via USB and run in a pseudo config/command mode.  But ideally, you want a dedicated processor feeding serial inputs to the Naze acting as though it is a R/C receiver.  This is perfect for translating the high-level AP commands form the Android to the Naze... I'll have a post on the AP commanding next.

Saturday, June 18, 2016

More AP specifics

Controller: Naze32

Firmware: CleanFlight iNav (specifically for UAV with improved navigation function built-in)

Interface: Multiwii Serial Protocol

So here's roughly how it will integrate... I'll flash and install the cleanflight iNav to the Naze32.  I'll use cleanflight iNav configuration software to setup the controller.  The Controller will not take any servo channel inputs, but it will drive the aileron trim servo and the pitch stepper servo via a RC PWM to 4-wire Stepper translation IC (probably arduino).

The Android 4.4 CarPC will have a dedicated permanent USB connection to the Naze32.   I'll run the configuration software on the CarPC.  I'll write my own Autopilot command app that will send Wii Serial  command (MSP_SET_RAW_RC) to the Naze32 via the USB.  These command will engage/disengage the AP modes on the Naze32, trim the aileron (when disengaged) and steer the AP for navigation mode.

Thursday, June 16, 2016

Let there be Autopilot!

Back in 2002-3 I experimented with a roll-axis autopilot that used a single axis solid state gyro on my RV-3.  Ultimately the project failed for several reasons.  But mostly the technology was not ready for my level of knowledge.  It is no-longer that way.  You easily access 10-dof Quad Copter controller boards which can be reconfigured for the larger mass and inertia of full-scale.



Roll/Pitch - Heavy-duty sealed waterproof metal gear digital R/C Servo.  Connected to an aileron/elevator trim tab.



Integration is where it gets messy.   So you have an Android Car PC, which has USB output.  You can directly connect the Quad Controller to the Android PC.  Normally this would be done to run the setup of the quad controller.  But it could be permanently connected and there should be a way to command the quad board between normal flight and autopilot mode from the USB via this configuration mode.  Normally this would happen via an Auxiliary transmitter channel.  Furthermore, there should be means to steer the autopilot for navigation on that same usb connection.  There are three AP modes; off, steer and hold.

Steer - Generally keep the vehicle flying upright, but use the various channel inputs to direct the vehicle

Hold - Ignore the inputs and keep the last Altitude and Heading.

I can see both of these modes being utilized by the high level Autopilot function in the EFIS.

The roll axis can be directly controlled by the quad controller.  When AP-mode is disengaged it will act as roll-trim getting input from the Arduino PC via USB connection.

The pitch axis will require a controller that can translate the servo output PWM signal to stepper motor.  I'd build a small board to do that.  Probably us a Arduino Mini or an ATTiny88.


At the end of the day.. What I want the pilot to have is completely naturally intuitive integrated autopilot.  So ahead of time, you plan your flight on a third party Android app.  We'll upload the plan to our app.

When you take off at 1000 AGL, an AP-FP button pops in the corner.  You press it,  it uses your airspeed to drive climb rate (constant airspeed) and steers you on flight plan.  Let's say you're not ready to go on flight plan heading yet.  You fight the roll to wings level.  A button pops... AP-HH.  Press it, your on heading hold... still climbing.  You fight the servo and push the nose over... button pops AP-AH, altitude hold.

So now you're flying along.  And there's Class-C airspace at your altitude.  Pop-up... AP Airspace [Through] [Over] [Under] [Left] [Right] (This would be icons as depicted below, not words).

AP: Airspace
       ^
    < 0 >
       v

Flying along.. ADS-B finds a traffic conflict

AP: Traffic
       ^
    <   [>]     [recomended]
       v

Keep flying and you get to the vertical intercept.  Where you need to descend.  Pop up, AP-DES.

Friday, May 27, 2016

Back to the... EFIS

3D-GPS-7-Android-4-4-Double-din-Car-PC-Tablet-Stereo-GPS-In-dash-Radio-3G-Wifi
This is the future!

What we need is a blue-tooth data collection device.  It would take the following:

- Airspeed
- Altimeter
- Tachometer
- Oil Pressure
- Oil Temperature
- Manifold Pressure
- Amp Meter
- Fuel Pressure
- Fuel Flow
- Fuel Level x3
- EGT x4
- CHT x4

That's 18 channels (16 analog, 2 digital).  Teensy 3.1 can support this.

Then need to find an open-source EFIS... If only such a thing exists...
can-efis | SourceForge.net


Friday, March 18, 2016

Do IT yourself

The source I posted to github directly supports 3 analog input channels.  Airspeed, oil pressure and oil temp, but say you want 1 cht and 4 EGTs?!   Ok, you can do it yourself, and here's how.

Connect the CHT to chanel 4, and 3 EGTS to 5..8.  Install a 1k-ohm resistor to those 5 channels.  Then setup those channels and create a second display page.  When you click the encoder, you'll flip to the second page.  That page will show CHT/EGTs.  You can even show a graph if you use special characters.

Ok... but that's not enough... I need manifold pressure two fuel and all six EGTs and six CHTS. Wowsers! So thats...
  • Airspeed
  • Oil Temp
  • Oil Pres
  • Manifold Pressure
  • 2x Fuel Level
  • 6x EGT
  • 6x CHT
It's time to piggyback.  First, make two SportVFR PCB boards, install pass-through header pins and snip all but the I2C pins, power and ground.  Then piggyback the second GPIO board to the first.  Code an I2C slave/master.  The original (first) board will handle the basic I/O and display.  The second board handles the expanded inputs and send them to the primary board as corrected inputs ready for display.

With two boards, you can support up to 16 analog inputs.  

This is a DIY project... You can do  it too, go do it!

Going Pro: Circuit Board

I spent a couple days and built a robust board that can accommodate up to 8 analog or digital channel inputs and 5 dedicated digital inputs.
The primary interface is DB25 PCB mount.  This is the preferred terminator for aircraft use at it is vibration resistant, reasonably priced, highly available and most importantly mechanically-secured multi-terminal connection.

The DB25 connector has 6 ground pins, 3-12v supply, 3-5v internal (500ma max) and all the pinouts for all digital and analog channels.

Supports up to four I2C ports, one is intended for the inertial module and one for the 1602 display. 2 additional I2C ports are available for future expansion.


Tuesday, March 15, 2016

Quick Wiring Update

This is the rough sketch of the wiring. The sensors either directly read the line (Tachometer & Airspeed) or use a voltage splitter to turn a variable resistance into voltage.  I'll provide the resistances in a later post after I've tested them.

The top terminal is ground & tachometer input
The bottom terminal is system voltage (9-16vdc), airspeed sensor, oil temp and oil pressure respectively.

On the I2C, Yellow is SCL (pin 3 on Pro Micro) and Orange is SDA (pin 2 on Pro Micro)

Sunday, March 13, 2016

Putting SportVFR all together

I found a renewed interest in this SportVFR in the purchase of a Pietenpol AirCamper.

Yup... that's me the Yeller-Barron 
The plane came with a full set of your traditional steam gauges they work well enough and I see no reason to replace them (yet).  But, I want to instruct some in the plane.  The front seat has a full set of controls except brakes and any instrumentation.
Period appropriate gauges in the back... Airworthiness/Registration in the front.  No instruments, front seat flying is tricky
 Yup... you get where this is going.  I need a cheap non-certified yet perfectly functional front seat instrument set.  Enter SportVFR.

I spent this weekend wrapping up the project and I think I'm getting very close.  First, I swapped out the MCU.  The prior post suggested a Spark Electron.  I have plans to try that later, but I didn't want my v1.0 to have issues with the EMF the cell transmitter would produce.  I'll have enough problems getting working what I have.

I chose the SparkFun Pro Micro, which is probably the best micro-sized Arduino compatible proto board out there.  It has built in USB Support via the ATMEGA32U4 programming is plug and pray easy.  To be compact, it purposely doesn't pin-out all the GPIO; the 17 provided are more than enough for this modest project. Best of all, they can be had for $5 in small quantity.

So I'm pulling the project together around the Pro-Micro.  Here's the final BOM (drop the test into ebay to find any parts, they all come cheapest or at all from China)

Pro Micr ATMega32U4 5V 16mhz$4.99
HMC5983 BMP180 Magnetometer / Pressure Module$3.50
MPXV7008DP Airspeed sensor$14.98
1602 16x2 Character Display LCD I2C$3.22
12mm Shaft Rotary Encoder with knob$3.51
Oil Pressure Sensor 80PSI$13.98
Oil Temperature Sensor 1/8 NPT $9.79
HAL Effect sensor NPN $3.49
Project enclosure with proto board$5.23
Total$62.69

At just over $60 with all sensors, this is perhaps an order of magnitude less than anything else out there.

So I assembled it all. I will make a post soon with the full schematic including all the voltage divider resistance values and layout. There was a trick on the Oil Pressure as it has a very low resistance at static pressure. 

Ok, so what does it look like?  It's in an enclosure, it has screw terminals for power and external sensors. I haven't drilled any wholes in the enclosure yet, but I'm just about ready to do that.








Pinout:

I2C - HMC5983, BMP180, 1602 Display (SDA /SCL / VCC / GND
Oil Pressure - Uses multiple resistors to A0
MPXV7002DP Airspeed - A1 direct
Oil Temperature - Uses a Voltage Divider to A2
System Voltage - Voltage divider to A3
Encoder - TBD, I haven't installed it just yet

That's really it! Hard to believe.  The rest is just programming... see the git repository.  The version posted is still in draft form, I will finalize all this soon and post the corrected updates.

Saturday, March 12, 2016

Going mobile

I recently received a kick starter project I funded called Spark Electron


I've been scratching my head trying to figure out a useful project for this marvel.  It's uses the digital cell phone system to transmit data to a server where you can easily generate web interactive solutions.

I think I found a useful purpose... SportVFR.  It can transmit telemetry data over the digital cell network.

I see some great uses for this board:


  • GPS breadcrumbs digital ELT (emergency locator transmitter)
  • Trending data for the engine
  • Automatic logbook

By periodically transmitting my GPS location to the server. These can be picked up and in case of off field landing, my emergency contact will be able to direct services to my exact location immediately.

One of the nice things about this board is that it comes with a LiPo battery, and it can be powered by the battery or vehicle power.

The big drawback is cost at $60 and $3/mo for the digital cell service.  While not cheap, what's the price of safety?  And really, I already have the board and need a project for it.