Discrete transistor circuit to generate variable PPM signal? - Page 1
Forum section: electronics / beginners

author: Refrigerator
author_rank: Super Contributor
timestamp: January 27, 2016, 08:01:56 pm
content: I've been searching high and low and couldn't for the life of me find a discrete PPM circuit, neither could i come up with one that would generate a simple two channel R/C PPM.I want to go discrete and as little components as possible just as a challenge and an exercise in learning.What I've tried to do so far was to extend the simple two transistor multi-vibrator but it seems like after three transistors it stops working as intended, i then tried thinking of SCSs and different kinds of oscillators but still no cigar.So here i am asking for a little help in solving this puzzle.Thanks.

author: uncle_bob
author_rank: Unknown
timestamp: January 27, 2016, 08:58:21 pm
content: HiJust to check before this spirals off in the wrong direction.PPM = pulse position modulationPWM = pulse width modulationAre you sure you want pulse position? PWM is a lot more common these days.Bob

author: Refrigerator
author_rank: Super Contributor
timestamp: January 28, 2016, 01:16:09 pm
content: Quote from: uncle_bob on January 27, 2016, 08:58:21 pmAs i mentioned i need two channel PPM, a pair two short 0.5 to 1.5 mS variable pulses with a longer pulse to seperate each pair.Seems easy in theory but has proven to be reasonably difficult in practice.Although i have seen a circuit that takes a PWM signal and turns it into PPM but there's nothing to learn from replicating a circuit seen on the internet.

author: Mechatrommer
author_rank: Super Contributor
timestamp: January 28, 2016, 02:50:48 pm
content: Quote from: Refrigerator on January 27, 2016, 08:01:56 pmwith high probability that you wont be able to make it in 2 or 3 components... with exception.. one word one component.... pic10f206... or... atTiny13a.. soic package is fun...

author: uncle_bob
author_rank: Unknown
timestamp: January 28, 2016, 06:10:31 pm
content: HiThe standard approach is to generate PWM first and then pull the PPM pulses off the edges of the PWM. A transistor for each edge should do the trick once you have the PWM.Bob

author: rfeecs
author_rank: Frequent Contributor
timestamp: January 28, 2016, 06:36:59 pm
content: Again you can go back to the old 1970's RCs.A schematic of a 5 channel Heathkit transmitter is attached.It looks like the free running multivibrator drives a sort of shift register that generates periods of different adjustable lengths.The edges of those pulses drive another monostable that outputs a fixed length pulse on each edge.

author: Muxr
author_rank: Super Contributor
timestamp: January 28, 2016, 06:52:42 pm
content: For a discrete design you'd probably want to use op-amps:http://www.engineersgarage.com/tutorials/diy-circuit-design-pulse-position-modulationhttp://www.engineersgarage.com/tutorials/diy-circuit-design-pulse-position-demodulation

author: Refrigerator
author_rank: Super Contributor
timestamp: January 28, 2016, 07:39:09 pm
content: Quote from: Muxr on January 28, 2016, 06:52:42 pmThanks, but although functional the circuits you linked were quite over-complicated in my opinion, since while playing around in LTspice i managed to make a circuit with the same functionality and using only two transistors, it's also variable from 0.5 to 1.5 ms with a 10k pot, i also need to make a more than one channel PPM which is where most of the difficulty comes from.Quote from: rfeecs on January 28, 2016, 06:36:59 pmI think it's funny how it's called digital proportional although it's totally analog but it's really cool to see just how few components it has.Somebody should turn these circuits into kits, much like the walkie-talkies and discrete 555s, and silkscreen every waveform at each test point on the PCB, it would also be compatible with standard RC stuff.Also what i've been thinking about were the SCS and i thought of cascading them in such a way that one SCS would set another SCS while each SCS would reset itself through an RC circuit that would determine my ON time while there would be another RC after that so it would go to the set pin on the following SCS, just to set the delay between the pulses.Sounds like a dog's breakfast but i hope you get the idea.

