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: -

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

Post by rperkins » Mon Feb 11, 2013 2:21 pm

The first thread for this topic is here viewtopic.php?f=26&t=2450
Somehow the font size got all messed up. It was driving me crazy so I am continuing the thread here.
If any moderator can fix the original thread, feel free to merge them back together.
More details about the font issue are here. viewtopic.php?f=3&t=2751


User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Mon Feb 11, 2013 2:33 pm

I just tested it and it did compile (verify) for me. Yes the libraries are a little tricky
For information on installing libraries, see: http://arduino.cc/en/Guide/Libraries

In the zip file I provided there are 3 files

Code: Select all

[email protected] ~/temp/s107 $ ls -l
total 12
-rw-rw-r-- 1 rperkins rperkins 2639 Dec  7 05:06 S107Demo2.ino
-rw-rw-r-- 1 rperkins rperkins 3323 Nov 23 03:11 s107_r5.cpp
-rw-rw-r-- 1 rperkins rperkins 3918 Nov 23 01:37 s107_r5.h
the s107_r5* files go in the ./sketchbook/libraries/IRrc/ directory
These 2 files extend the IRrc library to support the s107

The S107Demo2.ino file is the sketch that you load into the arduino IDE ( program )
arduino likes them to be an a subdirectory in your sketchbook and sometimes is even picky about the name of the directory.
this .ino file pulls in the files it needs out of the library

In the end your directory structure should look something like this:
well this is linux but windows is similar, once you locate your sketchbook directory

Code: Select all

[email protected] ~ $ pwd; tree -CLF 3 sketchbook
/home/rperkins
sketchbook
├── libraries/
│   ├── IRrc/
│   │   ├── doc/
│   │   ├── examples/
│   │   ├── IRheli.cpp
│   │   ├── IRheli.h
│   │   ├── IRrc.cpp
│   │   ├── IRrc.h
│   │   ├── LICENSE
│   │   ├── Makefile
│   │   ├── MANIFEST
│   │   ├── perl/
│   │   ├── project.cfg
│   │   ├── s107_r5.cpp
│   │   └── s107_r5.h
│   └── readme.txt
├── S107Demo2/
│   └── S107Demo2.ino
└── sketch_feb08a/
    └── sketch_feb08a.ino

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Tue Feb 12, 2013 7:34 am

Cool, you're a Linux-guy! +1
I maintain a server-park with Linux for a living (among other things).

Your explanation solved my mistake. Sorry for having to cope with such a newby. I'm reading everything I can at the moment about Arduino and the language. All I'm used to is bash, so it takes a while but I'm getting there.

Also did some searching for the IR-LED's and their implementation. There are some pretty powerful ones out there! Another thing I noticed is that in a lot of designs they are powered with high current. Even the LED's in remotes are fed with hundreds of milli-amps! That will make it necessary to pulse them and not leave them in the 'ON'-state. But I will start with low-current for POC and lateron maybe try with higher current or more poweful LED's. I have three unknown LED's laying ready and tested them with a digital camera.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Tue Feb 12, 2013 7:47 am

Cool. glad it's coming along. When you get to looking at my sketch, the first thing I'd do is get the IR led not to transmit when the throttle is at zero. Second I never provided a .eepm file for a model for the 9x. I had to play around with the channel orders to get it working. Here is the working IR-heli model for 9x. It aint pretty. I must have changed the channel order in the setting as it shows TAER and MODE3 . I know I was at mode 2. Come to think of it I havent flown my MCPx since I got the IR_heli flying. So instead of just uploading the model, here is my whole backup. take what you need. If you need me to do some of it let me know. Right now I'm working on building a stand alone avr programmer. I want a little box with 1 button on it. hit the button and it programs usbasp into the target. no pc needed. but i digress.

EDIT - deleted attachment as you now can just use the 4ch template in er9x
Last edited by rperkins on Mon Mar 11, 2013 8:56 am, edited 1 time in total.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Tue Feb 12, 2013 7:55 am

about the pulsing of the IR. We are pulsing it @ 38khz . The carrier is at 50% duty cycle and we arent sending that all the time. So figuring a 50% duty cycle is a conservative estimate. I played with current limiting resisitors and bias resistors. I had some of those IR leds pumping so much juice I could feel them warm up. I couldnt see them any brighter when viewing them in the dark with my video cam though. Never did determine the optimum current. I was running @5v but really we have the battery voltage at hand. the stock controller was like 6v with 3 IR led's in series, with a very small ( 1 ohm or so ) current limiting resistor. all this is from memory so it may be muddy. well i did look up the 38khz part :)


