0

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.

Sherby
  • 2,316
  • 6
  • 27
  • 44
  • 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)`. – AndrejaKo Sep 14 '13 at 20:16
  • I am sorry. I meant 0-12V PWM. – Sherby Sep 14 '13 at 20:24
  • What does subtracting have to do with PWM? What you're asking doesn't make any sense. – Matt Young Sep 14 '13 at 20:34
  • 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. – Sherby Sep 14 '13 at 20:38
  • 2
    Perhaps you could clarify this with a schematic :) (Ctrl-M in the editor) –  Sep 14 '13 at 21:40

2 Answers2

1

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.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • Wonderful! Is it possible, to do a subtraction with hardware? Can an Op Amp Do it? – Sherby Sep 14 '13 at 23:44
  • 1
    @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. – Andy aka Sep 14 '13 at 23:53
0

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.

Matt Young
  • 13,734
  • 5
  • 34
  • 61