F3A Encoder

Single to Multi propo
Post Reply
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

F3A Encoder

Post by Mike_K »

A few months back I modified Phil's 7-channel encoder software for Stuart Mackay to use with F3A type models where you'll never need S/C but aileron differential would be useful. So I removed the S/C and added throttle reverse, aileron differential, elevon and v-tail mix (Phil's original is only elevon) and separated the aileron and elevator rates/expo, so they could be individually adjusted. Except I messed up and the elevator expo was still adjusted by the aileron rate/expo pot, whoops...Thanks to Al Clark for bringing this to my attention. Philip Avonds also reported I'd broken the single-handed range check. So I've fix both issues and the revised Arduino sketch/program is attached:

PPM_Enc_8ch_F3A_v2.1F.ino
(21.59 KiB) Downloaded 316 times

And the instructions for wiring up the Arduino Pro Mini for the F3A version are on this site (it's connected differently to Phil's original):

download/file.php?id=9278

Cheers

Mike
User avatar
stuart mackay
Posts: 501
Joined: 01 Mar 2018, 10:38
Location: Swaffham, Norfolk
Contact:

Re: F3A Encoder

Post by stuart mackay »

Great Stuff, Mike!
User avatar
Adrian_H
Posts: 12
Joined: 07 Nov 2022, 11:25

Re: F3A Encoder

Post by Adrian_H »

As explained here, I've made a small change to the Spektrum-selected channel order so that it matches all my other Spektrum dual-aileron models i.e. (their standard?/expected?) T,AIl1,E,R,G,Ail2,Aux(es).

I have put the sketch here.
GardenGate
Posts: 12
Joined: 04 Jan 2022, 16:54

Re: F3A Encoder

Post by GardenGate »

Hi Mike:
I've just downloaded both versions of the sketch (original and the Spektrum modification) and when I try to compile, I get exit status 1 reporting - "Compilation error: redefinition of 'int ch'" - any hints on what I'm doing wrong? FWIW, the PhilG 7ch PPM Encoder sketch on which I think you based this code on compiles and loads fine on the same setup (latest Arduino IDE 2.0.3)

Thanks in advance!
Bill
User avatar
Mike_K
Posts: 669
Joined: 16 Feb 2018, 06:35
Location: Hertfordshire

Re: F3A Encoder

Post by Mike_K »

Hi Bill

I had never tried compiling the encoder sketch with the latest Arduino 2.03 as I've stuck with the older 1.8.19 as the latest version just takes so long to fire up compared to 1.8.19 (and I have a reasonably fast i7 SSD PC). So I fired up 2.03, and it compiled PPM_Enc_8ch_F3A_v2.1F without a problem (see screenshot below).
screenshot.jpg
So we need to work out what you are doing differently to me and many others.

What line number is highlighted when you get your compilation error? When I search for "int ch" in the sketch I only find it's defined once on "line 76", could you have accidentally duplicated the line?

Next what "board" have you selected? I use MCUdude minicore, but I re-tried with the "vanilla" Arduino AVR Boards and selected Nano and ATmega328P and again it compiled OK.
screenshot1.jpg
Finally, if you still have problems, upload the sketch you are trying to compile and I can try to compile it and compare it to what I have in case yours has got corrupted somehow.

Mike
GardenGate
Posts: 12
Joined: 04 Jan 2022, 16:54

Re: F3A Encoder

Post by GardenGate »

Thanks for the quick reply! The error messages are attached, but... I worked it out.

I'm not sure how I ended up in the problem situation in the first place. Somehow, in the Arduino 2.0 IDE, I had two tabs - one tab with the original sketch, the other tab with the version modified for Spektrum. It looks like the compiler tried to take the code from both tabs and found all the declarations in the second ones as duplicates (e.g. "int ch") and choked on that. Removing the second tab allowed it to compile and upload to the microcontroller fine. FWIW - the board I'm using/target is an Arduino Nano compatible.
Attachments
compile errors.zip
(2.91 KiB) Downloaded 96 times
GardenGate
Posts: 12
Joined: 04 Jan 2022, 16:54

Re: F3A Encoder

Post by GardenGate »

Hi Mike:
In case you didn't see, I made a modification of your sketch to better suit working with Micheal Selig's FSOne simulator (instead of working with JR/Spektrum) - see my post here viewtopic.php?f=27&t=1685


Last bumped by Mike_K on 04 Jul 2023, 13:10.
Post Reply