User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Thu Feb 14, 2013 9:50 am

Had a look at the EEPE-file, which wasn't simple because I have Companion9X installed. It loads without problem but doesn't work so I installed eePe as well. Next hurdle for me is learning about TAER, ERTA, RETA etc. When I look at you mixes, Throttle is on CH03. To have that channel react in the Simulator-screen I have to touch the right stick. That's mode-3.
If I understand correctly, you having TAER and mode3 in the settings is the default for new models and that this "IR HELI" model was made before that change. But still I'm a little confused now...

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Thu Feb 14, 2013 10:14 am

yea I had trouble with the eepe/companion9x thing when I tried to share a model I made in eepe with a companion9x user.

I really dont know when I set my tx on mode3 but I know it is wrong. Maybe it happened after I got the IRheli going. I remember sitting at the bench adjusting the arduino script and the channel orders in teh tx at the same time to get it working quickly. I wanted to see it fly :) Once it started working I never went back and polished it up. I also remember thinking some of the changes I made in the arduino script make it incompatible with the rest of the IRrc library. For example if you wanted to control the helicopter using a joystick from your pc. It all has to do with the channel order. there are at least 3 of them. This is from memory and glancing at the script. IT worked but wasnt the correct way.
  • the order the tx sends out the ppm signal. set in the model of the 9x
  • The order in which the PPM values are sent to the IRrc's library serinp[] array.
  • ---then the Irrc library manipulates the ppm values--
  • finally the order the IR is sent out is controlled by the heli.setCommand()

I'm going to bed now but will take a look at it and try to get it looking normal tomorrow. AT least get a model working on mode2

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Thu Feb 14, 2013 8:17 pm

I got my tx put back together. That's good news in itself :)
Restored the backup i posted here, and the heli flew. I did change back to mode2, but dont think it mattered as far as the model was concerned. I still wanna work on it some more after work tonight. At least get it so it's only transmitting when the throttle is > 0.

Btw, the rudder is on the left stick, just like my mcpx. On the oem ir tx the rudder was on the right stick. This was one of my main reasons for making this module. Going back and forth between the 3 channel ir tx and the 9x/mcpx was confusing.

Now that you spurred me to put my tx back together I'm gonn a take advantage of the relatively mild weather we've been having. Thanks

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Fri Feb 15, 2013 9:34 am

Updated the files tonight.

Now the IR quits transmitting after throttle is set to zero. It sends out the zero throttle position a few times before quitting.

Channel A is set by default. If you hold the right stick to the right when turning on the transmitter for the first 3 seconds, channel b is selected.

EDIT- removed downloadable code from this thread and added:
I've setup a web page with the information for this project and to provide the latest version of the code.

http://www.randyperkins.com/index.php/irmodule
Last edited by rperkins on Sun Feb 17, 2013 12:28 pm, edited 1 time in total.

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Fri Feb 15, 2013 12:41 pm

Wow, that is some nice progress!
Did some reading on the topic of "channel order" and now I understand what it's for. My v911 uses AETR which is standard for a stock 9X and thats why it works out of the box. For the s107 I will use ERTA, correct? Rudder being on the left stick is just fine and indeed preferable compared to the standard Syma TX.

Off-topic:
If I can find the time will flash Open9x this weekend. Received the USBasp yesterday, together with the Backlight but will put that one on a breadboard for experimenting for finding the correct resistor and pot values. The haptic-mod is already done and the 78L05 on the switchboard is swapped. Also have a LiFe-battery wired with the right connector. And received a dongle-emulator so I can RF connect with a simulator. Maybe I should quit my day-job to get more time to play :)
At the moment the 9X is still in "exploded view" :) on my desk.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Fri Feb 15, 2013 4:06 pm

exploded view. I like that. It was fun actually flying the helicopter for a change . I couldnt do that in exploded view :).

Actually when I changed the setting in my TX back to mode 2 it jumped to TAER. That is how the sketch is setup. I just arbitrarily picked that order cause that is the standard JR order. I was reading last night and read that a stock 9x, even though it is JR compatible module, came in Futuba order of AETR. I'm thinking that since the module compatibility is TAER, then It should be TAER. My assumption is that it would work in a stock JR radio that the channels are not assignable. This is open for discussion if you have any input .

