DPRG
DPRG List  



[DPRG] Driving an H-Bridge with a switching power supply

Subject: [DPRG] Driving an H-Bridge with a switching power supply
From: Kipton Moravec kip at kdream.com
Date: Fri Dec 26 23:44:01 CST 2003

No.

That is what the PID calculation does for you.  It adjusts the voltage 
(PWM) to get the speed you want.  The math is already in the PID 
calculation. No new stuff.

Kip


At 11:24 PM 12/26/03, you wrote:
>Normally, I'd agree with Kip as that was what I pretty much was doing
>already. Except the math is getting way too complicated. You have to
>dynamically measure the voltage peak and drops, and the current
>comsumption, and then change the PWM duty cycle proportionately to
>compensate. Using a regulator pretty much eliminates that whole process.
>If I was to regulate 24v down to 12v for a 12v motor for example, I
>could actually run 100% duty cycle until the voltage dropped below what
>the regulator could effectively handle, without having to really watch
>the battery voltage much at all. Without a regulator, I have to run less
>than 100% duty cycle to allow the system to compensate for the batteries
>running down.
>Thus 24v at 50% duty cycle would still be 50% duty cycle at 23v or 22v
>or 21v or 20v, et cetera. Thus the whole math compensation thing is
>greatly simplified. I don't have to force 52.17% duty cycle at 23v then,
>or 55.73% at 22v, etc. Which does help keep the "KISS" principal going
>nicely.
>
>
>
>-----Original Message-----
>From: dprglist-admin at dprg.org [mailto:dprglist-admin at dprg.org] On Behalf
>Of Kipton Moravec
>Sent: Friday, December 26, 2003 6:55 PM
>To: Rick J. Bickle
>Cc: DPRG List
>Subject: RE: [DPRG] Driving an H-Bridge with a switching power supply
>
>No. Something is wrong in the control loop.
>
>For example, lets say you have a 24V battery.
>
>When you are running PWM a 50% duty cycle gives an average voltage of
>12V.
>
>If the battery drops to 23V (slowly over time) it now takes the PWM with
>
>about a 52.17% duty cycle to give the motor the same 12V.
>
>This is not a big deal when you have a lot of voltage above what you
>need
>(This is what I call head room).  If you are running PWM at 95% duty
>cycle
>at 24V if the voltage drops to 23V the PWM needs a duty cycle of about
>99.13%.
>
>If the voltage drops to 22V you do not have the voltage at a PWM duty
>cycle
>at 100% to make it work.
>
>The alternative was to use a switching power supply.  A cheap buck
>switcher
>needs at least 2-3 volts above the desired voltage.  So if you want 24V
>out, you need 27V (or more) in.  Well if you are going to boost your
>batteries to 27V for a switcher,  You can do the same by boosting the
>voltage for the PWM with no switcher.
>
>You have two choices.  1. Make it work at a lower speed (or voltage). 2
>Increase the voltage in.
>
>Since we have already talked about raising the voltage, lets look at
>lowering the maximum speed.
>
>How much do you want to allow the voltage to sag before the robot no
>longer
>works? That is the voltage you tune it for, and limit it to that maximum
>speed.
>
>Back to our 24V battery.  Lets say I want it to work if the battery is
>20V.   I still want a little head room (to deal with differences in your
>
>two motors), so I tune it to work at 18V. That means the maximum speed I
>
>can go corresponds to 18V being applied to the motors.  (Work out the
>ticks
>of the encoder with that voltage) With a fresh 24V battery, that makes
>the
>PWM have a 75% duty cycle.  That is typically the maximum PWM at that
>voltage. But if the battery drops to 20V now you have a PWM duty cycle
>of
>90% to still provide the 18V.
>
>I hope I am making myself clear.
>
>Kip
>
>At 06:14 PM 12/26/03, you wrote:
> >Kip,
> >
> >Even though you have a feedback control system capable of compensating
> >for the lower voltage, wouldn't the response of the control system
>still
> >be reduced with a lower supply voltage? Take the example of David
> >Anderson's balancing bot - if with a full battery charge the controller
> >is capable of providing more power/time to the motors, it can then more
> >quickly compensate for deviations. With a lower battery voltage
>however,
> >the same power transfer requires more time, making the response more
> >sluggish.
> >
> >Rick
> >
> >-----Original Message-----
> >From: dprglist-admin at dprg.org [mailto:dprglist-admin at dprg.org] On
>Behalf
> >Of Kipton Moravec
> >Sent: Friday, December 26, 2003 2:33 PM
> >To: dprglist at dprg.org
> >Subject: RE: [DPRG] Driving an H-Bridge with a switching power supply
> >
> >
> >I disagree with everybody.  :)
> >
> >I do not think a regulator on the input power to the robot is the
> >correct
> >answer.
> >
> >There is something wrong with your control loop if it can not
>compensate
> >
> >for a battery slowly dropping voltage.  Of course if the battery drops
> >enough then the system will not work with or without a regulator.
> >
> >What you need with a regulator is more head room, so you end up
> >increasing
> >the voltage of the battery pack so you can add a regulator.  If that
> >fixes
> >the problem, then just add more battery voltage without the regulator.
> >The
> >regulator is nothing more than another control loop.  They should be
> >able
> >to be combined.
> >
> >I really think the problem is that the control loop is too slow.  I
> >would
> >recommend going from 25 Hz to 100 Hz or more.  When I talked to some
> >control people they said they do PID for motors at 1000 Hz.
> >
> >Kip
> >
> >
> >_______________________________________________
> >DPRGlist mailing list
> >DPRGlist at dprg.org http://nimon.ncc.com/mailman/listinfo/dprglist
>
>
>_______________________________________________
>DPRGlist mailing list
>DPRGlist at dprg.org
>http://nimon.ncc.com/mailman/listinfo/dprglist
>
>
>_______________________________________________
>DPRGlist mailing list
>DPRGlist at dprg.org
>http://nimon.ncc.com/mailman/listinfo/dprglist



More information about the DPRG mailing list