If switches 1 and 4 are closed (the center picture), current flows through the motor from left to right,
and the motor spins forward. Closing switches 2 and 3 causes the current to reverse direction and the
motor to spin backward. An H-bridge can be constructed with mechanical switches, but most robots,
including the 3pi, use transistors to switch the current electronically. The H-bridges for both motors
on the 3pi are all built into a single motor driver chip, the TB6612FNG, and output ports of the main
microcontroller operate the switches through this chip. Here is a table showing how output ports PD5
and PD6 on the microcontroller control the transistors of motor M1:
PD5
PD6
1
2
3
4
M1
0
0
off
off
off
off
off (coast)
0
1
off
on
on
off
forward
1
0
on
off
off
on
reverse
1
1
off
off
on
on
off (brake)
Motor M2 is controlled through the same logic by ports PD3 and PB3:
PD3
PB3
1
2
3
4
M2
0
0
off
off
off
off
off (coast)
0
1
off
on
on
off
forward
1
0
on
off
off
on
reverse
1
1
off
off
on
on
off (brake)
Pololu 3pi Robot User’s Guide
© 2001–2019 Pololu Corporation
5. How Your 3pi Works
Page 18 of 85
Содержание 0J5840
Страница 24: ...Pololu 3pi Robot User s Guide 2001 2019 Pololu Corporation 5 How Your 3pi Works Page 24 of 85...
Страница 67: ...Source code Pololu 3pi Robot User s Guide 2001 2019 Pololu Corporation 10 Expansion Information Page 67 of 85...
Страница 77: ...Source code Pololu 3pi Robot User s Guide 2001 2019 Pololu Corporation 10 Expansion Information Page 77 of 85...