and when I say TAER there isnt an Aileron. the A is actually called the 'trim' right now because that's how the Irrc's library's demo implementation was setup. so it's TxER. for trim you just use the trim as you would on any other model. the 'x' channel, which is the horizontal axis of the right stick in mode2, is the one I setup to select the channel.

I recall reading the trim in the original tx didnt move the center value, it shifted the endpoints, which effectively moved the center. It was speculated that by using the full range in the sketch that you should be able to turn faster. I dont really see it. I probably need to follow up on this. I tested the trim on the rudder channel and it works. I always need to adjust my trim on my syma as the battery gets weak.

While this is fresh in my mind, this weekend I'm gonna straighten out the order's within the library. I was looking last night and it might not even make a difference, but I want it to be consistent. That way if people want to steal parts of my work and mix it with other parts of the Irrc's demo code, it will be simpler.

On the 9x end I'd like to be able to get the model going by:
1. selecting your channel order in 'general settings'
2 . selecting your stick mode in 'general settings'
3. select a new model
4. go to templates and choose 'simple 4 channel '

Now I'm really weak on the working of 9x so there may be a better way.

Also want to setup a place where the code resides. It's not practical to keep submitting it here. For now I'll just setup a webpage with it on there. I've never done a github or similar but would be willing to do it if someone else wants to contribute.

Last thing I was thinking was a feedback to the user . I'm thinking a good old led. It wont use too much power will it ? I was thinking it will be on when your not transmitting and blink when you are. Also when you first power up it will slowly blink once or twice to indicate what channel your on. We dont need it now but if additional protocols are added it could be used to demonstrate which one is active. Plus LED's are cheap and the usbasp board I eventually want this to run on already has a couple :)

After those 2 changes I'm gonna let it sit till you get yours going and give me some feedback. Have you given any thought to how your are going to update your internally mounted IR module ? You gonna open the case every time ? I expect this will need tweaking for a bit :)

User avatar
rainer
Posts: 391
Joined: Tue Jan 01, 2013 9:20 pm
Country: Germany
Location: near Düsseldorf

Re: Continued-Infrared module for JR compatible TX, includin

Post by rainer » Sun Feb 17, 2013 9:55 am

Great project! i like it.
btw: i checked the original thread. font size is the same as everywhere else did you try emptying your browser cache?
build your own vario ==> https://github.com/openXsensor/openXsensor/wiki (Formerly https://code.google.com/p/openxsensor/ and https://code.google.com/p/openxvario/)

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Sun Feb 17, 2013 12:26 pm

thanks. yea I checked the cache. I think it's a chrome browser thing.
I'v setup a web page with the information for this project and to provide the latest version of the code.

http://www.randyperkins.com/index.php/irmodule

I'd like to keep the discussion going here. I polished up the zipfile, removed some cruft that was from the examples I used as starting points, re arranged the order of the parameters inside the library to match the existing code in the library, and added the relevent readme and license bits.

Once you acquire the hardware using the 'Simple 4-CH' template in ER9x will get you started. Then go into the model settingsand change the 'PPM protocol' from 8ch to 4ch. EDIT- no longer necessary

I'd like to add support for more IR helicopters, but the S107 is all I have. It wouldnt be hard to add them, especially as most of the popular ones have already been decoded.

Comments, suggestions, and discussion are appreciated :)
Last edited by rperkins on Mon Mar 11, 2013 8:54 am, edited 1 time in total.

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Mon Feb 18, 2013 12:26 pm

rperkins wrote:...and when I say TAER there isnt an Aileron. the A is actually called the 'trim' right now because that's how the Irrc's library's demo implementation was setup. so it's TxER. for trim you just use the trim as you would on any other model. the 'x' channel, which is the horizontal axis of the right stick in mode2, is the one I setup to select the channel.
Ok, but does the sketch look at the stick for trimming or is it actualy the trim-switch on the right? If it is the trim-switch it would perhaps be better to use the left horizontal trim-switch because for mode-2 yaw is on the left. Or is this not possible due to the nature of the IRrc-library?

Compliments on the progress of the sketch and the website!

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Mon Feb 18, 2013 12:47 pm

