Motor Driver HAT User Manual - Robotshop

3y ago
21 Views
2 Downloads
523.24 KB
16 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Ciara Libby
Transcription

Motor Driver HATMotor Driver HATUser ManualOVERVIEThis module is a motor driver board for Raspberry Pi. Use I2C interface, could be usedfor Robot applications.FEATURES Compatible with Raspberry Pi I2C interface. Slave address hardware configurable makes your pi able to connect32 motors at the same time Integrate PCA9685, supports 12bits PWM output Integrate TB6612FNG, high performance Integrate 5V regulator, output current up to 3A. Pins out I2C interface, could connect to other development board Come with sample codes and user manual1 / 16

Motor Driver HATSPECIFICATIONSOperating voltage:6V 12V (VIN port)Logic voltage:3.3VPWM controller:PCA9685Interface:I2CMotor controller:TBA6612FNGDimension:65mm x 30mmHoles size:3.0mmINTERFACES2 / 16

Motor Driver HATPINDescription5V5V3V33.3VGNDGroundSDAI2C DataSCLI2C ClockVINDriver voltage for motor(6-12V)A1positive pole of motor AA2negative pole of motor AB1positive pole of motor BB2negative pole of motor B3 / 16

Motor Driver HATHARDWARESThe module includes three part in hardware: Power, PWM and Motor driverPOWERMP1854 regulator is used to convert the input voltage (VIN USER), has wide 4.5V to28V input range, could provide 3A output. Even the chip supports 28V input, however,VIN USER is also the power supply for motor, so the actual working voltage of thismodule is 6-12V.MP1854 outputs stable 5V, which is used to power Raspberry Pi, and supplies 3.3Vlogic level for PWM and motor driver via RT9193-33.4 / 16

Motor Driver HATPWMRaspberry Pi only has one hardware PWM pin (GPIO.1), and the software PWM ofWiringPi and Python will cost CPU resources. This module, we use PCA9685, I2C buscontrolled, support 16-channel 12-bits PWM output. The frequency range of PWM is40Hz to 1000Hz.It is very simply to use, to output PWM signal you only need to control correspondingregisters value of chip.Refer the recommend circuit, LED0-LED5 are motor control pins.From Page6 to Page8 of datasheet:5 / 16

Motor Driver HATThe slave address of I2C bus is 7-bits, highest is fixed 1. A5-A0 are hardwareselectable.This Motor Driver HAT, A5 is connected to ground (0) by default, you can changeresistors of A0-A4 to configure the slave address. If you weld a resistor or short it,means 1, otherwise 0. The address range from 0x40 to 0x5F.For example:1. A5 is 0, A0-A4 are disconnected (don’t weld), so they are 0 as well. The final I2Cslave address is 0x402. Welding 0Ω resistors to A0-A4 or shorting them, the final I2C slave address is0x5F. You can use i2cdetect tool to detect i2C devices on Raspberry Pi as below:execute command: i2cdetect -y 16 / 16

Motor Driver HATMOTOR DRIVERTB6612FNG is a driver IC for DC motor with high performance.VIN USER is input voltage, in theory, motor speed up if this voltage is increased.Recommend input voltage is 6 12VPWMA and PWMB control speed of motors, AIN1 and AIN2, BIN1 and BIN2 controlrotate direction of motors.A1 and A2, B1 and B2 are connect to positive/negative poles of two motors separately.7 / 16

Motor Driver HATHOW TO USEENABLE I2C INTERFACETo works with Raspberry Pi, you should first enable I2C interface as below:sudo raspi-configThen choose Interfacing Options - I2C - Yes8 / 16

Motor Driver HAT【Note】If you get errors information after running demo code, please modify themodules file as below:sudo nano /etc/mdoulesAppend these statements to the end and save:i2c-devi2c-bcm2708DOWNLOAD DEMO CODEDemo code can be downloaded from Wiki: https://www.waveshare.com/wiki/Motor Driver HATExtract on your PC and copy to Raspberry PiLIBRARIES INSTALLATIONBefore running the demo code, you should install necessary libraries (WiringPi,BCM2835 and python). About how to install libraries, you can refer to this page: Libraries Installation for RPi9 / 16

Motor Driver HATCODE ANALYSISWe provide three demo codes for Raspberry Pi, which are based on BCM2835,WiringPi and python libraries separately.BCM2835PROJECT DIRECTORY AND FILES/bin:.o files generated by makefileMakefile: makefile is used to tell the compiler how to compile your project/code.motor: executable file, which you can execute to run the code/Obj: workspace of projectDebug.h: heard files of debug function, you can use DEBUG() to print debuginformation like printf() by change USE DEBUG to 110 / 16

Motor Driver HATDEV Config.c(h): Defines PINS used and communication type, different betweenBCM2835 and WiringPi.PCA9685.c(h): Drive code of PCA9685 chip. Could output 16-channel PWM signalvia I2C interfaceMotorDriver.c(.h): Drive code of TB6612FNG chip, control two motors.main.c: main functionDEMO CODES1. initialize BCM2835 librariesif(DEV ModuleInit())exit(0);2. Initialize motor and PCA9685Motor Init();3. Control motorsMotor Run(MOTORA, FORWARD, 100);Parameter 1: MOTORA or MOTORBParameter 2: FORWARD or BACKWARDParameter 3: 0 100If you use this module to control robot, with this function you can control thewhole motion of robot.11 / 16

