What's new
Van's Air Force

Don't miss anything! Register now for full access to the definitive RV support community.

Thoughts on something I'm working on (Aviation friendly arduino board)

akschu

Well Known Member
Patron
So I have a need to have two servos (not an RV) reach run an elevator trim tab and thus it's pretty important that they don't get too far out of sync with each other, so I started working on a little arduino compatible board that uses standard DB25 and DB9 connectors and high quality components with integrated motor drivers so that I can drive each servo and poll the position. I also added a digital pot, so I can report the trim system position back to the EFIS.

This solution should be more reliable than a relay deck because the motor drivers are designed to handle inductive loads and not fry contacts, and because it's completely solid state.

I decided to go ahead and design the board for more generic use, and have the following:

2 motor drivers
2 channel digital pot
6 analog inputs or digital inputs/outputs
6 digital inputs/outputs

This offers the builder the ability, with a little code, to do cool things, like hook up a rotary encoder to two pins and have a manual trim wheel for digital trim. Or you can protect against run away trim by hitting any other button to override. Or you can drive an RC servo for heater controls with a pot on the panel. Or you can design a simple wig-wag lighting system and use the motor drivers to drive that. Or you can sample a sensor and indicate a fault LED. Or you can have a neutral trim button, which drives the trim servo(s) to neutral when pressed. Or you can slow down your servos with pulse width modulation when flaps are up, or when GPS is going fast (if you program it to read an external GPS NMEA sentence) or whatever.

The possibilities are endless, the code is really easy, and once mounted in a nice aluminum housing with good quality components and D-sub connectors, it becomes super easy to mount and wire.

Anyway, I'm going to build myself at least one and a spare and wanted to know if anyone else would be interested in a arduino compatible board that was ready to mount and wire.

39361046295_1725b2bc2e_b.jpg


39361045375_90fbecf628_b.jpg


Feedback is welcome, as I know there are some EE types floating around here.
 
Last edited:
That sounds pretty slick, I'll be subscribing to this thread to see what comes about! I've been rolling a similar idea around after watching a YouTube video about motor drivers and PLCs. But then I start to wonder if I'll ever actually finish an airplane if I keep concocting all these little side engineering projects :D
 
Hi Matt, nice going. It is nice to see several folks using Arduino stuff in the cockpit. For reference, here is my thread on Arduino:

http://www.vansairforce.com/community/showthread.php?t=151119&highlight=Arduino

Here are the documentation links:
http://www.vx-aviation.com/documents/Falcon-AVR/
http://www.vx-aviation.com/documents/Talon-AVR/

Go ahead and borrow anything you want from the design, or contact me via PM. I am using this device to run the autotrim and autoflaps in my Rocket.

There are other VAF threads on Arduino that provide useful information.

Have fun with this, Vern
 
Power supply suggestion

Love the idea, but one suggestion: that TI TLV1117 is only rated for up to 16v input. You might want to find a different switcher that can handle 28v continuous input and something in the 60v range for maximum input voltage.

The 60v max isn't absolutely necessary, but it protects you from most of the potential gotchas and it's the voltage the FAA uses as the "must survive" level for many tests.

Any chance you could toss an ESP32 on there for Wifi connectivity?
 
Search automotive power supply examples

Love the idea, but one suggestion: that TI TLV1117 is only rated for up to 16v input. You might want to find a different switcher that can handle 28v continuous input and something in the 60v range for maximum input voltage

Also consider a diode for the power in. Many regulators react badly to a hard negative voltage spike.

Can share some some of these from my own CANbus trim controllers by PM if you like
 
Easy to swap in a pin-compatible regulator with a better max supply rating. I'd suggest a series diode on the supply input to protect against reversed power; you have no idea how many people managed to smoke a couple of my products before I started doing that. Just a thought.
 
Hi Matt, nice going. It is nice to see several folks using Arduino stuff in the cockpit. For reference, here is my thread on Arduino:

http://www.vansairforce.com/community/showthread.php?t=151119&highlight=Arduino