rperkins wrote:After those 2 changes I'm gonna let it sit till you get yours going and give me some feedback. Have you given any thought to how your are going to update your internally mounted IR module ? You gonna open the case every time ? I expect this will need tweaking for a bit :)
Ok, will take a while, waiting for the package from China.
Uhh, didn't think about it that much no :mrgreen: But I think of the following 'solution' for the Beta-period:
USBtoISP.jpg
USBtoISP.jpg (6.83 KiB) Viewed 6101 times
and feed the cable through the hole meant for the charging-port. Or maybe I glue a ps2 female-part in that spot and replace the connector on above thingy. Another possibility during testing-periode would be connecting the arduino-mini to the JR-module connector like you did. Depends on the size of the mini; haven't checked really...

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Mon Feb 18, 2013 5:11 pm

The trim for the rudder is the on the left horizontal as is should be, just like any other mode 2 model. The right horizontal doesnt do anything at all after the first 3 seconds of powering up. Those first 3 seconds are when the IR channel is chosen by holding the right horizontal (aileron) all the way right to choose channel 'B'. I'd only use channel 'B' when I had 2 units. Channel 'A' refreshes faster. Not sure if you could tell a difference but 'A' refreshes at 120ms while 'B' refreshes at 180ms. These values are from the protocol, I didnt choose them.

Your solution looks good to me. I dont know enough about the mini to know how it is put into programming mode. Yea with mine hanging off the pins of the module bay I was a little worried at first but the weight isnt much. The socket provides enough tension to hold it on firmly.

Yea I'm waiting on the shipping from China to start back up also.

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Tue Feb 19, 2013 7:28 am

rperkins wrote:The trim for the rudder is the on the left horizontal as is should be, just like any other mode 2 model.
Ok, great. I just misread this sentence:
rperkins wrote:so it's TxER. for trim you just use the trim as you would on any other model. the 'x' channel, which is the horizontal axis of the right stick in mode2, is the one I setup to select the channel
All clear now.

Ohoh, the reset for the mini: it does support auto-reset, but..... DTR is not on the FTDI :x Guess I have to start looking for a JR-module case.
Just received a mail confirming the mini with the cable has been shipped.
Your suggestion for a feedback LED sounds good to me. Anyone who doesn't want to use it just doesn't have to connect it. I'm a sucker for LED's though :lol:
The idea of making use of an usbasp is not intentionally ignored by me, but it is just a step too far to fully understand at the moment. I did follow the link from your webpage to project-ouroboros and think the concept is interesting but see no advantage over using the mini. Unless it can still be used as an USBasp for programming the 9X AND running your sketch. If mounted inside would safe some space being multipurpose.

I'm going to be quite now for some time while waiting for things to arrive and finishing some other mods. Also trying to learn to fly FP; that is something else than the s107 :roll:

cYa-later, Ed
Last edited by C4Vette on Mon Dec 09, 2013 8:12 am, edited 1 time in total.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Tue Feb 19, 2013 7:50 am

I like the module idea for myself. Not so much against the internal module as drilling the holes for the IR led's and hoping to get a good range out of them. If you wanted to still go internal you could maybe hook the programming lines into the same programming lines for the 9x with a switch to only power the mcu you want to reprogram. Or hook the reset of the mini to one of the 9x switched you never use when flying IR, like the trainer. Flip the trainer switch when wanting to reprogram the mini. I'm just thinking out loud, never done either of these.

yea the project ouroboros thing is way out there. the advantage is cost. Just making one for ourselves it doesnt matter. But if you wanted to make 100 of them :) No it wouldnt function as an usbasp . It would be an IrModule that is reprogrammable via usb. Where I got stuck was getting the code to run on the m8. the definitions for the timers are different. I think the timers have enough capabilities, they are just arranged and defined differently. Also would have to account for the difference in clock speed. I think the usbasp runs at 12mhz because it is a easy multiplier to 48mhz usb speed. When it didnt work right away I got away from it. your interest is keeping me engaged though :)

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Sat Mar 09, 2013 3:42 pm

Good news!
Well, most of it.

The sketch is loaded in the mini and is connected to my 9X. For test-purposes just one IR-LED on a breadboard together with the Arduino. The heli binds, yeahhh. Oops, then goes full-throttle (later I learned it was half throttle). A litttle fiddling with the sticks and I noticed the channels are mixed- up. 'Mixed', you get it... haha.
After setting the mixer to TREA (?) and the 9x still in Mode-2 it was ok. Still could not fly because when throttle is at 0% the motor is at 50%. Giving just a little throttle and the motor stops. Because I had no trim on that channel I arranged for that. Now I could get it to bind without going straight up, great! But maybe there should be something in the software to prevent this?
Haven't actually flown yet because after all this trial and error the battery needs charging but had to give you the good news right away!
Last edited by C4Vette on Mon Dec 09, 2013 8:16 am, edited 1 time in total.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Sat Mar 09, 2013 5:23 pm

