Re: Active Filter Design: Motor Controller Current Sensing



Larry Brasfield wrote:
"Mike" <mep0716@xxxxxxxxx> wrote in message
 news:1119380907.826986.11410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I'm using a Hall Effect sensor (ACS704ELC) to measure the motor current
through an H-bridge.  The FETs are being driven with an Intersil
HIP4081 FET driver.  I am using PWM (20k Hz)to control the motor.

The Hall Effect sensor outputs a 2.5v DC signal at 0 Amps, and 2.5v
+133mV/A as current increases.  My goal is to read the RMS motor
current using an ADC channel on my MCU.  It is clear that I have to low
pass filter the signal first, but I am not sure how to decide on the
proper cut off frequency.   Filtering the signal to a point where I can
sample/RMS it within the MCU (in a reasonable manner) is  fine.  I
understand that in order to recover all of the remaining (after
filtering) freq components, I need to sample at atleast twice the
bandwidth.  But what dictates my passband, stop band (cuttoff),
passband attenuation?


The purpose of the filter is not so much to allow recovery of
what gets thru the filter as to reject components that would
impair signal recovery, due to aliasing, without the filter.  The
stop-band rejection needed is determined by how large the
expected problematic components are and what accuracy
is to be maintained in the converted samples.  So, for example,
if you had a 16 bit converter and wanted to suppress a fullscale
signal at 0.55 Fs, (so that it does not alias as 0.45 Fs), you
would want something like 98 dB rejection at that frequency,
perhaps more depending on what you will do with the data.

As you can see, you need to know the expected magnitude
of unwanted signals at the filter input and output.

In theory. In practice, it is often easier (when other signals are unknown) to work out the cutoff frequency based on aliasing and control loop requirements, then arbitrarily choose a 1st or 2nd order filter.


A huge reduction in measured noise can be achieved by synchronising the ADC sample with the center of the PWM waveform - this means the sampling is as far from the switching edges as possible. Its trivial to do with symmetric PWM, whereby the pwm counter counts 0 to FS then back down to 0, so FS always corresponds to the centre of the pwm.



How do you figure out within what frequency
range the motor current be calculated from?


What information are you trying to extract from the current?
If your intention is to use current-mode control, then you
need to preserve content somewhat beyond the servo loop
bandwidth and watch the phase response carefully.  If you
mean only to detect stalls or overheating, a 10 Hz response
would be plenty, without any phase concerns.


IOW the phase delay added by the filter subtracts from your closed-loop phase margin. If you had, say 60 degrees phase margin (a good number) and the input filter had the same cutoff as the closed-loop bandwidth, then the phase shift at Fcl is 45 degrees, so your loop actually has 15 degrees phase margin, IOW rings like a bugger.




I am in the process of setting up a sweet FFT module on my scope which
will allow me to view the actual motor current (voltage output of hall
effect) in f-domain.

I'd appreciate any suggestions, thoughts on how I should go about
picking the proper filter parameters to meet my goal.


If you are doing current mode control, I would suggest
closing that loop in the analog realm.  Sampling delay and
filter phase response response to avoid aliasing will be a
source of much fun or frustration otherwise, unless your
loop bandwidth requirements are lax.

If you pay attention, it can work very well. with modern micros its now easy to use a simple RC filter, oversample to hell and then digitally filter/decimate.


cheers
Terry
.



Relevant Pages

  • Re: Jerry/Solid state switches
    ... >a control current and will stay 'on' with out the control current till the ... >voltage they are passing goes to zero... ... >you are using the sine wave period as a PWM time base.... ... >BTW this is abusive to a PM DC motor and after a year or so ya tend to demag ...
    (rec.crafts.metalworking)
  • Re: Jerry/Solid state switches
    ... Non-ZeroCross switchs can be use to do PWM at waht ever you AC frecquency ... a control current and will stay 'on' with out the control current till the ... voltage they are passing goes to zero... ... BTW this is abusive to a PM DC motor and after a year or so ya tend to demag ...
    (rec.crafts.metalworking)
  • Re: Powering DC geared mmotor from cordless drill.
    ... The drill motor can run at full speed ... is slow speed, you could then just punch in the two speeds, have the ... setting and forgetting your PWM ... advantage is that you have precise control of speed, ...
    (sci.electronics.basics)
  • Re: Lathe purchase advice sought
    ... These are all variations on the same lathe. ... Some of the early ones would pop the motor control MOSFETs, ... Had to put a filter on the lathe. ...
    (rec.crafts.metalworking)
  • Re: Adjusting frequency NE556
    ... The following is a PDF of a motor control kit... ... 5KHz from the PWM. ... software-oriented approach to circuit design with PICs. ...
    (sci.electronics.basics)

Quantcast