Here are the documentation links:
http://www.vx-aviation.com/documents/Falcon-AVR/
http://www.vx-aviation.com/documents/Talon-AVR/

Go ahead and borrow anything you want from the design, or contact me via PM. I am using this device to run the autotrim and autoflaps in my Rocket.

There are other VAF threads on Arduino that provide useful information.

Have fun with this, Vern

Vern,
Thank you for the information. I didn't realize that you had already done this. Great minds think alike eh?

I would probably just use your solution, but it lacks a digital pot, so I don't think I can sample the servo position AND feed it to the EFIS at the same time, which is important to me since I'm going to sync the servos.

I looked at the makerplane website but didn't see a falcon available for sale. Are you producing those?

Thanks,
schu
 
Love the idea, but one suggestion: that TI TLV1117 is only rated for up to 16v input. You might want to find a different switcher that can handle 28v continuous input and something in the 60v range for maximum input voltage.

The 60v max isn't absolutely necessary, but it protects you from most of the potential gotchas and it's the voltage the FAA uses as the "must survive" level for many tests.

Any chance you could toss an ESP32 on there for Wifi connectivity?

Great catch, I'll swap out the regulator.

As for the ESP32, Its it's own microcontroller so I don't see why you would want a atmega and an ESP32 at the same time.

I looked at just swapping the atmega for the ESP32, but the packaging is a bit more challenging to solder, so if I do that, I would probably just make female socket so that you just plug in an ESP32 breakout board, like the sparkfun board.

Even then, the development environment around it isn't nearly as mature. So for your sudo-geek (not uber-geek) it would probably be pretty challenging to get going, while the atmega works perfectly with the arduino IDE.

What would you use the bluetooth or wifi for?

Thanks,
schu
 
Also consider a diode for the power in. Many regulators react badly to a hard negative voltage spike.

Can share some some of these from my own CANbus trim controllers by PM if you like

Good catch, I'll add one.

schu
 
Vern,
Thank you for the information. I didn't realize that you had already done this. Great minds think alike eh?

I would probably just use your solution, but it lacks a digital pot, so I don't think I can sample the servo position AND feed it to the EFIS at the same time, which is important to me since I'm going to sync the servos.

I looked at the makerplane website but didn't see a falcon available for sale. Are you producing those?

Thanks,
schu

All I have is a few blank pcbs.
V
 
Vern,

I think I'll just continue with my design. One nice advantage is that you can sample the servo position, and drive it to neutral with a press of a button, while still reporting the servo position to the EFIS *AND* a Ray Allen position indicator since I have a two channel digital pot.

Thanks,
schu
 
....
39361045375_90fbecf628_b.jpg

Feedback is welcome, as I know there are some EE types floating around here.

One minor layout issue. I am sure you designed for vertical Dsub connectors but some users might prefer to use 90 degree angle connectors on the PCB for system physical layout/clearance issues. The 90 degree connectors fit the same hole patterns but are designed to be right at the edge of the PCB. If they are mounted in a bit as shown above, there will not be enough room for a standard connector to be attached - it hits the PCB.

I found this when I tried to modify my FlyLEDs supply board. :eek:
 
Last edited:
Love the idea, but one suggestion: that TI TLV1117 is only rated for up to 16v input. You might want to find a different switcher that can handle 28v continuous input and something in the 60v range for maximum input voltage.

The 60v max isn't absolutely necessary, but it protects you from most of the potential gotchas and it's the voltage the FAA uses as the "must survive" level for many tests.

Any chance you could toss an ESP32 on there for Wifi connectivity?

<from Vern> When I did my Falcon-AVR board, I used the ESP8266 to provide WiFi connectivity. I've recently started using the ESP32, which has enough horsepower to replace the Teensy and ESP8266 module plus add more features.

Unfortunately, the documentation for the ESP32 makes this a substantial challenge....

V
 
Unfortunately, the documentation for the ESP32 makes this a substantial challenge....

Ain't that the truth. I'm hoping that between Espressif, Adafruit, and ESPxx community, somebody comes up with a really good Arduino port. That or a clone of the tools and libraries available for the Particle devices.
 
I am using the Arduino port now, after much manual futzing. I am part way through an electrical design for an ?aviation grade? pcb, but I have been overwhelmed by follow up from the CES.

V
 
I think adding ESP32 support would be set me back a bit and make it much harder for the average Joe to use.

Since I do break out the TX/RX pins on the top, I figure you could spit out what is going on, on the console, and read that on the ESP. Would that work?

az_gila: Actually I specked out a connector that is right angle. I still have to work through why kicad is drawing it funny.
 
I think adding ESP32 support would be set me back a bit and make it much harder for the average Joe to use.

Since I do break out the TX/RX pins on the top, I figure you could spit out what is going on, on the console, and read that on the ESP. Would that work?

az_gila: Actually I specked out a connector that is right angle. I still have to work through why kicad is drawing it funny.

A lesson learned from the development of my board is that it's really a limitation to have only one hardware serial port. In order to add WiFi and sniff a SkyView serial stream at the same time, I had to use the Teensy with it's additional hardware serial.

The Arduino environment for the ATMega328p supports software serial emulation, but it does not work at the required speeds in an interrupt-driven application. The extra speed of the Teensy was not required, but it sure doesn't hurt.

The ESP-32 is even faster than the Teensy 3.2, but is lacking in I/O and development tool maturity.
 
I've been thinking about something along the same lines, but maybe slightly different. My main goals are 1 to eliminate the relays and 2 to make a cleaner install of all of my stick functions. No schematic yet, it's just in my head at the moment. I did find those same TI motor drivers though. They look to be a good solution to eliminate the relays.

I was thinking to have the trim functions independent of the micro though. I like the idea of parts of the circuit being able to fail without losing it all. This concept may only work in my simplified control arrrangement, meaning no auto trim. Maybe that is being overly conservative. I'm still thinking through before I start putting down the schematic.
 
After thinking about this more, I think it's best to build upon what rugged-circuits has already done with it's Rugged Mega ET board since it's mature, and just build a shield that goes on top of it.

Right now I have 3 motor drivers, 2 digital pots, and a LOT of digital/analog pins via (2) DB25 connectors. This should be plenty to do most things.

schu

38564360450_7d50f7d822_h.jpg
 
Last edited:
Good idea. I know from experience that you want this stuff to be well protected from bad things (overvoltages, short circuits, ESD, lightning, high temperatures).

V
 
Trim Speed vs air speed ?

Vern did you find the need to adjust the trim speed with airspeed? I am in Phase I and my Ray Allen trim motor is fixed voltage. At first it seemed a bit fast at high cruise speeds.

Matt, is this a consideration for your design? (sorry if I missed it)
 
Bill,

My design has the motor drivers connected to hardware PWM pins, so software to slow the motor is just implementing PWM and easy to do.

Trouble is knowing when to do it. In my design you have a few options:

1. connect an air pressure sensor to slow the servo at high speeds.
2. Progressively speed up the motor the longer you hold the button.
3. Connect a GPS to one of the 3 hardware serial ports and read the speed from NMEA sentences.

My project is really to just provide motor drivers and digital pots to an already well designed industrial arduino. That way anyone can hack at it, and it will drive up to 3 servos, and can report position to two different EFIS and two different trim/flap indicators, while itself knowing where things are for synchronization or return to neutral.

schu
 
Vern did you find the need to adjust the trim speed with airspeed? I am in Phase I and my Ray Allen trim motor is fixed voltage. At first it seemed a bit fast at high cruise speeds.

Matt, is this a consideration for your design? (sorry if I missed it)

Yes, I use speed scheduling by sniffing the Airspeed from the SkyView serial stream. I show this method in Figure 1 here: http://www.vx-aviation.com/documents/Falcon-AVR/Falcon-AVR-V1B.pdf
Alternatively, Figure 2 shows how an external airspeed (or flaps) switch can be used for speed scheduling.

Of course, all of the magic is in the code, which is approaching 2000 lines. And just be a zealot, I am working on a version that uses pitch and roll trim for altitude and heading hold, without the need for an autopilot. It will be a while...
 
Last edited:
Back
Top