Alright. way to go !!

hmm.. What I have written above is TAER. I may need to clarify the instruction on creating a model using a template.
This link http://openrcforums.com/wiki/index.php/ ... #Templates
talks about "Toggle your prefered channel order BEFORE you select the desired template.''
If you continue to have problems I will clarify the instructions

In mode2 the throttle is on the left vertical stick. It should be spring loaded and rest at the lowest point. Unless you are holding that stick off of bottom the heli should not pop up after binding. my guess is this is related to creating the model from the templates before setting the channel order.

What are you using to drive the LED ? My 3 LED array driven @ 5v has slightly less range than the original IR TX. I'd like to improve my range.

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Sat Mar 09, 2013 7:45 pm

Thanks for the tips.
I started over; first put the 9X on TAER and then created a new model. Changed nothing in the setup except for changing from 8-channel to 4-channel.
The trimming-issue is gone now. However when I throttle down it reaches a point where it stops and when I push the throttle-stick the last 2 milimeters or so the motors start up again at 50% for 3 seconds and then shut down. This also happens when I shut-down throttle at once; the motors go up to 50% for three seconds.
But the responce is great, ELE, RUD and AIL are very docile. Just wonderful!

The LED is still on a breadboard driven directly by pin-3 with a resistor of 180 ohm. Just for testing because all is new for me: the 9X, the software, the arduino.
Next step will be a FET driving three LED's from Vbatt on the JR-connector. I'm using a three-cell LiFe so thats <10volts. Still have to decide on the resistor because I'm not sure what current the LED's will survive. Will probably place all on a piece of board inside the JR-slot for the next tests hopefully tomorrow.

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Sat Mar 09, 2013 9:07 pm

Because I wanted to test with a FET I placed it on the BreadBoard with a normal LED. What I then saw was that it stays lit when the throttle is at idle. Is that as aspected?
The LED is now running from the Vbatt switched by the FET. I understand that the figures are incorrect but at idle there is 3mA (AC) and with a little throttle it goes down to 0.8mA. Again, I understand the figures are incorrect due to duty-cycle and frequency but it does show the LED is lit at idle.
Maybe this has to do with my observation of the throttle going up to 50% for 3 secs at zero stick?

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Sat Mar 09, 2013 10:19 pm

Oops double post
Last edited by rperkins on Sat Mar 09, 2013 10:25 pm, edited 1 time in total.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Sat Mar 09, 2013 10:24 pm

No the led should be off. So you have the ppm out of the 9x going to the arduino ? Have you calibrated the sticks on the 9x? Then verify on 9x that throttle id at zero. You are using the latest revision of the sketch, right ? On the early versions the led was on all the time.

Oh and you bring up a good point . Even though the template js 4 channels it still sends out 8. I made a post about it but the end result is i need to tweak the code so it will work with 8. So go into the 9x and tell it just to send 4 channels.

There is a delay for a second or 2 before the led will go out. I think it sends the 'zero' throttle command 3 times before it shuts down. I'd have to look at the code again.

To troublehoot an ir led i sometimes looked at it thru a camcorder or even cellphone camera. The ir bleeds into the visible light and you can see it come on.

I'm spouting out from memory right now cause i'm it work. Latef tonight can go into deeper the areas you are still working through

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Sun Mar 10, 2013 2:06 pm

