Continued-Infrared module for JR compatible TX, including 9x

Where to find parts? Refactoring your entire transmitter, new cases? Sticks etc..
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by rperkins » Mon Jan 09, 2017 9:25 pm

Glad you got it working for you


User avatar
jhsa
Posts: 18850
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by jhsa » Tue Jan 10, 2017 12:10 am

He was just lucky he got it to work :mrgreen: He should be blinking LEDs instead :mrgreen: Now he thinks he is a programmer :mrgreen:

Joking :) ;) Have a beer :D

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 16525
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by MikeB » Tue Jan 10, 2017 12:12 am

Just a note, the declaration:
static byte throttleWatchdog;
almost certainly is defining an unsigned quantity, in this case a byte of 8 bits that stores a value from 0 to 255.
The declaration:
static long throttleWatchdog;
defines a signed quantity, in this case likely 32 bits long that stores a value from -2147483648 to +2147483647.
You might find you want:
static unsigned long throttleWatchdog;
to declare an unsigned, 32-bit value that stores values from 0 to 4294967295.

If the 8-bit value is a problem after 30 seconds, a 16-bit (unsigned) value would overflow in a little over 2 hours.
The 32-bit value (signed) would overflow after 7.5 years, 15 years if unsigned!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by andrewju » Tue Jan 10, 2017 3:21 pm

Amazing!!! Thanks a lot, Mike!
I believe an "unsigned int" (16-bit) should be pretty much sufficient. Though, 15 years sounds tempting! :) There's no harm in using an unsigned long, right? The code is really small, and there's still more than enough of free memory...

jhsa wrote:He was just lucky he got it to work :mrgreen: He should be blinking LEDs instead :mrgreen: Now he thinks he is a programmer :mrgreen:
Ha-ha-ha! I was kicked out from my C++ course at the university. :roll: So I'm not even close to be a programmer, that's for sure! :mrgreen:

User avatar
jhsa
Posts: 18850
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by jhsa » Tue Jan 10, 2017 3:30 pm

Ahhh, that explains why you know a bit more than blinking a couple LEDs :) :D
I need to get myself kicked out from some course to see if I learn something as well Ha ha ha :mrgreen: :mrgreen:

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW


andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by andrewju » Thu Jan 12, 2017 10:58 am

Just in case someone will want to build this IR module, here is the Arduino sketch with my corrections:

- Fixed unwanted IR pulses when throttle = 0 for 30 seconds or more
- Improved robustness of IR channel selection (now it works properly with AR9x and ersky9x)
- Incoming PPM channels sequence is changed to RETA (because all of my models are setup this way). Though, is easy to change this according to your specific needs. Comments in the code are very informative!

This is based on David Frank's version modified for an S107C, so camera controls should also work (not tested as I don't have an S107C).


There's one issue (coming from the original v09) I didn't find a fix for. If there is no PPM signal during power on, the IR module will behave strangely. It seem to lose synchronization and doesn't properly decode incoming PPM stream (whenever it will arrive). This happens if you power your radio ON with some switches in a wrong position, or throttle not idle, etc. In this case, the radio alerts you and won't transmit anything over the PPM line until the alerts are confirmed. So even when you pass through the startup checks (correct the switches, put throttle to 0, etc.), the IR module still won't control your helicopter until reset.

I still don't understand why this happens. I probably will look into it a bit later, although I don't have any ideas so far. For now I made a hardware fix for that by placing a reset button on the module itself. So I just clear all the alerts on my radio and then reset the IR module - it always works good then!
Attachments
IRModule.zip
(3.2 KiB) Downloaded 52 times

User avatar
jhsa
Posts: 18850
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by jhsa » Thu Jan 12, 2017 1:39 pm

You need my RF module soft power switch circuit. :) It will only power the module ON if a signal is being sent to it by the radio ;)

I know this is just a workaround to the problem, but I think it would work.. And you would be able to turn the module ON or OFF via the firmware :D Only for Ersky9x though ;) :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

andrewju
Posts: 773
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by andrewju » Thu Jan 12, 2017 4:30 pm

I really do think about your power switch circuit, BTW! Ideally, I could have installed the IR module internally (to PPM2) and keep XJT as my main external module. But this will make the IR module permanently mounted in my main radio. Given that this SYMA helicopter is a toy for home, I don't think I want to do it this way...

Adding your circuit to control power on demand is still an option to consider, even for an external IR module!

User avatar
jhsa
Posts: 18850
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Continued-Infrared module for JR compatible TX, including 9x

Post by jhsa » Thu Jan 12, 2017 8:31 pm

You can even build it inside the module itself ;)

But you can control both modules with only one Soft Power board.. External and Internal..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW


Post Reply

Return to “Hardware Mods”