Archive

Archive for June, 2009

iFXEncoder – my last creation :)

June 16th, 2009 icounter 8 comments

I have an Esky LAMA v3 helicopter kit with a cheap remote with 4 channels.

So …. having too much time I decided to apply my other hobby’s knowledge (programming, electronics, microcontrollers) to RC hobby.

If you open the esky remote you can see that it is very nice designed. It has 2 parts : enconder(processing of joystick movements, and generating the PPM signal) and RF module(emitting the PPM signal).

First of all, I’m not an expert in electronics, microcontrollers etc., so if you see that I’m doing something wrong, please leave a comment :) (it’s just another hobby – DIY).

Sooo …. Because I’m not an expert :) , i decided to keep the RF module and replace the encoder. First I have started with “reverse engineering” of the RC, to figure out how do I have to “deliver” the signal to the RF module.

I used an ATMEGA8 microcontroller for the brain of the encoder, programmed with a modified version of  USBTinyISP and Avrdude. The firmware is written in AVR Studio. My version of USBTinyISP is made, also, with an Atmega8, that was programmed with YAAP (using LPT port).

The electronics for encoder is not to complicated, but there are a lot of wires(joysticks, buttons, lcd etc).

Main components : ATMEGA8, 8Mhz Crystal, 5V regulator, 2×16 LCD, buttons.

For joystick readings I used as reference the internal reference voltage of 2.54V. To get the voltage under 2.54 V, I used simple voltage dividers. I had a problem, that after I had connected the RF module, the interferences was too big, so I solved the problem connecting the ADC input pins to ground with some capacitors(taken from the old encoder, I think they are of value 100nF). And I also did improve the readings stability from software.(a simple average on last two values)

I used the 10bit resolution ADC, so the maximum resolution of joysticks should be 0-1023, but in reality the resolution is something like 72-1023, or 80-990, depends on the joysticks. Anyway these differences will not be seen by the user, because the software is doing calibration, and recalculates everything, so the output range will be always the same, regardless of the different input range.(I hope I explained this clear :) )

For generation of PPM signal I used Timer 1 output compare A interrupt service routine, and for input buttons I used Timer 0 overflow interrupt.

Old RC features:

- 4 channels with reverse

- that’s all :)

My new RC features:

- 7 channels ( software is written for 7 ch, but for the moment I need only 4, and I did not installed the buttons, pots for the rest of them; also can be easily upgraded to 10 ch)

- reverse for 5 channels

- EPA for 5 channels, with different values for start and end (also different for every channel, and also for throttle) : 0%, 5%, 10%, 15%, 25%

- Dual Rate for 4 channels(throttle does not have), with different values for every channel : 0%(OFF), 10%, 15%, 20%, 30%, 40%

- EXP for 5 channels(different values for every channel) : -80%,-60%,-40%,0(OFF),40%,60%,80%

- 4 Model memory (easily upgraded to 15 models, I can just modify a number, and it’s done, but i don’t need them; also for the moment you can not set a name for the model, but I’m thinking to implement this)

- landing mode switch (for now is just applying an extra value on elevator, to keep the nose up)

- 2×16 LCD screen with menu to set your model parameters.

UPDATE  21.06.2009 : I solved the problem with LCD, so now it’s working perfectly. The problem was with the LCD communication software, which was not done by me, and I was thinking it is too good to be something wrong there. The problem was that I used PORTD to communicate with LCD and also to transmit PPM. I used 4bit mode communication with LCD(PD4,5,6,7) and PD2 for PPM. So the LCD lib was rewriting all PORTD values, instead of only 4 bits, that were configured in the header file.

There are some restrictions also, I think because the sending of data to LCD is taking too much time, you can not set the parameters of the model with the model ON. I have to turn of the model during configuration of the model. Anyway, until I solve this problem, I have a block option for the menu, so during flight you can not use the menu on LCD.

The good part is that I can add and/or change everything on this RC, when I will need something new.

Until now I tested it on my Lama V3 helicopter and on Arttech Decathlon airplane, seems to work fine.

rc_finalrc_1

Here is my last version of code for ifxencoder

UPDATE 07.10.2009 : Robert Nanis started to build himself an RC using also the ATMEGA8 microcontroller, so, he sent me his electronic diagram.

ifx-rev1

Categories: Electronics Tags: