Home > Electronics > iFXEncoder – my last creation :)

iFXEncoder – my last creation :)

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:
  1. July 28th, 2009 at 17:47 | #1

    hello,interesting project. Can u share your project details (schematic,code,etc…)??

  2. icounter
    July 29th, 2009 at 07:10 | #2

    I added my last version of code to the end of the post. It’s not so clean code, because I still modify parts of the code based on what I need on the field. :)
    A schematic I don’t have, connecting everything is simple if you worked with atmel microcontrollers before.
    Best regards,
    Florin

  3. Budi
    August 17th, 2009 at 05:22 | #3

    Dear Florin Vasilescu,

    Great project…
    i come to here from google…
    i already take a look on your code.
    But i have several question , about calculating factor and points ( both normal,
    or dual rate ).

    for example :
    // rest of channels PREcalculations
    factors[0] = elev_factors;
    factors[1] = aile_factors;
    factors[3] = rudd_factors;
    factors[4] = aux1_factors;

    from where elev_factors value refreshed ? i’m not find the function that reload new value into xxx_factors.
    Would you like to give me an explanation?
    Actually , i want to make same project, and i want to ur project as an base.

    Thank you very much…

    rgds,
    Budi

  4. icounter
    August 18th, 2009 at 08:07 | #4

    points[0] is actually the array elev_points, and it’s passed to the precalcCH function.

  5. Budi
    August 18th, 2009 at 11:55 | #5

    ok i got it… you pointed calculation data into pointer type..
    thanks ….

  6. Ciobanu Rivelino
    June 24th, 2010 at 21:10 | #6

    Salut.
    Se poate sa te intreb daca merge sa modific o futaba 7 C (s-a dus …).
    Este in 35Mhz si are separat modulul radio.
    Cu PPM(stiu ca exista PCM si PPM)merge acest proiect cu receptorul lor dual conversion?
    Mersi

  7. icounter
    June 25th, 2010 at 09:10 | #7

    Salut Rivelino,
    Ar trebui sa mearga cu PPM. Daca modulul radio accepta la intrare un semnal normal PPM, ar trebui sa mearga.

  8. Ciobanu Rivelino
    June 25th, 2010 at 10:33 | #8

    Mersi. stie PPM si PCM.
    In curand o sa ma apuc de el,dar nu cred ca futaba , deoarece receptoarele sunt scumpe. Mai degraba ceva cu simpla conversie.

  1. No trackbacks yet.