author: uncle_bob
author_rank: Unknown
timestamp: January 29, 2016, 01:44:56 am
content: HiMuch cheaper / easier to do with a low pin count MCU if you are building this as a "for sale" product. Your connectors and packaging each will cost more than the only chip on the board....One board to stuff and stock. Turn them into whatever you need when the order comes in.Bob

author: Refrigerator
author_rank: Super Contributor
timestamp: January 29, 2016, 04:04:00 pm
content: Quote from: uncle_bob on January 29, 2016, 01:44:56 amNot a product, just a project. Although a MCU would be an easier solution it's not what i want since i like a little challenge and it's cool to see just with how few transistors can i pull this off with. Seems like everything today is pretty much done with MCUs.

author: uncle_bob
author_rank: Unknown
timestamp: January 29, 2016, 05:40:41 pm
content: HiWell, be sure to count proper output buffering in your totals .... It's only a solution once it drops into the system.Bob

author: Zero999
author_rank: Super Contributor
timestamp: January 29, 2016, 07:37:47 pm
content: Quote from: Refrigerator on January 28, 2016, 07:39:09 pmPlease post a schematic.

author: Refrigerator
author_rank: Super Contributor
timestamp: January 30, 2016, 10:23:42 am
content: Quote from: Hero999 on January 29, 2016, 07:37:47 pmHere's a screenshot of the setup on LTspice:https://gyazo.com/32f5b2ae0eee7b2c8abb10b3236ac8deThe measurement was taken at the collector of Q2 and is controlled with resistor R3, which is a 5k resistor in series with the 10k pot. With this circuit the on pulse can be changed from around 0.5 to just over 1.5 mS, verified by changing R3 value from 5k to 15k (full travel of the pot).Also the signal can be squared up by adding another transistor as a buffer on the collector of Q1.Edit: like this (collector of Q3):https://gyazo.com/ca61cadbd90d8d1ddfa642509976b3f2

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 30, 2016, 01:41:08 pm
content: But your 2- and 3- transistor circuits are PWM circuits, not PPM circuits, aren't they? They don't have the same functionality as the op-amp based PPM circuit in Muxr's link.And adjusting R3 changes the frequency as well as the pulse width, yes? Because the pulse HI width changes but the pulse LO width remains (nearly) constant as R3 is adjusted.So now to achieve PPM, you need a stage that will generate a constant width pulse at the trailing edge of every PWM pulse produced by your 3-transistor circuit, right? Something like a monostable pulse generator triggered by the edges of the PWM pulses your circuit makes. Varying R3 would then vary the position of this constant width pulse in the pulse train.Or am I missing something...... ?

author: uncle_bob
author_rank: Unknown
timestamp: January 30, 2016, 02:46:21 pm
content: HiIndeed, what you have described there is not quite true PPM. If that meets your needs, then it's a fine way to go. Be sure to add the buffering or your load will mess things up big time.Bob

author: Refrigerator
author_rank: Super Contributor
timestamp: January 30, 2016, 04:54:40 pm
content: Quote from: uncle_bob on January 30, 2016, 02:46:21 pmThe Q3 should be plenty for the relatively high impedances it'll be driving.Quote from: alsetalokin4017 on January 30, 2016, 01:41:08 pmFrom what i understand what matters is the ON time and the off time is not critical, it's pretty much the same as in the circuit rfeecs attached to his reply.The signal in that circuit seems to have very short off time, which for me seemed a bit unusual but the engineers who made it probably know more that i do so who am i to judge.Edit: i just tried the circuit out on a breadboard and it seems to work very well, although i replaced the 5k resistor to a 10k since the ON time was a bit too short. I also noticed while turning the power supply up and down that the signal stays very constant.This little test gave me alot of new ideas for the circuit, i think i could modify this circuit to give me a 2ch PPM.