Hi, the whole stuff is on a small board now in the JR-slot. Looks a bit like yours now :) Even flown the heli for a bit but the range is not good. At the moment there is just one LED in use. It is now switched by a FET with a 100 ohm resistor. If the Vfwd is about two volts (didn't check...) then the current should be about (10-2)/100=80mA
Next step is going up to three LED's and higher current. Have to decide on how to wire them: serial or parallel. Serial will just need one resistor, maybe easiest.

Answers:
- PPM from 9X goes straight into Arduino pin-8. Nothing in between but a connector.
- The sticks are callibrated perfectly and go exactly from -100 to +100.
- Throttle is exactly -100% at idle
- The sketch came from your website and is dated feb. 17th
- The model is configured for 4-channel PPM

The 2-second delay is not the problem, the LED becomes bright for three (maybe just the two you mentioned) when the stick gets at -100%. What I did to overcome this is set the Limt to -95% and that works perfectly. But I can asure you, the LED never goes out. I've checked that with a normal LED and with a camera looking at the IR-LED. And also checked the original TX and that one does shut-off the LED's after 2 seconds. And man, the LED's in the original TX are a 100 times brighter!! Guess I'm going to have a peak inside soon to find out how they wired the LED's.

laterrr, Ed

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Sun Mar 10, 2013 6:28 pm

Did a little surgery on the original TX and discovered that the three LED's are in series with a 1.8 ohm resistor driven by a transistor. The six AA's deliver 9volts. That gives a max. current of (9-3*1.5)/1.8 = 2.5 Amps :o :shock:
Woah, no wonder they look MUCH brighter through a camera and give much better range. We can only even try this when we are absolutely sure the LED's will never be just 'on'.
9X.jpg

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Sun Mar 10, 2013 6:40 pm

ha . good catch. It is getting brighter for a few seconds when at -100% because I am not spacing the send commands out 120ms ( 180ms for chB). so the rapid fire send of 3 commands all stop without any delay has a higher duty cycle, hence the led is brighter. Plus if there are 2 helis in the room, one on chA and one on chB, they both will probably stop.

if you change your throttle back to -100% range, yes it will get bright for a few seconds, but it should go out after that. I have 3 led's in series, using a 2n222a transistor in a common emiter circuit. I have a series resistor on the transistor input ( base) of 3.3k ohms. This goes to the 9x pogo pin which is ultimately connected to the output pin of the m64. The C-E circuit has no limiting resistor, just the 3 IR led's themselves. The emitter is tied straight to ground. on the collector are the 3 IR in series tied to the 5v supply. I admit using a fet would be better. I have no experience in designing circuits. I am guessing that your led is not going off due to biasing or you are turning on your led when the 9x output is low.

Yes your right that as we increase current we have to be sure that the led does not stay on all the time. It's 62 degrees outside here near cleveland. I'm gonna go crash my helicopter for awhile :)

Later I will see about fixing the brightness of the led you are seeing, figure out how to make a schematic in gschema of my IR circuit, and show you a picture of the test jig I made to test out the sketch.

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Sun Mar 10, 2013 10:01 pm

you're right. the led is staying on. I thought I had that fixed. let me try again :)

Here is my IR driver. I am unexperienced with geda, so it's not up to any standards
IR_driver.png
IR_driver.png (5.79 KiB) Viewed 5971 times

User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Continued-Infrared module for JR compatible TX, includin

Post by rperkins » Mon Mar 11, 2013 8:12 am

Try it now. I thought I had it before but musta lost it tweaking things. The only file that has changed is the sketch. The library files all stayed the same.
Thanks for your feedback and good luck getting some range out of the IRled's.
keep me posted

http://www.randyperkins.com/images/IrModule.zip

version 0.04 3/11/13
Fixed it where the IR Led goes off after a short period when throttle is at zero
Made sketch compatible with 8ch ppm stream as that is what 9x uses as default

User avatar
C4Vette
Posts: 49
Joined: Wed Jan 16, 2013 12:23 pm
Country: -
Location: Lekkerkerk

Re: Continued-Infrared module for JR compatible TX, includin

Post by C4Vette » Mon Mar 11, 2013 6:02 pm

One word: awesome 8-)

After loading the new version of the sketch and putting throttle back from -95 to -100 (Limits) I checked with a normal LED and saw the led go off after a few seconds. Then replaced the LED back for the ir-LED and replaced the 100-ohm resistor for an 18-ohm resistor (still cautious :roll: ).
The heli flies great! No more glitches, no more falling out of the sky (all range-problems I guess) and no more sudden throttle when landing.

Next weekend I will fly together with another s107g so I can check the channel A/B selection. Also will have mine repaired by then: the battery died, what a timing geezz. I fly this heli in a 4x5 meters room (uhh, about 13 x 16 ft) and noticed no range-problem with just one LED! I have no bigger open space to test the range, sorry.

Looking at the LED with a camera reveals that it is about half as bright as on the original TX. Current must be about 470mA already :shock:

You did great work, thanks!


Post Reply

Return to “Hardware Mods”