Pages: [1]   Go Down
Author Topic: Curcuit on high frequency PWM(10-0V) to (5-0V) , step-up and step- down  (Read 1324 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

in the tasks[1]
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.

in the task[3]
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)
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank You for advice.

According to your advice,use NPN transistor nad pull up resistor,
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.=]
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank You for advice.

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.



« Last Edit: March 23, 2013, 07:13:29 am by qq11011 » Logged

Northants - UK
Offline Offline
Sr. Member
****
Karma: 1
Posts: 258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* Scan 154.JPG (65.13 KB, 1653x1165 - viewed 49 times.)
« Last Edit: March 24, 2013, 05:04:44 am by dc42 » Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to ask is the PWM output at BC337 is inverted?
(As I use similar transistor 2n3904, the output waveform inverted..)


« Last Edit: March 24, 2013, 03:58:24 pm by qq11011 » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Use a mosfet driver chip, such as TC4420.
Logged

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.

Pages: [1]   Go Up
Jump to: