User manual
Hardware
© 2009 Microchip Technology Inc. DS70610A-page 19
3.1.2 Current Sensing
Two shunt resistors are available for current sensing, one for each of the two motor
windings. In order to read both positive and negative currents, the amplifier circuit is
designed with an offset of V
REF = AVDD/2. The amplifier gain allows for a maximum
current range of ±2.2A.
To calculate the amplifier gain, use the formula provided in Equation 3-1:
EQUATION 3-1: AMPLIFIER GAIN CALCULATION FORMULA
The formula shown in Equation 3-1 is a simplified version of the complete formula and
is only valid when R
28
= R
29
= R
33
= R
34
and R
27
= R
35
. If changes to the amplifier gain
are needed, use the above formula to calculate R
27
corresponding to the desired gain,
and then replace both R
27
and R
35
with the calculated resistor value. Make the same
changes for R
39
and R
45
.
The DC voltage supplied to the power stage is measured with a simple resistor divider.
To calculate the DC_REF signal used for this purpose use the formula provided in
Equation 3-2:
EQUATION 3-2: DC_REF SIGNAL CALCULATION FORMULA
This measurement is needed in the PI loop calculation and for algorithms such as
automatic motor induction and resistance identification.
3.1.3 Fault Protection
The dsPICDEM MCSM Development Board features an overcurrent fault detection,
which triggers a PWM shutdown. Each phase current is amplified and then compared
with a fixed “safe” current value. A value of 1.7A is set for the dsPICDEM MCSM
Development Board; however, the user can change this limit by changing the resistor
divider made by R48 and R51. When either of the two phase currents is above the
“safe” current level, a Fault signal is triggered and the dsPIC DSC hardware module
automatically switches off all PWM outputs.
The Fault LED (D15) is active only when an overcurrent is present in the motor
windings. It will go inactive immediately after the internal dsPIC Fault circuit shuts down
the PWM pins. In this case, the LED will not be visible as the on-time is very short. The
Fault LED will only be visible if the Fault is persistent, that is when the software fault
shutdown is disabled.
For details about the PWM module Fault feature, please refer to Section 14. “Motor
Control PWM” (DS70187) in the “dsPIC33F Family Reference Manual”.
Gain R
SHUNT
R
27
R
28
R
29
+
-----------------------
⋅=
Note: The default gain value is 0.75 V/A, allowing a resolution of 67 µA/bit with
a 10-bit ADC.
DC_REF
1
28
----- -
DC_BUS=
WARNING
If the Fault LED is permanently active, power off the board immediately to avoid
damage to the power Mosfets.