Motor Driver HATThis project has Exception Handling. Generally, motor keeps moving even you stopproject. value of control register doesn’t be clean even you use CTRL c to stop code.signal(SIGINT, Handler);single is signal handling function of linux system. SIGINT signal generates whenCTRL c is executed to stop process, then Handler() function will run. In this function,motors are stoppedMotor Stop(MOTORA);Motor Stop(MOTORB);DEV ModuleExit();exit(0);USINGDemo code you download has no executable file moto, you need to run make togenerate it then execute command ./motor to run the demo code.If you modify or add any functions, you need to run make again to updateIf you change values of heard files, command make clear is also need before make.12 / 16

Motor Driver HATWIRINGPIPROJECT DIRECTORY AND FILESThe files on WiringPi project directory are similar to BCM2835. Their only differenceare:DEV Config.c(h): functions called are differentMakefile: linker is different.USINGDemo code you download has no executable file moto, you need to run make togenerate it then execute command ./motor to run the demo code.If you modify or add any functions, you need to run make again to updateIf you change values of heard files, command make clear is also need before make.13 / 16

Motor Driver HATPYTHONPROJECT DIRECTORY AND FILESPCA9685.py is driver code, use I2C interface to output 16-channle PWM signals.mian.py: Motor driver codeDEMO CODE1. Instantiate PCA9685 librarypwm PCA9685(0x40, debug True)Parameter 1: slave address of PCA9685, hardware configurableParameter 2: enable/disable debug informationpwm.setPWMFreq(50)Set PWM frequency in range 40 10002. Initialize motorsclass MotorDriver():def init (self):self.PWMA 0self.AIN1 1self.AIN2 214 / 16

Motor Driver HATself.PWMB 5self.BIN1 3self.BIN2 4Motor MotorDriver()Output PWM to channel 0 53. Control PWMpwm.setDutycycle(self.PWMA, speed)Parameter 1: output channelParameter 2: Duty ratio, range 0 1004. Control levelpwm.setLevel(self.AIN1, 1)Parameter 1: output channelParameter 2: level, 1 is high and 0 is low5. Control motorMotor.MotorRun(0, 'forward', 0)Parameter 1: 0 and 1, stands for two motor separatelyParameter 2: forward and backwardParameter 3: integers in 0 100, control speed15 / 16

Motor Driver HATMOREYou can also control it via Bluetooth or WiFi. About how to use you can refer to ServoDriver HAT:https://www.waveshare.com/w/upload/1/1b/Servo Driver HAT User Manual EN.pdf16 / 16

Motor Driver HAT 4 / 16 HARDWARES The module includes three part in hardware: Power, PWM and Motor driver POWER MP1854 regulator is used to convert the input voltage (VIN_USER), has wide 4.5V to 28V input range, could provide 3A output. Even the chip supports 28V input, however,

Related Documents:

Red Hat Enterprise Linux 6 Security Guide A Guide to Securing Red Hat Enterprise Linux Mirek Jahoda Red Hat Customer Content Services mjahoda@redhat.com Robert Krátký Red Hat Customer Content Services Martin Prpič Red Hat Customer Content Services Tomáš Čapek Red Hat Customer Content Services Stephen Wadeley Red Hat Customer Content Services Yoana Ruseva Red Hat Customer Content Services .

As 20 melhores certificações e cursos do Red Hat Linux Red Hat Certified System Administrator (RHCSA) Engenheiro Certificado Red Hat (RHCE) Red Hat Certified Enterprise Application Developer Red Hat Certified Architect (RHCA) Engenheiro certificado pela Red Hat no Red Hat OpenStack. Administração do Red Hat Enterprise Linux (EL) Desenvolvedor de microsserviços corporativos com .

Red Hat Enterprise Linux 7 - IBM Power System PPC64LE (Little Endian) Red Hat Enterprise Linux 7 for IBM Power LE Supplementary (RPMs) Red Hat Enterprise Linux 7 for IBM Power LE Optional (RPMs) Red Hat Enterprise Linux 7 for IBM Power LE (RPMs) RHN Tools for Red Hat Enterprise Linux 7 for IBM Power LE (RPMs) Patch for Red Hat Enterprise Linux - User's Guide 1 - Overview 4 .

configuration and administration of Red Hat Enterprise Linux 5. For more information about Red Hat Cluster Suite for Red Hat Enterprise Linux 5, refer to the following resources: Configuring and Managing a Red Hat Cluster — Provides information about installing, configuring and managing Red Hat Cluster components.

Red Hat System Administration I RH124 · 5 days · Recommended Red Hat Certified System Administration exam EX200 · 2.5 hours · Required Red Hat System Administration II RH134 · 4 days · Recommended Red Hat Certified System Administrator Required for Red Hat Certified Engineer Red Hat System

6.1.1. red hat enterprise linux 8 6.1.2. red hat enterprise linux add-ons 12 6.1.3. red hat enterprise linux for power 18 6.1.4. red hat enterprise linux for z systems 22 6.1.5. red hat enterprise linux for z systems extended life cycle support add-on 24 6.1.6. red hat enterprise linux for ibm system z and linuxone with comprehensive add-ons 25 .

SAP Leonardo Innovation System 3rd Party SAP S/4 HANA Cloud SAP ABAP 28 Where SAP & Red Hat Architecture Intersects Red Hat API Management Red Hat Enterprise Linux underpinning SaaS offerings Red Hat lead OS projects Kubernetes, kNative, Istio Red Hat Enterprise Linux e.g. SAP HANA Red Hat CCSP

Build with Red Hat playbook. Table of contents. About this playbook. Page 3 The importance of hybrid cloud. Page 4 Red Hat Partner Connect for a hybrid world. Page 5 About Red Hat Partner Connect. Page 6 Why choose Red Hat Partner Connect. Page 7 Build with Red Hat at a glance. Page 9 What build with Red hat does for you. Page 10