CR4 - The Engineer's Place for News and Discussion ®


Previous in Forum: Powdery Substance   Next in Forum: Issues About Welding on Boats?
Close
Close
Close
18 comments
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7

PWM to PWM Converter . . . But No Microprocessor

08/12/2017 2:11 PM

I need to take a PWM signal of variable frequency (10hz to 100hz) and convert it to a PWM signal with same duty cycle, but fixed frequency (400Hz). As you might have guessed, I'm driving a digital servo motor in a moving vehicle and need quick response and no jittering at the output. Until I get it working, I can't put hard numbers to "quick" and "no jitter," but 1ms should be quick enough and jitter of less than 1% should be OK.

I'd rather not use a microprocessor (no experience) if possible, but stay with discrete components and IC's. But I am open to all ideas.

Register to Reply
Pathfinder Tags: PWM
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Guru

Join Date: Mar 2007
Location: at the beach in Florida
Posts: 18334
Good Answers: 1064
#1

Re: PWM to PWM converter...but no microprocessor

08/12/2017 3:07 PM

Is this for a speed sensitive steering assist setup? or what?

__________________
Life is like riding a bicycle. To keep your balance you must keep moving. A.E.
Register to Reply
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7
#7
In reply to #1

Re: PWM to PWM converter...but no microprocessor

08/13/2017 2:08 PM

Good guess! But no. See my post #6.

Register to Reply
2
Guru

Join Date: Apr 2010
Posts: 5379
Good Answers: 522
#2

Re: PWM to PWM converter...but no microprocessor

08/12/2017 3:34 PM

I would think that a (very) low pass filter could convert the pwm input signal to a voltage level. From there, you can use this voltage level to generate your output pwm signal, maybe using a 555 circuit.

http://www.mycircuits9.com/2013/04/pulse-width-modulation-pwm-555-timer-ic.html

Register to Reply Good Answer (Score 2)
2
Guru

Join Date: Apr 2010
Posts: 5379
Good Answers: 522
#3

Re: PWM to PWM converter...but no microprocessor

08/12/2017 4:28 PM

If your input frequency is 10-100 Hz, that's a period of 10-100 msec. a 1 msec response is unreasonable. Your signal (modulating) frequency will be much less than the carrier frequency (10-100Hz).

https://en.wikipedia.org/wiki/Pulse-width_modulation

Register to Reply Good Answer (Score 2)
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7
#5
In reply to #3

Re: PWM to PWM converter...but no microprocessor

08/13/2017 12:11 PM

Thank you, Rixter. I too was thinking of a simple RC filter and driving pin 5 of a 555. I may breadboard that and see if it is good enough for my purpose. It's a touchy-feely application; I'll know if it's OK or not pretty quick.

Register to Reply
Power-User

Join Date: Sep 2016
Location: SPAIN
Posts: 122
Good Answers: 5
#11
In reply to #5

Re: PWM to PWM converter...but no microprocessor

08/14/2017 2:01 AM

I am trying to understand what you are trying to do but it is not clear at all.

I guess the 10-100Hz signal is your control signal. You probably mean that this is your bandwidth, but why PWM? The only explanation I can think of is that you are using digital communication in order to achieve some noise immunity.

Anyway, with that signal you want to drive your servo at 400Hz PWM. Here you will need to average from cycle to cycle. So your bandwidth is reduced to 5Hz.

Your response time will be 200ms. If you want to improve that, you must have forgotten the k in your input signal, 10kHz to 100kHz.

Anyway, servo motors do not require such a fast response, so I would be surprised that you need that. Increase the speed of your input signal (it does not make any sense to be this slow) and stick with the 400Hz modulation and it should be fine.

__________________
Building the future!
Register to Reply
2
Guru
Hobbies - DIY Welding - Wannabeabettawelda

Join Date: May 2007
Location: Annapolis, Maryland
Posts: 4047
Good Answers: 222
#4

Re: PWM to PWM converter...but no microprocessor

08/12/2017 11:40 PM

Do you 'know' the carrier frequency of the input signal? Or will that have to be determined from the periodicity?

Is the amplitude of the input frequency constant?

Does the carrier frequency of the input signal vary during operation?

How much resolution does your PWM output need?

For quick processing times, I believe you are stuck with a digital solution as Rixter alluded to above. Analog solutions all have settling time which for low frequencies is a long time.

