HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Dec 19, 2012, 06:56 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
Hi Ian,
Since I am going to use the Spektrum DM8 module, I did a search on the RCG DIY Electronics Forum to see what the DM8 required in the way of PPM input. There seemed to be a lot of controversy concerning the PPM timing requirements. The guys over at the Lynxmotion Remote Control Forum developed an input timing diagram, that I have attached, that is quite a bit different from what I found on the DIY Electronics Forum. Could you please take a look at the diagram and tell me what you think? Is it possible to modify your present code to produce such a PPM output? Obviously your PPM signal would need to be inverted.
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Last edited by TCIII; Dec 19, 2012 at 07:00 PM. Reason: Always second thoughts!
Reply With Quote
Sign up now
to remove ads between posts
Old Dec 20, 2012, 01:41 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by TCIII View Post
Hi Ian,
Since I am going to use the Spektrum DM8 module, I did a search on the RCG DIY Electronics Forum to see what the DM8 required in the way of PPM input. There seemed to be a lot of controversy concerning the PPM timing requirements. The guys over at the Lynxmotion Remote Control Forum developed an input timing diagram, that I have attached, that is quite a bit different from what I found on the DIY Electronics Forum. Could you please take a look at the diagram and tell me what you think? Is it possible to modify your present code to produce such a PPM output? Obviously your PPM signal would need to be inverted.
Regards,
TCIII
Hi,

A quick look and I think you'll get away with just setting the following parameters which you'll find near the top of RCJoystickTx_USB_LE3DP_ArdMega_IDEV1.ino.
There's just some tweaks to the timing and of course to invert the whole PPM stream which luckily I have a simple setting to allow you to do.

pulseMin = 1000
pulseMid = 1500
pulseMax = 2000
InvertPPM = 1
Fixed_uS = 400

In regard to the invert, you might not need to do this in the code because if you end up buffering the actual PPM output then the easiest way to do this is with a transistor and if you do it that way then the transistor will do the invert for you.

Note: Arduino outputs can source 40mA each.

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Dec 20, 2012 at 03:16 AM.
Reply With Quote
Old Dec 20, 2012, 01:52 AM
Registered User
charlienofun's Avatar
United States, CA, Santa Clara
Joined Mar 2008
374 Posts
Quote:
Originally Posted by TCIII View Post
Hi Ian,
Since I am going to use the Spektrum DM8 module, I did a search on the RCG DIY Electronics Forum to see what the DM8 required in the way of PPM input. There seemed to be a lot of controversy concerning the PPM timing requirements. The guys over at the Lynxmotion Remote Control Forum developed an input timing diagram, that I have attached, that is quite a bit different from what I found on the DIY Electronics Forum. Could you please take a look at the diagram and tell me what you think? Is it possible to modify your present code to produce such a PPM output? Obviously your PPM signal would need to be inverted.
Regards,
TCIII
I built one of these that outputs the PPM into a futaba trainer port cable but no changes to that part of the code nor did I invert the ppm shift externally. I had the DM8 module in that radio and it worked perfectly. I'd be surprised if you really needed to do anything other than connect it all together. I previously had the DM8 running off the trainer port of my 7c. I assume no responsibility if you blow up your spektrum module sorry if the above is a little cryptic i'm short on time ATM.
charlienofun is offline Find More Posts by charlienofun
Reply With Quote
Old Dec 20, 2012, 09:02 AM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
@Ian/charlie,
Thanks for the information. Much appreciated. I will give it a shot using caution! LOL
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Old Dec 20, 2012, 09:28 AM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Might need to play with this param also:

PPMFreq_uS = 22500; // PPM frame length total in uS

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Dec 20, 2012, 01:58 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
@Ian,charlie,
Hooked up the DM8 to my Arduino R/C stack with a servo cable except that I did not attach the DM8 PPM input to the pin 12 PPM output. Made a measurement of the voltage on the PPM input of the DM8 and found it to be 3.28 vdc indicating that this pin has an active pull up on it. Therefore the path forward will be to either invert the PPM output of the Arduino R/C stack and use a NPN transistor to couple the PPM output to the DM8 PPM input or see if I can make the output of the Arduino pin 12 PPM output into an open collector ouptut and not have to invert the PPM signal. Comments?
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Old Dec 20, 2012, 02:09 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
@Ian,charlie,
According to the Arduino.cc the outputs of the Mega "operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms." So unless Ian has enabled the pull-up resistor on pin 12, it has no pull up connected by default and I can drive the PPM input of the DM8 directly from the pin 12 output of the Arduino Mega in my Arduino R/C stack? Comments?
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Old Dec 20, 2012, 02:37 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by TCIII View Post
@Ian,charlie,
According to the Arduino.cc the outputs of the Mega "operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms." So unless Ian has enabled the pull-up resistor on pin 12, it has no pull up connected by default and I can drive the PPM input of the DM8 directly from the pin 12 output of the Arduino Mega in my Arduino R/C stack? Comments?
Regards,
TCIII
The Arduino pull-ups are only active when used as a digital input, not output.