author: orolo
author_rank: Frequent Contributor
timestamp: January 30, 2016, 06:50:27 pm
content: Hm, how about a modified LED chaser? Pass through a schmitt trigger to get nicer edges. Trim the base resistors to modulate pulse lenght. If I'm not mistaken, it is essentially what you were aiming for: taking the bistable multivibrator one further step.

author: Refrigerator
author_rank: Super Contributor
timestamp: January 30, 2016, 07:49:25 pm
content: Quote from: orolo on January 30, 2016, 06:50:27 pmI have tried this exact circuit and as i mentioned it stops working if more than 3 transistors are added, i've even used this circuit to drive three phase BLDC motors before.Although what you have there looks almost like 2CH PPM signal, just needs some delay between the ON signals.Now i'm thinking to replicate the circuit i mentioned in my previous reply and change the long delay in between the ON pulses and mix the signal, i could also make them oscillate in sync (trigger at the same time i guess ?).A bit hard to explain the rush of ideas i'm having, might have to make a little doodle in paint to help get the idea across.Edit: just doodled it :https://gyazo.com/7d4d5ad4ddac7c9b275eeb5d1830c7e9The first transistor would give the initial pulse, each delay would cause the long low signal but would be slightly different thus separating the ON signals (i guess).

author: rfeecs
author_rank: Frequent Contributor
timestamp: January 30, 2016, 10:00:29 pm
content: I thought it might be useful to point out that what we are talking about is PPM for a radio control. PPM has been used for radio control for at least 40 years. It has recently been replaced by newer systems but is still used for very simple cheap radio controls.The PPM timing is standardized. This page explains it pretty nicely:http://skymixer.net/electronics/84-rc-receivers/78-rc-ppm-signalThe nice thing about PPM is it is very easy to decode. Just use a serial-in parallel-out shift register. Clear the shift register if no pulse is received for the blanking/sync time. Then clock the shift register. The servo PWM signals appear at the parallel outputs of the shift register.For the transmitter, you have the example from the Heathkit I posted earlier in the thread. Your approach of a ring oscillator would probably work as well, but you need to pick off say the rising edge of each pulse and wire-or them together (you can see this on the Heathkit schematic where they capacitively couple the pulses through diodes and tie them all together). You might want to then use that to trigger a monostable to give you a nice pulse on each edge.

author: orolo
author_rank: Frequent Contributor
timestamp: January 31, 2016, 01:23:02 am
content: Quote from: Refrigerator on January 30, 2016, 07:49:25 pmIt works for odd numbers of transistors, not only three. For example, in page 75 ofhttp://www.talkingelectronics.com/projects/200TrCcts/1-100TransistorCircuits.pdfyou have a 5 transistor example. Altough I have not implemented it myself, I don't see why it souldn't work. The FET variation in page 76 is interesting too. Once you have 5 or 7 stages, it seems only a matter of combining whatever emitter outputs you need via a DTL OR gate. The discarded outputs should give a time delay.Another idea that comes to mind is using PUTs (or UJTs if you can get them) to do the switching work. You could use a npn-pnp pair instead of a PUT, but in my experience that configuration is rather flaky.

author: Refrigerator
author_rank: Super Contributor
timestamp: January 31, 2016, 08:40:11 am
content: Quote from: orolo on January 31, 2016, 01:23:02 amI noticed that too when i was playing around with LTspice yesterday.Edit : after a little playing around in LTspice i got something that looks promising !https://gyazo.com/dfa33df1e59d8ff6bfbb01e9503ddac9

author: orolo
author_rank: Frequent Contributor
timestamp: January 31, 2016, 04:53:31 pm
content: Well, how about this: a square wave clock triggers four cascaded monostables. The 500n caps at the emitters generate slow ramps which, when passed to the OR gate, cause delays between pulses. Besides, the 500n stabilize the cascade, which otherwise would respond to both edges of the clock. This is quick and dirty, but uses rather few transistors. There is some trimming to be done with this circuit for it to work to spec, but I guess it should work. By the way, reading rfeecs' reference on PPM signals, for two channels would you need three short pulses?