Edge detection, counter and a divide by function and you can demodulate the input signal, and most microcontrollers have a PWM output. An 8051 micro can do this with ease. I have one of the 'youngsters' in my group do the coding. I used a C8051F040 in one of my designs for a power monitoring and distribution panel. I monitored about a dozen electrical parameters including voltage, frequency, and current as well as temperature and atmospheric pressure (airborne application). There was a lot of 'math' and we had no problem fitting it into the code space.

Check out Silabs.com (Silicon Laboratories).

https://www.silabs.com/products/mcu/8-bit

https://www.silabs.com/documents/public/application-notes/an191.pdf

These little things are amazing.

Register to Reply Good Answer (Score 2)
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7
#6
In reply to #4

Re: PWM to PWM converter...but no microprocessor

08/13/2017 2:06 PM

I guess carrier frequency is the same as periodicity? So it would be 10hz-100hz, constanting changing (it's an EFI pulse from an ICE running at 600-6000 RPM). Can't put a number to the output resolution yet, but guessing within 1% should be OK. And output needs to be real steady as it is driving a critical servomotor in real time.

Wish I could reveal more, but I have a partner with patent fever. Dream on...

I'm game to try a micro. The 8051..I'll go read up on it and see if I have the right stuff for the job

Thanks for all the good pics and info. What do you think of Arduinos and such?

Register to Reply
3
Guru
Hobbies - DIY Welding - Wannabeabettawelda

Join Date: May 2007
Location: Annapolis, Maryland
Posts: 4047
Good Answers: 222
#8
In reply to #6

Re: PWM to PWM converter...but no microprocessor

08/13/2017 2:50 PM

I'm pretty much an analog/controls/power electronics guy but some of my colleagues really like the Arduino's and Raspberry Pie's and such. Those devices make it easier to implement a function, but they carry overhead so sometimes you can't process as quickly as you would like and you have to buy additional 'shields' to get certain functions. The Silabs micro's basically have nearly everything you need, right on the chip. You would probably need some interface circuits depending on signal levels, etc. The micro's also have very little overhead so your code will run efficiently. I can write some code, but since I work with people who are much better at it than me, I let them run with it. Silabs offer development boards. You just add "DK" to part number of the micro. A complete dev kit is about $180 available directly from Silabs or your favorite distributor. You can proto right to the board. Has lots of connectors so you can access the I/O.

I would try the analog LPF first for demodulation since that will be much quicker, but if you aren't getting the performance you need, the uC would be my next step. Then of course you will need a 400 Hz triangular source and a comparator for your PWM modulation.

Coding for the 8 bit micros is not that hard. Get the hang of how to implement the interrupts, and keep each function, like edge detect, counter, etc. in separate modules, then your main is a simply a set of function calls. Makes it easier to debug, because you can 'test' each function independently of the others.

If you noodle around on the web, you can generally find code examples of most simple functions so you don't have to dream those up from scratch. There's a surprisingly large user base for 8-bit micros. Once you figure how to "get the LED to flash" you'll be on your way.

Good luck with your quest.

Register to Reply Good Answer (Score 3)
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7
#9
In reply to #8

Re: PWM to PWM converter...but no microprocessor

08/13/2017 3:06 PM

Yeah, I grew up on analog and feel comfy with 555s and op amps. Here's a nifty chip that looks like it'll do the voltage to PWM: v to pwm

Register to Reply
Guru
Hobbies - DIY Welding - Wannabeabettawelda

Join Date: May 2007
Location: Annapolis, Maryland
Posts: 4047
Good Answers: 222
#10
In reply to #9

Re: PWM to PWM converter...but no microprocessor

08/13/2017 9:02 PM

Gee . . . Linear took all the fun out of it.

Nice chip. I like Linear's offerings. I've used a lot of their stuff all over the place.

Register to Reply
Guru

Join Date: Apr 2010
Posts: 5379
Good Answers: 522
#14
In reply to #6

Re: PWM to PWM converter...but no microprocessor

08/14/2017 12:38 PM

Think of each cycle of you EFI PWM as a sample of the input. By Nyquist, the highest frequency which you can produce is 1/2 the sample rate. So your EFI signal will be less than 5 Hz at 600 RPM and less than 50 Hz at 6000 RPM. I'm sure in reality it will be a lot less than this.

If you filter the PWM signal to convert to a slowly varying EFI voltage signal, at slow speed, you could get some ripple which you do not want to pass on to your 400 Hz PWM output. Another problem is a low pass filter will result in some latency.

Here is a circuit from an Electronic Design News article that converts the PWM to an analog voltage without the ripple or latency. You can then drive your voltage to PWM converter with the output.

http://www.edn.com/design/analog/4347834/Circuit-converts-pulse-width-to-voltage

(There are ICs that do this job, but the frequency specs only go down to 30 Hz. You might want to try one to see what it does at 10 Hz.)

http://cds.linear.com/docs/en/product-selector-card/2PB_2645f.pdf

Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7
#16
In reply to #14

Re: PWM to PWM converter...but no microprocessor

08/16/2017 10:18 AM

This looks really good, but I see that it gives a voltage proportional to pulse width, not duty cycle. Not sure that will work for us...gotta noodle on it. Maybe some mod to that circuit would do it. Thanks for the idea!

I have one of those PWM-to-voltage chips that is spec'd down to 50 hz and I'll see what it does at 10hz.

Register to Reply
Guru

Join Date: Apr 2010
Posts: 5379
Good Answers: 522
#17
In reply to #16

Re: PWM to PWM converter...but no microprocessor

08/16/2017 9:50 PM

You are correct, the EDN circuit needs a constant rate, not variable like yours.

Here is a wild idea that just might work. Your ideal pwm-to-voltage converter would produce a voltage after each cycle, regardless of how long the cycle is (variable frequency). The voltage value is proportional to the duty cycle, the ratio of the pulse time to cycle time.

1. Convert the pulse time and cycle time to voltages using integrators, integrating a constant value for these times. (Switch on rising-edge, falling-edge, next rising-edge)

2. Feed pulse width and cycle time voltages through two log amps

3. Get difference of log cycle time and log pulse width with difference op-amplifier.

4. Run this difference through exponential (antilog) amplifier.

Vout = (pulse time) / (cycle time)

Vout = exp ( log(pulse time) - log(cycle time) )

https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-071j-introduction-to-electronics-signals-and-measurement-spring-2006/lecture-notes/23_op_amps2.pdf

Better yet, here's an IC that will do the voltage ratio for you:

http://www.analog.com/media/en/technical-documentation/data-sheets/AD534.pdf

Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Engineering Physics - New Member

Join Date: Oct 2006
Location: MSP, MN
Posts: 585
Good Answers: 7
#18
In reply to #17

Re: PWM to PWM converter...but no microprocessor

08/17/2017 1:24 PM

Rixter, you and Brave Sir Robin have given me much to think about. I need to review my system and do some testing and see how to proceed. Your wild idea is an ingenious design and I am most thankful. CR4 works great when good engineers gather with thoughtful inputs.

I'll post some results and thoughts soon. In the meantime anyone is most welcome to chime in.

Register to Reply
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 4062
Good Answers: 224
#12

Re: PWM to PWM Converter...But No Microprocessor

08/14/2017 5:46 AM

Just adding top Rixter's post #3

The output frequency is 400Hz, and, you want a response of 1ms?

Not nearly possible.

__________________
We are alone in the universe, or, we are not. Either way it's incredible... Adapted from R. Buckminster Fuller/Arthur C. Clarke
Register to Reply
Active Contributor

Join Date: Aug 2014
Posts: 11
Good Answers: 1
#13

Re: PWM to PWM Converter...But No Microprocessor

08/14/2017 8:46 AM

You won't get 1ms response from a conversion to a 400Hz pwm from a 10Hz - 100Hz PWM in this reality. I believe Nyquist has something to say about this.

Register to Reply
Guru
Hobbies - Musician - Engineering Fields - Chemical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jan 2007
Location: Moses Lake, WA, USA, Thulcandra - The Silent Planet (C.S. Lewis)
Posts: 3802
Good Answers: 167
#15

Re: PWM to PWM Converter . . . But No Microprocessor

08/15/2017 2:13 PM

Never mind!

__________________
"Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." - Ayn Rand
Register to Reply Score 1 for Off Topic
Register to Reply 18 comments
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Copy to Clipboard

Users who posted comments:

Brave Sir Robin (3); Ivanov327950 (1); johnhotmer (1); Mikerho (1); Randall (1); Rixter (4); SolarEagle (1); SSCpal (6)

Previous in Forum: Powdery Substance   Next in Forum: Issues About Welding on Boats?

Advertisement