HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Feb 06, 2011, 01:50 PM
Registered User
Joined Jan 2011
21 Posts
Discussion
PPM to PWM circuit for headtracker

Hello all,

I posted treads about gyro's and servo's awhile back and have made some good progress thanks to your help. Now here is the next step....

I need to build a circuit to use the output from a commercial headtracker like the Flytron DT-3K to drive 2 digital or analog servos DIRECTLY, bypassing the whole Tx/Rx paradigm.

Using the DT-3K system WITH a Tx/Rx driving the 2 servos would work perfectly for my project however I need it to work without the Tx/Rx.

In an effort to bypass the (what I am assumming is PPM) signal decoding senario used in these commercial headtracking units that plug into a trainer port, I have used 2 Futaba GY240 gyros (PWM output) to accomplish a headtracker successfully, however the drift is unacceptable.

I have used the X-GYRO 1000 but the drift is just as bad. Does anyone know how pushing the little black button re-centers the gyros so quickly on this headtracker? I have searched everywhere (including emailing the manufacturer) to find this out. If I knew the answer I could probably apply the solution to my GY240's. Until then I am looking at using the DT-3K for it's anti-drifting capabilities (having to face north to use it is not an issue for the project)

So in summation: I am assuming the output from either commercial headtracker is PPM (2 channels). I need a circuit to convert the PPM signal for both channels to PWM to drive the servos.

There are tons of solutions for PWM to PPM conversions out there. I have looked all over for a circuit solution to convert the PPM to PWM but with no success.

The 2 acceptable options for the project that would work are either 1 - figure out how to minimize the drift of my 2 GY240's and figuring out how the X-GYRO 1000 does it with the little black button (I don't mind pushing the button once in awhile) or 2 - Coverting the (what I assume to be a PPM signal) from a commercial unit like the DT-3K or X-GYRO 1000 into the PWM signal to drive the 2 servos.

If someone could point me in the right direction that would be great.

Thanks...
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 06, 2011, 03:32 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
696 Posts
Hi
Are you looking to construct a circuit with a MCU yourself? Then you could smoothen out the jitter you had problems with in some other thread. Have you seen this thread? They discussed how to decode PPM into PWM.

If you want to buy something pre-made... I'm working on a project to parse and generate PWM and PPM in different ways. I just (today actually) added PPM->PWM capability. Unfortunately, the hardware will take a few more months to make. Until then, I can at least give some tips if you want to program an AVR yourself.
But certainly there must be existing solutions? I think I even saw the scheme of an analog circuit that does this somewhere.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Feb 06, 2011, 07:27 PM
Registered User
Joined Jan 2011
21 Posts
Thanks for the reply.
The solution in the tread you referenced is exactly what I am looking for.
I PM'd AnthonyRC to ask for his help. I do have some experience with PIC programming (my son and I got the basic stamp 2 project kit) and did some basic (no pun intended) stuff, so as long as I can get the code and hardware setup I can make it work. I only need to decode 2 PPM channels and encode 2 for the servo's so it should work.
Come on AnthonyRC....I'm counting on you buddy!
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Old Feb 06, 2011, 11:22 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,645 Posts
Your test using 2 gyro's.
They had heading hold? And worked with servo.
So your looking for a fixed PPM signal ? So gyro works, stays in heading hold and gyro only drives servo.
If so that kinda simple.
One option just see if it will work. Use a servo tester, put gyro in heading hold and just move gyro servo should move with out ppm signal changing.
And just get cheap servo tester (small one) swap out pot for fixed voltage divider and drive both gyros off same signal. Should point out gyros need second channel to adjust gain normal mode to HH. Unless you have adjustment on gyro then not needed.

or once you have settings you like code attiny 13/45 that only output that.