Here's what appears to be a helpful page regarding the DM8 interface:-
http://www.rcgroups.com/forums/showt...1147689&page=5

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Dec 20, 2012, 04:25 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
Hi Ian,
Yes, I read later that they are only available on the inputs which makes sense now that I think about it. Thanks for the link. Much appreciated.
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Old Dec 22, 2012, 02:41 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
Hi Ian,
I would like to report that I was able to make a successful connection between my Arduino USB R/C stack and my Spektrum DM8 FUT module and have the DM8 bind with my Spektrum AR7000.
I started out by building an interface circuit using a 2N2907A PNP transistor. I normally work with NPN transistors, but during my move from TX to FL my stock of NPN transistors has disappeared and I was lucky to find the 2N2907A lying around in my junk box. Using a PNP transistor in place of the NPN just requires that you hook the emitter to the pullup pin and the collector to ground so the electrons can flow up the collector, through the base, and out the emitter to the pullup drain. I put a 4.7k resistor in series with the PPM output of the Arduino and the base of the 2N2907A transistor. I also put in a pullup resistor from the base to the emitter to make sure that the 2N2907 was hard off when the Arduino PPM output is high. Using the PNP transistor results in no inversion of the PPM signal unless it is inverted in the software.
I then adjusted the PPM timing to what you had suggested based on the Lynxmotion PPM diagram and inverted the PPM signal to be rising from low to high in the software. This combination of PPM timing and signal polarity worked just fine and I was able to get the DM8 to successfully bind with the AR7000. The servo ranges are correct for the high end of the pulse width (2ms), but need some adjustment to get to the low end of the pulse width (1ms). Do you think that I might need to adjust the PPMFreq_uS to 22500 to correct the low end issue? Otherwise I have been successful getting your Arduino USB R/C interface to work with my DM8 and that makes me very happy.
Thanks for all you help. It is much appreciated.
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Last edited by TCIII; Dec 22, 2012 at 02:47 PM.
Reply With Quote
Old Dec 22, 2012, 05:25 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Quote:
Originally Posted by TCIII View Post
The servo ranges are correct for the high end of the pulse width (2ms), but need some adjustment to get to the low end of the pulse width (1ms). Do you think that I might need to adjust the PPMFreq_uS to 22500 to correct the low end issue? Otherwise I have been successful getting your Arduino USB R/C interface to work with my DM8 and that makes me very happy.
Thanks for all you help. It is much appreciated.
Regards,
TCIII
The low end issue will have nothing to do with the 22500. You should just adjust the parameters per my earlier post only.

Make sure also that the TRIM settings are all at zero before you start testing. They should be by default.....but just check anyways.

Hope you have fun with the joystick anyways......it's REALLY great to see others making use of my code!

Ian.
IanJ is offline Find More Posts by IanJ
Reply With Quote
Old Dec 23, 2012, 02:17 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
Hi Ian,
I took some data today at the Arduino USB R/C transmitter end and at the Spektrum AR7000 receiver end.
The data at the transmitter end appears to be per your specifications for the A to D conversion ranges and the PPM ranges for the aileron, elevator, rudder, throttle, etc channels. However, at the receiver end, the low end of the ranges is around 1.385ms and not 1.0ms and the mid range is 1.885ms and not 1.5ms, but the high end of the range is around 2.075ms. There appears to be a ~400uS offset in the low end and middle of the ranges. I read in the Lynmotion thread that they had to subtract out 400uS from the beginning of the low end. Should I offset the bottom end of the range by 400uS? Comments?
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Old Dec 23, 2012, 03:06 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
Hi Ian,
I took the initiative and reduced the low end, mid, and top end by values by 400uS and that took all of the offsets out of the low end and the mid range and the high end is still around 2.0mS as it should be. I think that I will change the offset to around 390uS which will bring the low end in at 1.0mS, the mid at 1.5mS, and the high end at 2.0mS. Then I can use the Trim function to dial in the mid range. Looking good now. I will work on the enclosure tomorrow so that I can try out the system with my 4WD rover.
Regards,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Old Dec 23, 2012, 03:57 PM
Registered User
Aberdeen, Scotland, UK
Joined Dec 2007
607 Posts
Hi,

Interesting about the offset, at first glance there would appear to be a bug in my code......but as you said the Lynmotion guys have experienced it before. So, I'd just go ahead and tweak what you need to to get the desired result.

I presume you are using test mode on the joystick to see what PPM output you are getting on each channel.

PS. Let me know your final values when you are done & dusted and I'll add the data to my webpage as a helpful tip.

Ian.
IanJ is offline Find More Posts by IanJ
Last edited by IanJ; Dec 23, 2012 at 04:03 PM.
Reply With Quote
Old Dec 23, 2012, 04:06 PM
Where the Robots Roam
United States, FL, Fort Lauderdale
Joined Dec 2007
286 Posts
Hi Ian,
Before I programmed in the 400uS offset, I had checked the PPM output on each channel and it was betwee 1.0mS and 2.0ms for aileron, elevator, rudder, and throttle channels. I have not checked the PPM output since i programmed in the 400uS offset, but I will do so tomorrow.
Yes, it is interesting that the Lynxmotion thread mentions having to subtract off 400uS from each channel to receive the correct PWM at the receiver. Probably has something to do with the DM8 module's PPM processing possibly?
Regard,
TCIII
TCIII is offline Find More Posts by TCIII
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion RC Radio Tx - Re-inventing the wheel! IanJ DIY Electronics 345 Mar 18, 2013 02:44 PM
Sold Immersion RC 600mW 5.8 TX Version 1 $50 shipped. nybeechpilot FPV Equipment (FS/W) 2 Jun 02, 2012 06:36 PM
Discussion Re inventing the internal combustion engine UlteriorModem Life, The Universe, and Politics 10 Apr 11, 2012 05:24 AM
Discussion Re-inventing the wheel philgib Blimps 5 May 25, 2006 06:42 PM
Wanted WTB AeroFly Professional Deluxe USB Interface Version RC Flight Simulator for futaba heliguy Aircraft - General - Radio Equipment (FS/W) 0 Oct 20, 2005 02:21 PM