0
\$\begingroup\$

I was wondering what would you get on subtracting a 12V (From 0 to 12V) PWM (50% duty cycle), from a 12V constant DC source?

I am sorry, english is not my first language. I mean that if from an arduino or a comparator, we connect the output pwm to a motor, and other side of the motor to a 12V source, then what kind of voltage drop can we expect across the resistor.

\$\endgroup\$
5
  • \$\begingroup\$ What exactly do you mean by 12 PWM (50% duty cycle)? If the peak-to-peak voltage 12 V or is the effective voltage 12 V? Either way, you'll get a square wave, but how exactly it will look like depends on the waveform of that 12 PWM (50% duty cycle). \$\endgroup\$
    – AndrejaKo
    Sep 14, 2013 at 20:16
  • \$\begingroup\$ I am sorry. I meant 0-12V PWM. \$\endgroup\$
    – Sherby
    Sep 14, 2013 at 20:24
  • \$\begingroup\$ What does subtracting have to do with PWM? What you're asking doesn't make any sense. \$\endgroup\$
    – Matt Young
    Sep 14, 2013 at 20:34
  • \$\begingroup\$ I am sorry, english is not my first language. I mean that if from an arduino or a comparator, we connect the output pwm to a motor, and other side of the motor to a 12V source, then what kind of voltage drop can we expect across the resistor. \$\endgroup\$
    – Sherby
    Sep 14, 2013 at 20:38
  • 2
    \$\begingroup\$ Perhaps you could clarify this with a schematic :) (Ctrl-M in the editor) \$\endgroup\$
    – user17592
    Sep 14, 2013 at 21:40

2 Answers 2

1
\$\begingroup\$

I was wondering what would you get on subtracting a 12V (From 0 to 12V) PWM (50% duty cycle), from a 12V constant DC source?

Well half the time you'd get 0V (12V - 12V = 0V) and the rest of the time you'd get 12V (12V - 0V = 12V).

In fact what the subtraction does is invert the squarewave about a mean level of 6V but, because it has a 50% duty cycle it looks exactly the same.

If instead you had a 30% duty cycle (12V 30% of the time) you'd end up with a waveform that has 12V 70% of the time.

\$\endgroup\$
2
  • \$\begingroup\$ Wonderful! Is it possible, to do a subtraction with hardware? Can an Op Amp Do it? \$\endgroup\$
    – Sherby
    Sep 14, 2013 at 23:44
  • 1
    \$\begingroup\$ @Sherby yes an op-amp can do this but choose a fast op-amp (to preserve good fast edges of the waveform) and remember you can't drive a motor directly from 99.9% of op-amps - it needs a power amp to do this or power transistors. \$\endgroup\$
    – Andy aka
    Sep 14, 2013 at 23:53
0
\$\begingroup\$

First, if you're going to drive a 12V motor with an Arduino PWM pin, you need to do something like this.

schematic

simulate this circuit – Schematic created using CircuitLab

The voltage across the motor will be 0V at 0% duty cyle, 12V at 100%, and 6V at 50%. That relationship is about as close to linear as the real world gets.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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