Sorry if i got this all wrong, kinda confused
SadSack is offline Find More Posts by SadSack
Last edited by SadSack; Feb 06, 2011 at 11:31 PM.
Reply With Quote
Old Feb 07, 2011, 12:46 PM
Registered User
Joined Jan 2011
21 Posts
The GY240's are heading hold and did work as needed for the servos. I did drive the gyros with a servo tester setting the center position with a 1.5 signal and all was well.
The drift is the only bad issue. The X-GYRO 1000 commercial unit headtracker has a small button to quickly reset the center positiion to correct drift however I cannot find out how they do this or how it could be done without re-initializing the gyros (too long of a delay for the application). The DT-3K is a magnetic headtracker which eliminates drifting but has a PPM signal out as does the X-GYRO 1000. The point is that the commercial units have anti-drifting capabilities and the 2 gyros I have would need some way to do this also (other than the built-in MEMS). I would prefer to use the DT-3K as I wouldn't need to re-center to compensate for drift. I just need to decode PPM and encode 2 channels of PWM and I think that would be a good solution to the project however I am open to any other ideas on how to accomplish this...
Thanks again guys
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Old Feb 07, 2011, 08:31 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,645 Posts
Well i did some digging and once you get your head around PWM Motor control and PWM (PPM) servo control. PPM stream is all the channels put into 1 data stream really blows your mind

In short your looking for PPM (stream) split into 2 PPM (servo PWM)
Know you get some hits when you start googling that.

Read PPM stream
Using arduino
http://diydrones.com/profiles/blogs/...BlogPost:38393
So can read stream and pick out channels you need.

Lucky with out to much effort arduino can run 2 servos without a lot of work.

http://arduino.cc/en/Tutorial/Knob

So little work with code cut/paste few changes you could have what your looking for.

Some info http://www.arduino.cc/cgi-bin/yabb2/...num=1232572239
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Feb 08, 2011, 09:48 AM
Don't crash. It's better
elgatosuizo's Avatar
Tuggen, Switzerland (Yes: Banks and Cheese!)
Joined Dec 2007
174 Posts
I am working on something similar but I still beleive that my X-GYRO 1000 will do the job, despite the fact it's drifting a bit too.
what I want to do is mainly read the ppm values from the tracker pass them to a ppm writer part with the imput from other controls (e.g. a joystick to move the camera sideways and zoom).
I heve some difficulties to read the ppm stream without using an interrupt. The Diydrones codes don't work with the X-GYRO 1000. But I still have to try how long the LOW period should be on the ppm reading pin.
My "Alamo solution" is to use and 2-axes accelerometer and a gyro sensor for the yaw.
Maybe a Wii motion plus can do the job. But using a regular head tracker is more elegant and less geeakier.
elgatosuizo is offline Find More Posts by elgatosuizo
Reply With Quote
Old Feb 08, 2011, 10:15 AM
Registered User
Joined Jan 2011
21 Posts
Hey elgatosuizo, when using the xgyro1000 how often do you have to push the button to reset the drifting?
Also, do you think the solution that AnthonyRc used in the post that fpvkwiki refered to earlier would work? I think it will be the exact solution I need for my project.
I PM'd AnthonyRc but with no response yet....you guys are both in Switzerland, track him down! Hope he checks his PM's soon.
Does anyone know if AnthonyRc's solution is available to view in it's entirety?
Thanks again...
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Old Feb 09, 2011, 05:52 AM
Lift is cheap - Drag sucks
Tom Harper's Avatar
Socorro, NM
Joined Jul 2004
3,517 Posts
38,

To convert PPM to PWM you simply apply the PPM signal to the clock input of a shift register. Each PPM pulse will then propogate the bit through the shift register and the 'on' time of each output will be PWM for an individual channel. The inter-record gap is used to reset and prime the shift register. That's the way it is done in your recvr.

Tom
Tom Harper is online now Find More Posts by Tom Harper
Reply With Quote
Old Feb 09, 2011, 01:48 PM
Registered User
Joined Jan 2011
21 Posts
Thanks for getting back to me Tom I REALLY appreciate it!
Are you talking about a PIC microcontroller with code or is your solution a hardwired circuit. I don't mean to sound like an idiot but with the explanation you just gave I feel like one. I can program a basic stamp2 and I can also build electronic circuits with perf boards from radio shack and discrete components.
If there is a tutorial or other step by step instruction for your solution I can do it.
Tom, I have been reading a lot about this and it seems there are issues with servo jitter, timing overlap blah, blah, blah...did you happen to read the thread that fpvKiwi refered to above? I'm sure you did as that's where you posted some suggestions. It sounded like the outcome of both Anthony's solution and yours is exactly what I need. I am trying to comprehend the differences in both solutions; is your's uC as well?
Thanks Tom, I appreciate the response...

