Go Down

### Topic: Curcuit on high frequency PWM(10-0V) to (5-0V) , step-up and step- down (Read 2866 times)previous topic - next topic

#### qq11011

Dear all,

I am writing to ask the electronic circuit  question based on the high frequency150khz PWM control

This is the post link that my arduino uno program discussion.
website:
http://arduino.cc/forum/index.php/topic,155700.0.html

As my project need to do the below tasks:
[1] Detect the 10V-0V pwm signal in high frequency 150kHz to arduino uno
[2] adjust the PWM duty cycle ( this is the program)
[3] generate back 0V-10V PWM new signal to MOSFET

RC filter circuit how to create?( As I am new in RC filter)What is the circuit?
PWM signal through RC filter, change to analog signal and read by arduino.

How to create back 0V to 10V PWM signal from 0V to 5V PWM output? Or what is the circuit of this?
I search that it should use op-amp to step-up the PWM signal.

But the question is will there be frequency range or limit on the op-amp which the op- amp not able to generate the perfect voltage with such high frequency?( as I also new in op-amp)

#### johnwasser

#1
##### Mar 22, 2013, 04:11 pm
Do not use op-amp.  Use NPN transistor and pull-up resistor to 10v supply.

For input you can use a voltage divider to get a 5V signal and use pulseIn() to measure pulse width directly.  Using a filter to get an analog signal and measuring the analog signal is likely to be less accurate.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### dc42

#2
##### Mar 22, 2013, 06:29 pm

For input you can use a voltage divider to get a 5V signal and use pulseIn() to measure pulse width directly.  Using a filter to get an analog signal and measuring the analog signal is likely to be less accurate.

I'm not sure I can agree. The cycle time @150kHz is only 6.7us, so if a timer or other interrupt occurs during the pulseIn call, there is likely to be a substantial error. Even without interrupts, there will be a lot of jitter because of the time taken in the pulseIn loop (20 clocks according to the comment, which is more than 1us). Also, to get an accurate result, the PWM frequency would need to be stable.

Using an R-C filter an analog input, you can get 10-bit resolution, but at the expense of response time. How fast do you need the system to respond to changes in the PWM? This mechanism is potentially sensitive to the voltage of the PWM input, but you can avoid that by passing it through a logic gate prior to the R-C filter.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### qq11011

#3
##### Mar 23, 2013, 10:17 am

Do not use op-amp.  Use NPN transistor and pull-up resistor to 10v supply.

I want to ask NPN transistor use 2n3904 is it ok?
As I connected the 10V dc supply to C-gate through 1K ohm, and PWMOUT to B-Gate, and use CRO to measure the result at C-gate.
I found out the waveform is not what I want.. is it because the parameter of resistor setting wrong?

For the task3, input PWM detection:

Using an R-C filter an analog input, you can get 10-bit resolution, but at the expense of response time. How fast do you need the system to respond to changes in the PWM? This mechanism is potentially sensitive to the voltage of the PWM input, but you can avoid that by passing it through a logic gate prior to the R-C filter.

As I need to continuous measure the PWM input and adjust it to new PWM output to MOSFET for the control of sepic converter in HID ballast, I think it is a must for the system  to continuous supply PWM output signal such that the converter able to provide power to lamp. It may still ok even there is system delay.

Once again, Thank You for all advice.=]

#### dc42

#4
##### Mar 23, 2013, 10:30 am
If you need 8-bit resolution (the default Arduino PWM output resolution), then a filter comprising a 10K series resistor and a 47nF capacitor to ground will give you a low enough ripple voltage, and only delay the response by about a millsecond.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### qq11011

#5
##### Mar 23, 2013, 01:07 pmLast Edit: Mar 23, 2013, 01:13 pm by qq11011 Reason: 1

Quote
If you need 8-bit resolution (the default Arduino PWM output resolution), then a filter comprising a 10K series resistor and a 47nF capacitor to ground will give you a low enough ripple voltage, and only delay the response by about a millsecond.

I will construct it and test it asap.

Now the question for the project are
[1] how can I get 5V PWM signal from 10V PWM before it pass through the RC filter?

[2] how can I level up the new PWM signal from 0-5V to 0-10V? ( Still not fixed)

If possible, I prefer to get both of the circuit diagram/ suggestion.

#### sparkylabs

#6
##### Mar 23, 2013, 11:30 pm
I get a really sneaky feeling that you won't get the response time you need and will need proper circuitry that does not rely on a programmed device (arduino or otherwise). I know nothing of HID's but guess it is like controlling a SMPS with a micro-controller, not usually done and a coarse result if you do. remember that the analog world does not have to care how many bits resolution it is working to, it just works to the precise point needed.

#### dc42

#7
##### Mar 24, 2013, 11:02 amLast Edit: Mar 24, 2013, 11:04 am by dc42 Reason: 1

Now the question for the project are
[1] how can I get 5V PWM signal from 10V PWM before it pass through the RC filter?

[2] how can I level up the new PWM signal from 0-5V to 0-10V? ( Still not fixed)

If possible, I prefer to get both of the circuit diagram/ suggestion.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### qq11011

#8
##### Mar 24, 2013, 08:39 pmLast Edit: Mar 24, 2013, 09:58 pm by qq11011 Reason: 1
I want to ask is the PWM output at BC337 is inverted?
(As I use similar transistor 2n3904, the output waveform inverted..)

#### dc42

#9
##### Mar 25, 2013, 09:54 am
Yes, the PWM output will be inverted. You could always use another of the inverters in the 74HC14 package to invert the PWM signal going to the base resistor, if you want non-inverted PWM. Or just do the inversion in software.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### qq11011

#10
##### Apr 09, 2013, 02:36 pm
I already constructed the circuit and it is true that the PWM signal is able to step up to 10V with the use of inverter and 2n3904.

But When I connect the Signal to the MOSFET in the Sepic converter with DC power supply, the steped up PWM signal decrease a lot with distort waveform. I think it is not able to drive the MOSFET, I want to ask why it happened.

I tried to reduce the frequency of the PWM signal, and i found that the the output of PWM signal get better but still have distortion.

How can I ensure to generate 10V PWM signal to MOSFET without distortion?

Thank You.

#### dc42

#11
##### Apr 09, 2013, 04:03 pm

How can I ensure to generate 10V PWM signal to MOSFET without distortion?

Use a mosfet driver chip, such as TC4420.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up