Difference between revisions of "NanoHat Motor"
From FriendlyELEC WiKi
(→Introduction) |
(→特性) |
||
Line 9: | Line 9: | ||
* The NanoHat Motor has the same form factor as the NanoPi NEO and can be stacked on a NanoPi NEO. | * The NanoHat Motor has the same form factor as the NanoPi NEO and can be stacked on a NanoPi NEO. | ||
− | == | + | ==Hardware Spec== |
− | * | + | *Input Voltage: 12V |
− | * | + | *Capable of driving four 5V PWM steering motors |
− | * | + | *Capable of driving four 12V DC motors |
− | * | + | *Capable of driving two 12V four-wire step motors |
− | * | + | *Onboard 32K EEPROM |
− | * | + | *Stackable and Configurable I2C address |
[[File:NanoHat Motor_PCB.png | frameless|400px|NanoHat Motor-PCB]] | [[File:NanoHat Motor_PCB.png | frameless|400px|NanoHat Motor-PCB]] |
Revision as of 09:55, 20 April 2017
Contents
1 Introduction
- The NanoHat Motor is a motor module with I2C. It uses NXP’s PCA9685 and Toshiba’s TB6612FNG.
- A single module can drive four 5V PWM steering motors and four 12V DC motors or four 5V PWM steering motors and two 12V four-wire step motors. You can drive more motors by stacking multiple modules with different I2C addresses together.
- It uses TI's TPS54331 device to provide stable power source.
- An onboard 32K EEPROM AT24C32D can save user data,
- The NanoHat Motor has the same form factor as the NanoPi NEO and can be stacked on a NanoPi NEO.
2 Hardware Spec
- Input Voltage: 12V
- Capable of driving four 5V PWM steering motors
- Capable of driving four 12V DC motors
- Capable of driving two 12V four-wire step motors
- Onboard 32K EEPROM
- Stackable and Configurable I2C address
2.1 接口布局
- 24Pin引脚功能定义
Pin# Name Pin# Name 1 SYS_3.3V 2 VDD_5V OUT 3 I2C_SDA 4 VDD_5V OUT 5 I2C_SCL 6 GND 7 NC 8 NC 9 GND 10 NC 11 NC 12 NC 13 NC 14 GND 15 NC 16 NC 17 SYS_3.3V 18 NC 19 NC 20 GND 21 NC 22 NC 23 NC 24 NC
12Pin排针未使用,引脚功能定义在此不列举,请在NanoPi NEO/Air/NEO2维基页面查阅。
NanoPi NEO
NanoPi NEO Air
- 2Pin电源端子定义
Pin# Name Description 1 12V 12V电源输入 2 GND 地
- 4Pin PWM 舵机端子定义
Pin# Name Description 1 PWM* PWM*输出 2 NC 空 3 5V 5V电源输出 4 GND 地
- 电机端子定义
Name Description M1 直流电机1输出 或 步进电机1(1,2线)输出 M2 直流电机2输出 或 步进电机1(3,4线)输出 M3 直流电机3输出 或 步进电机2(1,2线)输出 M4 直流电机4输出 或 步进电机2(3,4线)输出
3 硬件连接
3.1 连接NanoPi NEO
NanoHat Motor模块和NanoPi NEO尺寸和接口完全相同,可直接堆叠在NanoPi NEO上使用。
参考下图连接模块:
NanoHat Motor_nanopi_NEO2
可通过配置电阻更改模块的I2C从地址,从而堆叠使用多个模块以驱动更多的电机,参考下图连接模块:
4 运行测试程序
NanoHat Motor的测试程序包含在 NanoHAT-Motor-Python-Library 软件仓库里。
NanoHAT-Motor-Python-Library是一个Python类库,为舵机、直流电机和步进电机提供了非常便利的编程接口,提供单个和多个电机的高精度控制。
当前支持的开发板:
NanoPi NEO
NanoPi Fire
其他开发板只能带有 I2C 接口,通过适当配置也能支持。
4.1 安装NanoHAT-Motor-Python-Library
通过ssh,或者串口终端进入开发板的命令行,执行以下命令安装:
sudo apt-get install python-dev python-smbus git cd ~ git clone https://github.com/friendlyarm/NanoHAT-Motor-Python-Library cd NanoHAT-Motor-Python-Library python setup.py install
4.2 NanoHAT-Motor-Python-Library的基本使用
4.2.1 操作直流电机
cd ~/NanoHAT-Motor-Python-Library/examples python DCTest.py <motor port>
其中,<motor port>为电机连接的端口。
4.2.2 操作步进马达
cd ~/NanoHAT-Motor-Python-Library/examples python StepperTest.py <motor port>
其中,<motor port>为马达连接的端口。
4.2.3 操作舵机
cd ~/NanoHAT-Motor-Python-Library/examples python ServoTest.py <pwm port>
其中,<pwm port>为舵机连接的端口。
5 相关资料
- [Schematic](Schematic - NanoHat Motor.pdf)
- [Datasheet](PCA9685 datasheet)
- [Datasheet](TB6612FNG datasheet)