38
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Old Feb 09, 2011, 03:51 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
696 Posts
You could also use the 4017 decade counter. Look at the nice animation and imagine a PPM signal is used as in-signal: http://www.doctronics.co.uk/4017.htm
This project talks about the 4017 to decode PPM but in the end they use an AVR: http://www.voidpointer.de/servoswitch/index_en.html
As far as I understand, no uC is needed...?

@elgatosuizo: Why can't you use an interrupt?
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Feb 09, 2011, 06:55 PM
Registered User
Joined Jan 2011
21 Posts
I just looked at the links u provided fpvkiwi and from other research i've done there seems to be some advantage to using a uC as it can be programmed to analyze good frame data so as to weed out and discard 'noise' or other interference which can wreak havoc on the output signal....like one guy said "try running an electric drill next to your Rx and see what happens to the servos".
What do you think about signal verification of the frame data stream? Can this be accomplished without a uC?
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Old Feb 10, 2011, 05:55 AM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
696 Posts
Oh I would use a uC.
Regarding signal verification there's not much you can do if there is a problem. Since the parts are on the ground side, any problem should be pretty easy to fix, I presume. Still, a uC lets you smoothen servo movements and so forth.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Feb 10, 2011, 11:05 PM
Registered User
Joined Jan 2011
21 Posts
Ok, after some more investigation I think that for the time being I am going to go with the route that Tom Harper suggested using the 4017. I will do it with a uC when I have time to delve into programming etc. Right now I just want to get it done. My understanding is that the 74HC4017 would be the way to go.
I am unable to find any schmatics on the right configuration....if there are any other components that go between the PPM stream and the clock input pin (or do you just hook it up directly from the headtracker). Do the output pins hookup to the servos directly or does there need to be a signal amplifier to drive them. Does any of the unused outputs need to be brought low or high and not just floating?
There are tons of posts with the general info on this but I can't find any 'this goes here and that goes there' info. I can certainly figure it out if I could get just a little more info in the right direction using the 4017...
Any suggestions would be appreciated. Thanks
38cjc38 is offline Find More Posts by 38cjc38
Reply With Quote
Old Mar 04, 2011, 04:28 AM
Don't crash. It's better
elgatosuizo's Avatar
Tuggen, Switzerland (Yes: Banks and Cheese!)
Joined Dec 2007
174 Posts
Quote:
Originally Posted by 38cjc38 View Post
Hey elgatosuizo, when using the xgyro1000 how often do you have to push the button to reset the drifting?
Also, do you think the solution that AnthonyRc used in the post that fpvkwiki refered to earlier would work? I think it will be the exact solution I need for my project.
I PM'd AnthonyRc but with no response yet....you guys are both in Switzerland, track him down! Hope he checks his PM's soon.
Does anyone know if AnthonyRc's solution is available to view in it's entirety?
Thanks again...
Sorry. I did not set thze e-Mail notification and had no clue that you asked me something. So: I have to push a lot of times to reset the xgyro1000 tracker. My project drifted to a complete FPV controller that includes a tx for the fpv servo's, 2 sticks from an old radio, eagle tree ground station and monitor and the head tracker gyro as well on fat shark googles. I found out that sometimes I need to control the pan/tilt by joystick and noth with the head tracker. I need a 2bd stick as well bacause I control a dome camera on the belly of the pane.

Actually I used an ATMEGA328 with Arduino Bootloader to read the ppm signal from the head tracker gyro. The I generate 2 analog outputs I can read with the mainboard (another arduino) of the pfv controller. I figured out that it's the most glitch free method. This will cause some latency, but it's acceptable.
I filtered the signal in order to move the servos only if I move my head for more than some amount of degrees. small movements are ignores. This will stop any jitter. The mainboard is mainly a kind of custom made rc tx with a corona diy module I feed with a ppm signal. Mainly I do ppm-2-analog-2-ppm with injection of the additional signals.
elgatosuizo is offline Find More Posts by elgatosuizo
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Help! Walkera Q pwm > ppm & Q pwm>B pwm (broke) SadSack DIY Electronics 7 Mar 20, 2010 07:18 AM
Question Adding additional PPM inputs to a headtracker/module setup. SebastianJ FPV Talk 0 Aug 19, 2009 07:38 AM
Question Adding additional PPM inputs to a headtracker. SebastianJ DIY Electronics 0 Aug 18, 2009 03:37 PM
Question PPM decode + PWM encode in one PIC AnthonyRC UAV - Unmanned Aerial Vehicles 31 Mar 04, 2008 04:10 PM