Atmel 7698AAUTO01/07 User Manual

Page of 21
Using the ATAVRAUTO200
ATAVRAUTO200 User Guide
2-7
7698A–AUTO–01/07
2.4.4
Current measurement
Motor current is measured using a shunt resistor. External differential amplifier (on
board) is connected to ADC to measure shunt resistor voltage.
Amplifer output (current image voltage) is connected to
 ADC0 pin for current acquisition
 AIN1 pin to detect max current peak (compared to AIN0 through internal analog 
comparator)
The current measurement (I) can be performed using the A/D converter. See the
ATmega48/88/168 datasheet for how to use the ADC. The input voltage value (V
ADC-0
)
is calculated with the following expression:
Analog comparator allows peak current detection. It provides interrupts on analog com-
parator output change. See the ATmega48/88/168 datasheet for how to use the Analog
comparator. Comparison voltage is determined for a 12A peak which leads to:
 V
AIN0
 = 1.5V
Figure 2-6.  Current Acquisition chain and current Peak detection
2.4.5
Speed/Position measurement inputs
A screw connector with 4 inputs can be used to plug two hall effect sensors. The two hall
effect sensors inputs are connected to the two external interrupt pins (INT0 and INT1) of
the microcontroller.
Figure 2-7.  Hall sensor effect interface
VADC-0 Gain Vshunt Gain Rshunt I
×
×
=
×
30,16
0.005
I
×
×
=
=
(
)
VADC-0 0.151 I
×
=
+Vcc
Hall1
Hall2
GND