author: uncle_bob
author_rank: Unknown
timestamp: January 31, 2016, 06:04:52 pm
content: HiThe more parts that get tossed into this, the more complex it is getting. The alternative solution is $0.58 at Mouser. The PIC with essentially zero added parts will blow any of the multi transistor approaches away.Yes, I know, it's not as much of a challenge. When the challenge solution gets more complex / higher power / lower accuracy / higher cost and less repeatability ..... I question the validity of the solution.Bob

author: Refrigerator
author_rank: Super Contributor
timestamp: January 31, 2016, 09:54:54 pm
content: Quote from: orolo on January 31, 2016, 04:53:31 pmThanks, i guess i went a bit to the wrong direction, your approach seems much better, the signal there looks like my PPM decoder ( also discrete transistors ) could handle it, although the decoder i have now is only 2CH and the signal there looks like 3CH so i'll have to make another one, but that's no problem.If all this fails i'll give the Heathkit transmitter circuit a try since it's guaranteed to work.Quote from: uncle_bob on January 31, 2016, 06:04:52 pmI have a couple Attiny 45s and i could just program it to do what i need but i won't feel satisfied afterwards.I want to learn and doing things the hard way increases the chance of failure thus increasing the rate of learning.

author: orolo
author_rank: Frequent Contributor
timestamp: January 31, 2016, 10:52:41 pm
content: Quote from: Refrigerator on January 31, 2016, 09:54:54 pmI built it with three pulses because I though two channels = three pulses. With only two pulses you need one less transistor. Since I was in a hurry I did the or gate with mosfets; a bipolar one would be much more old-style. Anyway, thanks for the interesting discussion! If you get a working prototype let me know.

author: ade
author_rank: Unknown
timestamp: February 01, 2016, 01:15:15 am
content: Quote from: rfeecs on January 30, 2016, 10:00:29 pmRC PPM signals are not standardized and often differ between RC manufacturers. I.e., they may have different timings, polarity, voltages, channel order, etc. PPM signals from JR vs. Futaba vs. Walkera will all be different.(Which is another reason why using a microcontroller may be preferable.)

author: Mechatrommer
author_rank: Super Contributor
timestamp: February 01, 2016, 05:45:46 am
content: Quote from: ade on February 01, 2016, 01:15:15 ami can confirm that through conjecture. the protocol maybe standardized, but the timing is not. my FlySky 8 channels RC PPM is 50Hz = 20ms frequency, all 8 PPMs are in that time frame, each PPM is 2ms pulse max making 8 channels requires 16ms to generate, still fit in the 20ms period with 4ms relaxed time for the receiver... thinking about how 12 channels is produced, it mus'nt be 20ms period... yeah, take that in discretes for the challenge,not to mention that within the 5-10% eqv PWM pulse you must have a decent resolution for your servo to work smoothly...

author: rfeecs
author_rank: Frequent Contributor
timestamp: February 01, 2016, 06:54:03 am
content: Yes, a little common sense. The servo pulses are 1mS-2mS, so that sets almost all the timing. That leaves the frame period. Like the reference I linked to says:QuoteSo it's a bit loosey goosey. But I think we all get the idea.

author: Refrigerator
author_rank: Super Contributor
timestamp: February 02, 2016, 03:40:21 pm
content: Quote from: orolo on January 31, 2016, 10:52:41 pmThanks, i'll put this together once i find some spare time.Quote from: Mechatrommer on February 01, 2016, 05:45:46 amI'm not trying to reach the moon with my circuit and 12 channels is just ridiculous, even 8 CH is too much IMO.Seems like these days people are just afraid of challenges, i guess tapping the keyboard a few times is just easier.