Partially working DC motor ramp circuit - still have questions

Discussion in 'The Projects Forum' started by summersab, Mar 26, 2016.

  1. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    Alright, so I've been trying to figure this out for awhile, and I believe I've made headway. I have a small motor (6VDC, 3A) that I want to ramp from off to full power in roughly 30 seconds. I finally understand what a PWM does conceptually. Originally, I was using a circuit by AnalogKid from the following thread:
    http://forum.allaboutcircuits.com/threads/simple-dc-motor-ramp-up-circuit.112540/ (thread)
    http://forum.allaboutcircuits.com/attachments/rampdriver-gif.87260/ (actual circuit image)

    With a few tweaks, I was able to build it in an online SPICE simulator:
    http://goo.gl/LnyXGA (click reset to start the simulator)

    However, when I built it, the circuit doesn't hold the output voltage - the motor ramps up, drops off (but doesn't shut off), ramps up, drops off, etc. Did I do something wrong? I understand that this is how a PWM behaves, but the simulation shows a linear ramp-up output. Why is it pulsing when I actually breadboard it?

    After SIGNIFICANT searching and learning, I found an op amp integrator circuit that is supposed to do exactly what I want: ramp up and hold the voltage:
    http://www.edn.com/design/analog/4314544/Integrator-ramps-up-down-holds-output-level (article)
    http://m.eet.com/media/1126960/12071-figure.pdf (actual circuit image)

    Once again, I built this in the SPICE simulator, and I added a PNP transistor that I would use to drive the motor:
    http://goo.gl/fJd6yj

    However, I noticed a few things (and please forgive my sincere ignorance of electronics). First, the PNP's output starts at 5V and then ramps up to 15V. Why doesn't it start at 0V? Second, where is the 15V coming from in the first place since I started with 5V? I mean, I get the fact that these are operational amplifiers, but I assumed that the output would go from 0-5V. What did I do wrong?

    Ideally, I'd like to figure out how to make the first circuit work properly - it's simpler, smaller, and I'm not so grand at electronics. If that circuit won't do what I'd like, I'd like to understand where I'm going wrong with the second circuit before I sit down to build it.

    Thanks for whatever help you can give!
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    Sorry, it's a little much to make sense of it all. Just concentrate on the final circuit you have.

    The op amps in the last simulation apparently are operating from 15V (it's not shown in the simulation) so their maximum output is 15V.
    Note that the PNP must have a resistor in series with the base to limit the base current. The resistor value should give a base current of about 10% of the maximum collector current.

    If you want to do serious simulations I suggest you download a free copy of LTspice from Linear Technology, which many on these forums use. It's a proper Spice simulator and will give more accurate characterization of the circuit operation before you build it, since it uses models of actual devices rather than idealized ones.
    It has a somewhat steep learning curve, but it's worth the effort. There's a tutorial and many sample circuits to help you get started.
     
  3. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    That makes sense. I figured out that the supply values of the op amps can be edited in this simulator by double clicking them. When I changed the values in the final circuit, I get the expected 5V.

    I thought that this might explain the fact that the first circuit doesn't behave in the simulator the way it does in reality, but after changing the supply voltages, it still works just the same. Any ideas why it does this (i.e. ramping and holding in the simulator vs ramping and dropping in reality)?

    I would use LTSpice, but I'm on Linux at the moment (rebuilding my system), so I wanted to find something easy and web-based. This seemed fairly decent for something small.
     
    Last edited: Mar 27, 2016
  4. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    Yes, the ideal simulator op amp has no voltage or current input offsets.
    The real op amp does.
    Put those offsets in the simulator and you will see a similar drop in the hold output voltage.
     
  5. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    Alright, I'm going to go with the second circuit since it's basically designed to do what I'm wanting. Sure, it's more complex, but it came from a reputable source, at least. I'm thinking I'll use a basic LM324 to make it work unless you have a better suggestion. I know that some op amps are designed to not require as many resistors, so if there's something that might simplify this design, I'd definitely appreciate the information.
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    The LM324 is a single-supply amp but not rail-rail (the input and output can only go to within a couple volts or so of the supply voltage) so if you don't need the output to go to the supply rail, the LM324 should work.
    Otherwise you need a rail-rail device, such as the LMC6484 used in your referenced circuit.
     
    summersab likes this.
  7. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    That makes sense. I tweaked my diagram a bit, and I have two more questions:
    http://goo.gl/ETW2xS

    First, it looks like that top op amp isn't necessary. From the documentation, it is just the frequency output, and if I remove it, the circuit behaves the same. Is that correct?

    Second, my power source for this circuit is a 7.4 Li-ion battery pack (now reflected in the diagram). However, if I remove the ground, the circuit doesn't work right. Is this because the op amps in the circuit are ideal and don't let me select a supply/ground? I'm assuming that's the case.

    Thanks a LOT!
     
  8. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    Yes, the top right op amp is not needed if you don't want a PWM output. But the op amp is part of a quad package so leaving it out does not change the number of circuit parts.

    Simulators require a ground connection to work as all voltages are calculated with reference to that point.
    Why do you want to remove it?
     
  9. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    With regard to my question about removing the ground, I just wanted to make sure that the circuit would work properly in reality when I'm just using a battery. I figured that it would, but I've had a number of "surprises" with this project, so I thought I'd ask.

    Wait... that second op amp on the bottom left - it drove the PWM output. Is it actually necessary?
    ^^Scratch that - I read the article, and it spells out what this op amp does and the fact that the aforementioned PWM op amp can be left as a spare.

    I appreciate your help!
     
    Last edited: Mar 28, 2016
  10. SLK001

    Well-Known Member

    Nov 29, 2011
    813
    225
    The problem with the ramp circuit to power up a motor is that at low ramp levels, the current is also low, so your output torque will be very low. A motor may not even start rotating until a certain torque level is reached. With a PWM circuit, the current is high on low PPS, so your torque will be in the normal range. PWM control of DC motors has been the "go-to" method for over 40 years.

    And why aren't you posting any schematics? Your "...that second op amp on the bottom left..." has no contextual meaning.
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    I disagree with that.
    At normal PWM frequencies in the kHz region, the motor current is basically DC, with perhaps a small amount of ripple, since the PWM pulses are smoothed by the motor inductance and it's the current, not the instantaneous voltage, that determines motor torque.
    So I don't see a significant difference between a linear ramp and a PWM ramp as far as the start-up speed of the motor.
    PWM is used instead of a linear ramp because it more efficient and doesn't dissipate a significant amount of power in the control transistors as a linear control would.
     
  12. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,521
    2,369
    The torque (current) depends on the voltage difference between the applied and motor generated voltage and the armature resistance.
    The higher the load, the higher the difference.
    Max.
     
  13. SLK001

    Well-Known Member

    Nov 29, 2011
    813
    225
    E=IR Mr. crutschow, E=IR. With a PWM control, voltage is either on MAX, or off. With the voltage at maximum, the current will also be at max. With a ramp, at low ramp voltages, the current is also low, so your torque will suck.
     
  14. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    I'm well aware of E=IR Mr. SLK001. :rolleyes:
    And are you aware V = L di/dt (or di = V/L dt) which shows the effect the inductance of the motor has on the current due to the high frequency PWM voltage?
    The inductance prevents the current from following the voltage. Instead you get the average value of the current, with perhaps a small amount of ripple, similar to the way you get an average DC current through the inductor in a switching regulator circuit.
     
  15. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    SKL001, my schematics are in the links. The goo.gl links are to an online SPICE simulator (not as precise as LTSpice, but it works for a novice like me).

    Headroom and SK001, are you suggesting I do something different? What I'm trying to do is ramp up a small vibrating motor from 0-7.4V in about 30 seconds instead of having it come on at full power. I'm alright with the fact that the motor may not have enough torque to spin for the first few seconds - in a way, that's what I would like to have happen. The only things that concern me from your comments are 1) efficiency and 2) whether or not the motor will reach peak torque. This will be powered by Li-ion batteries, so I'd like to get the most juice out of them as possible. Also, I'd like to have it hit full power at the end of the ramp (which I believe this circuit will accomplish).

    Thanks for the comments - I'm glad to have a few eyes looking at this.
     
  16. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,521
    2,369
    I would think using a PWM method with a minimum of 5khz switching frequency and than ramp this up, although 30sec for that small a motor is high, unless you do not need it faster.
    What is the kind of load? measure the current with full voltage applied, this will give some indication of torque required.
    Max.
     
  17. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    The motor is roughly 6V @ 3A (I say roughly because I have a 12V motor that runs at 5A, but it was too strong, so I ordered a motor that is listed as 6V. I don't expect 7.4V to hurt it, but that's why I ordered two).

    So, what are you suggesting I do instead of this circuit that we've been discussing? From the description, it does exactly what I'm after (and includes a PWM from what I understand):
    http://www.edn.com/design/analog/4314544/Integrator-ramps-up-down-holds-output-level

    Here is the circuit I built in the SPICE simulator:
    http://goo.gl/ETW2xS

    To reiterate, all I want to do is take that motor from off to full in roughly 30 seconds. It's fine if it doesn't start for the first few seconds - I expect that to be the case.
     
  18. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,521
    2,369
    7.4 volts will be fine, in fact when using PWM, most recommendations are for at least 10% above motor rated voltage.
    I see you do have a PWM circuit already, did you measure the current with the batteries connected direct with the required load applied?
    Max.
     
  19. summersab

    Thread Starter Active Member

    Apr 8, 2010
    132
    0
    I measured the current of the 12V motor by hooking it up to an old bench-top DC voltage supply I have, setting it to 12V, and toggling to the current setting to get a reading (I didn't want to blow out fuses on my little multimeter). It came in at 5A. I don't have the 6V motor yet, but I'm assuming it will pull about 2.5A, so I padded that number up to 3A just to be safe.
     
  20. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,521
    2,369
    Is it connected to your application as that must be under a load of some kind?
    Is that the current stated on the motor?
    Max.
     
Loading...