0
\$\begingroup\$

I'm learning boost circuit and I'm a trying to get a 50~100v voltage output from 3~5v input and 30kHz PWM using boost circuit.

schematic

simulate this circuit – Schematic created using CircuitLab

(Using transistor as a switch and diode)

The simulation seems to work, however the real circuit only generate a 10~12v output..

12v only

Plus, I'm using arduino to generate a near 32kHz PWM Input with near 90% duty cycle. And it seems to have some problem, too.

void loop() {
    digitalWrite(9, HIGH);
    delayMicroseconds(28);
    digitalWrite(9, LOW);
    delayMicroseconds(4);
 }

(I also tried to change the built in timer and analogWrite, but it cannot generate a PWM with duty cycle greater then 50%. I've no idea about it..)

PS: I'm using this calculator to get the requirements of Inductor and Cap.

Update: I've tried a smaller inductor(470uH) with a higher PWM frequency (125kHz, using another Arduino, using build-in timer). And get only 4.5v on output...

\$\endgroup\$
  • 2
    \$\begingroup\$ Your schematic doesn't look right. How does shorting the input to ground build up energy in the inductor? \$\endgroup\$ – The Photon Jun 1 '16 at 16:53
  • 3
    \$\begingroup\$ There's no chance your boost converter can work if your schematic is actually what you built. Q1 is shorting the input voltage when it turns on. The base-collector junction of a BJT isn't suitable as a diode even if your topology was correct. Also, layout and wiring is important for a switching converter and your breadboarding with the long wires and spacing is likely to cause problems. \$\endgroup\$ – John D Jun 1 '16 at 16:53
  • \$\begingroup\$ @JohnD Thank you for answering. But I still have the problem on these things. As I learnt, the boost converter looks to short the conductor to the ground by when the switch turns on? (like this one en.wikipedia.org/wiki/Boost_converter#/media/… ) What is it supposed to be if it's wrong? \$\endgroup\$ – Yangff Jun 2 '16 at 1:50
  • \$\begingroup\$ Compare the topology of your circuit vs. the Wikipedia circuit. There is a very significant difference. \$\endgroup\$ – uint128_t Jun 2 '16 at 3:46
  • \$\begingroup\$ OH... I see... I've make an mistake when I draw the circuit... Now I updated it... \$\endgroup\$ – Yangff Jun 2 '16 at 5:53
3
\$\begingroup\$

The code:

void loop() {
    digitalWrite(9, HIGH);
    delayMicroseconds(28);
    digitalWrite(9, LOW);
    delayMicroseconds(4);
 }

Isn't going to give a very reliable duty cycle. The resolution of delayMicroseconds is 4µs, but it is going to jitter due to interrupts, for example due to the millis timer (timer1) or from I/O. The jitter may be much bigger than 4µs. The hardware timers, which generate PWM signals directly in the pins, are much more stable.

The default timer setup, used by analogWrite, on an Arduino is for either a 1kHz or 512Hz cycle (depending on the timer), with a prescaler (clock divider) of 64, or 4µs.

You will have to abandon the Arduino library, and deal with the underlying timer hardware to get any PWM frequency higher than 1kHz.

So you'll have to change the timers set up. This is explained in the ATmega manual about the ATmega48/88/168/328, called 8271.pdf downloadable from Atmel.com.

If you really want 32kHz then use a timer with a programmable upper count, or timer 1. If you use timer1, which is a 16bit timer, set the pre-scaler to 0, e.g.:

TCCR2B = (0<<CS12) | (0<<CS11) | (1<<CS10);

Then use the 'Fast PWM, 9-bit' mode, or modes which use either ICR1 or OCR1A to set the maximum count.

You can use any duty cycle by setting the appropriate output compare register OCR1A or OCR1B. At a 9bit count, the duty cycle can be changed in 1/512 increments.

\$\endgroup\$
  • \$\begingroup\$ I've tried to use built-in clock, as you writed TCCR2B = (0<<CS12) | (0<<CS11) | (1<<CS10);, and result in a most 50% duty cycle. I'll tried to use timer and generate the signal by myself.. \$\endgroup\$ – Yangff Jun 2 '16 at 1:52
  • \$\begingroup\$ @Yangff - It is extremely unlikely that all it will give is a 50% duty cycle. How are you measuring the duty cycle? It is more likely there is an error in the technique used to measure its duty cycle. Please update your question with details, and even pictures, about your duty cycle measurements. \$\endgroup\$ – gbulmer Jun 3 '16 at 1:09
  • \$\begingroup\$ I measure the voltage from the output pin, and it’s only 1v+.. \$\endgroup\$ – Yangff Jun 3 '16 at 7:55
  • \$\begingroup\$ Okay, so the voltage is +1V. However, I want to know how you are measuring the duty cycle, that is the ratio of high to low in the square wave generated by the Arduino's timer, driving the pin. You'll need to explain the device that you are measuring that voltage with. Is it a purely resistive load, or is presenting an impedance. Is it in parallel with your boost circuit? What value does it give when you use an Arduino program containing only analogWrite(pin, 255)? Put information in your question so that the community understand what you are asking without having to read all of the comments. \$\endgroup\$ – gbulmer Jun 3 '16 at 19:05
  • \$\begingroup\$ Hint: if you put an oscilloscope onto the pin, you would be able to see the duty cycle, and I guarantee that analogWrite(pin, 255) is not a 50% duty cycle. \$\endgroup\$ – gbulmer Jun 3 '16 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.