ArduPilotMega + Spektrum satellite Rx -- NOW AVAILABLE

Hi guys. Here's a little experiment we did yesterday using Doug Weibel's spektrum-to-PPM substitute firmware for the APM's ATmega328P, an upcoming (now available here!) Spektrum Adapter accessory board, and an ArduCopter. Sorry about the lack of video, but I can assure you our resident quad pilot Jeff Taylor flew this here at the shop with good results (considering none of this is fully baked)!

 

The Spektrum Adapter accessory powers the Spektrum module with an on-board 3.3V regulator, takes care of level translation on the single serial line, and has an input pin to enable/disable the regulator (this is used for putting the satellite in bind mode). The four pins are GND, 5V, data, and regulator enable.

 

I wrote a (very) crude sketch to put the satellite in different bind modes, you can grab it here: https://gist.github.com/ef01907a5c90dd66f987. I've tested it with DSM2, DSMX, and Orange Rx satellites. I've found that "DSM2 1024/22ms" mode is the one that works with Doug's firmware. The sketch is meant to be used on any Arduino Mega style board, it uses Tx1 to enable the regulator and consequently the satellite at the right moment to then receive the bind mode pulses sent out through Rx1. Once the sat is in bind mode, Rx1 is configured as an input again to receive the serial data after binding.


The ATmega328P needs to be re-programmed with Doug's firmware. You can either Arduino-ify the chip with the right bootloader and load the sketch through an FTDI cable connected to IN1 and IN2, or take the easy way and verify the sketch, grab the .hex file, and load it with an AVR ISP programmer.

 

Once the sat is bound, I soldered the adapter board on to an APM as seen in the photo, directly on the three IN1 pins. IN1 is the 328's Rx and is the only pin needed to receive the satellite's channel data. The small blue wire in the photo is connecting the 5V and reg enable pins to keep the regulator on at all times. The 328's Tx line could also be set high at all times to do the same thing, maybe the binding modes can be integrated into the 328 firmware as well?

 

After this, all should be the same as when using the full Rx module with servo extension cables. We found no problems with this setup during the Mission Planner configuration steps.

 

The Spektrum Adapter boards are now in stock in the store! Feedback for future revisions is welcome, and happy hacking!

Views: 16865

Comment by druckgott on September 24, 2011 at 2:17pm

Ok Now I get it working.

For the Binding in Step 1 you have to connect it like in the picture:

And Upload this Sketch to the Atemga 1280 Board:

https://gist.github.com/ef01907a5c90dd66f987

Here is the Hex file for the Atmega328p:

http://www.diydrones.com/forum/attachment/download?id=705844%3AUplo...

to change the Spektrum to PPM

 

I hope this will help some people.

Comment by druckgott on September 25, 2011 at 5:12am

One think which do not work for me is CH8 If I change CH7 CH8 also change. If I change CH8 nothing happens.

So CH8 is like CH8??
What´s wrong

Comment by Sam Kelly on September 25, 2011 at 10:59am

druckgott, I'm not exactly sure what happens to the last two channels, I see in Doug's sketch that it rearranges them to match the APM channel convention, but I don't know if that's related to what you're seeing.

I've fixed the link to the spektrum-to-PPM sketch, by the way.

Comment by druckgott on September 26, 2011 at 3:36am

Ah ok I have this seen also, is there a page where we can right Doug?? Do you know?

I will test it if we change this two parts also like the rest, but I do not think this is the problem.

Comment by druckgott on September 26, 2011 at 3:37am

Is it posible to debug this program with a Bootloader "Cable"??? Ís it per Serial posible in arduino??

Comment by druckgott on September 26, 2011 at 9:24am

Hallo, I have no output?? The Input works fine

Comment by Sam Kelly on September 26, 2011 at 9:39am

What do you mean by bootloader cable? To load Doug's sketch onto the ATmega328P you have two options but for both you need an AVR ISP programmer.

Option 1) Turn the 328P into an Arduino chip by loading the right bootloader and then using the APM's IN1 and IN2 pins as RX an TX to load the sketch with an FTDI cable.

Option 2) Verify the sketch in the Arduino IDE, find the location of the generated .hex file, and load it into the ATmega with the ISP programmer.

You have no output from the ATmega328? or from the APM?

Comment by druckgott on September 26, 2011 at 10:48pm

Yes I meen the AVR ISP Programmer.

I use Option2, I have created a hex file and load it ofter the ISP Pins for the 328p on the 328p Chip.

The Input from the satellit works perfekt, but I do not get any output.

Maybe there is somsing going wrong on creating the hex file, could you provide me a hexfile for the atmeag 328p Chip?

Comment by Sam Kelly on September 27, 2011 at 8:42am

How did you create the .hex file? Since the sketch requires no additional libraries, simply verifying the sketch in the Arduino IDE and selecting a board with an ATmega328 (like duemilanove) should give you a correct hex file. And what do you mean by no output? No output from the 328? or from the APM?

Comment by druckgott on September 27, 2011 at 9:57am

For no output I mean the Output 1-8 from the board for the motors and servos.

Ok now I also have an output, I have uploaded it new and it works. Don´t know why it works not at the first time. I selectet a atmega328 to create the hex file.

 

Do you know if it´s posible to make a serial output on doub´s sketch and read it ofter the AVR programmer, so what we could solve the problem with the chanel 8?

I have changed this lines

const uint16_t failsafe_values[8] = {1500,1500,1000,1500,1500,1500,1500,1500};
const uint16_t startup_values[8]  = {1500,1500,1000,1500,1500,1500,1500,1500};

but do not help anything

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service