Robot Expansion Board

From Geekworm Wiki
Jump to navigation Jump to search
New Updated Raspberry Pi Stepper Motor Servo Robot Expansion Board sku:418460
New Updated Raspberry Pi Stepper Motor Servo Robot Expansion Board sku:418460
Raspberry Pi Stepper Motor Servo Robot Expansion Board sku:418460

Raspberry Pi Stepper Motor Servo Robot Expansion Board sku:418460

Introduction

Full function Robot Expansion Board (Support Stepper / Motor / Servo) for Raspberry Pi 3 Model B / 2B / B+

Stepper motors are great for (semi-)precise control, perfect for many robot and CNC projects. This HAT supports up to 2 stepper motors. The python library works identically for bi-polar and uni-polar motors Running a stepper is a little more intricate than running a DC motor but its still very easy

Note: the motor(steering engine)voltage is 5V, the current should be around 200mA. It is suggest to use the 996, 995 series motor (steering engine).

Important Note

[New to Python and/or robotics] please refe to Alictronix/Raspi-MotorHat (Thanks information from Tom Scott)


Please read this file: File:Stepper-Motor-HAT-User-Guide1.docx carefully before ask any questions. This file included all the details, you will find all the information in this file.

File:Raspi-MotorHAT.zip

IMG 5110-SIZE.jpg

Function:

  • 4 H-Bridges:provides 1.2A per bridge (3A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 5VDC to 12VDC.
  • Up to 4 bi-directional DC motors with individual 8-bit speed selection (so, about 0.5% resolution)
  • Up to 2 stepper motors (unipolar or bipolar) with single coil, double coil, interleaved or micro-stepping.
  • Up to 4 Channel 12-bit PWM/Servo(5V)
  • OneInfrared Receiver(GPIO26)
  • Big terminal block connectors to easily hook up wires (18-26AWG) and power
  • Polarity protected 2-pin terminal block and jumper to connect external 5-12VDC power
  • Works best with Raspberry Pi model A+, B+, or Pi 2;

Voltage requirements

The first important thing to figure out what voltage the motor is going to use. If you're lucky your motor came with some sort of specifications. Some small hobby motors are only intended to run at 1.5V, but its just as common to have 6-12V motors. The motor controllers on this HAT are designed to run from 5V to 12V.

MOST 1.5-3V MOTORS WILL NOT WORK or will be damaged by 5V power

Current requirements

The second thing to figure out is how much current your motor will need. The motor driver chips that come with the kit are designed to provide up to 1.2 A per motor, with 3A peak current.

Note that once you head towards 2A you'll probably want to put a heat-sink on the motor driver, otherwise you will get thermal failure, possibly burning out the chip.

If you don't have to take your project on the go, the 9V 1A, 12V 1A, or 12V 5A will work nicely 99% of 'weird motor problems' are due to having a voltage mismatch (too low a voltage, too high a voltage) or not having a powerful enough supply! Even small DC motors can draw up to 3 Amps when they stall.

Power it up

Wire up your battery pack to the Power terminal block on the right side of the HAT. It is polarity protected but still its a good idea to check your wire polarity. Once the HAT has the correct polarity, you'll see the LED light up

Please note the HAT does not power the Raspberry Pi, and we strongly recommend having two seperate power supplies - one for the Pi and one for the motors, as motors can put a lot of noise onto a power supply and it could cause stability problems!

How to use the IR receive function

Please refer to Raspberry Pi IR Control Expansion Board

PS: Only exist IR receive function for expansion board;

About some syntax errors for Sample Code

Please enable I2C function before you start any action, please refer to How to enable I2C

OK, we relase the sample base Python 3. please refer to File:Raspi-MotorHAT-python3.zip

This is sample code is base Python 2.7;

You will get some syntax and other errors if you use the Python 3;

Some differences between python 2 and python 3: More details

python 2: print is the keyword.

python 3: print is the function; etc.

Please change some code for python 3;

such as:

print s_per_s, " sec per step"
=>
print (s_per_s)
print(" sec per step")

we will update the sample code base on python 3 soon.

Document

Packing List

  • 1 x Robot Board

FAQ

1. Does the board require the additional power supply?

The robot expansion board does not require additional power, and it is powered by the Raspberry Pi; However, external devices controlled by the expansion board, such as the steering gear, require additional power supply. please refer to the following pictures:

Robot Expansion Board Power Supply.jpg


2. Q: What is the I2C address?

A: I2C address is 0x6F

Q: How to change I2C address?

A: Only need to remove any short-circuit solder joints at A0-A3 postion to change the I2C address

How to change I2C address


3. Can you run a servo and a dc motor at the same time?

You can run a servo and a dc motor at the same time via python script.If you ignore the time that the python program runs in the while loop, then you can think of it as simultaneous

pwm.setPWMFreq(60)                        # Set frequency to 60 Hz
while (True):
  pwm.setPWM(0, 0, servoMin)
  pwm.setPWM(0, 0, servoMax)


4. Does the servo pwm commands change the signal on all outputs? You can run a servo and a dc motor at the same time via python script.If you ignore the time that the python program runs in the while loop, then you can think of it as simultaneous

pwm.setPWMFreq(60)                        # Set frequency to 60 Hz
while (True):
  pwm.setPWM(0, 0, servoMin)
  pwm.setPWM(0, 0, servoMax)

5.How to work on channels #1 #14 #15 because the servotest.py is working on channel #0 by default ?

Please refer to the below picture:

How to use channel.png

6. Does the Stepper Motor Hat v0.2 capable of controlling stepper motors with 6 or 8 lead wires instead of just 4 lead wires?

No, the Stepper Motor Hat v0.2 can only support 4 lead wires or 5 lead wires, do not support 6 or 8 lead wires.

Add your comment
Geekworm Wiki welcomes all comments. If you do not want to be anonymous, register or log in. It is free.


Anonymous user #13

47 months ago
Score 0++
Hi, is it possible to run a 12v stepper motor at the same time as a 6v servo? Or would the servo be 'killed' if I supply 12v to the board?

Anonymous user #12

51 months ago
Score 0++
Would this work on a 12 Volt battery charged by a solar panel ? My charger goes up to 14 Volts .....

Anonymous user #11

53 months ago
Score 0++
Hi, does this hat work with the circuitpython motorkit library that superseded the Adafruit-Motor-HAT-python library?

Jinyk

56 months ago
Score 0++
There's no documentation here about the sensor pins. I was finally able to figure it out myself. How does one contribute to this wiki? I would like to contribute documentation and code on how to hook up a ultrasonic sensor to the sensor pins.

Kawsar

52 months ago
Score 0++

hi Jinyk , Hope my message fins you in good health . Could you please share the file for sensor with me . i would be really appreciate it .

kawsarfarooq@yahoo.com

CaptStephan

50 months ago
Score 0++
Can you share how you figured this out in a reply or maybe share a link to a git or something? I am working on this now, trying to add an ultrasonic sensor and wanting to know if I can use these points for that - Thanks, Stephan

Anonymous user #10

61 months ago
Score 0++
so im trying to run a servo motor and 2 DC motors on a single python script but im only able to get the servo motor to move. i looked at the FAQ section addressing this question but am still confused at to what you mean by the answer. could you elaborate a bit more about how to run a servo motor and a DC motor at the same time? thank you.

Anonymous user #9

63 months ago
Score 0++
getting module errors when trying to the test python code for dc motors. almost like the libraries are not being called on in python3??

Anonymous user #8

63 months ago
Score 0++
Is it possible to get the battery level of the external power supply?

Anonymous user #14

37 months ago
Score 0++
Yes. However you would need either analog to digital converter with a voltage module. I’m yet to build one myself, I have the parts but in theory that’s how I see it working on the pi. Hope helps you in anyway. :)

Anonymous user #7

69 months ago
Score 0++

Can i use an i2c LCD display with the hat ? I tried i2cdetect -y 1 to detect the address but the pi didnt list it .

Is it because the hat is communicating with default pi i2c and another i2c device cannot be connected to the hat ?

Admin

69 months ago
Score 0++

Hi,

Sorry, actually it is a DIY project, we can not know much about it, so sorry about the inconvenience.

Anonymous user #7

69 months ago
Score 0++
Is it possible to get a schematics of the GPIO pins ??

Admin

69 months ago
Score 0++

Hi,

Sorry, we do not have the schematics of the GPIO pins, but the raspberry pi wil take the full GPIO pin of the motor hat, please note.

Anonymous user #7

69 months ago
Score 0++

Can i use a Lidar with the hat ? Lidar uses UART protocol . And if so do i have to initialise the i2c address of board on lidar script because lidar is a slave circuit on it own communicating with the hat which communicates with the pi .

Is it possible to get a sample uart python code for the hat ? Is it possible to provide a GUI for the DC motor control .

Admin

69 months ago
Score 0++

Hello,

Sorry, we do not test it. So we can not show more details, hope to get your understanding!

Anonymous user #6

70 months ago
Score 0++
I am working on servo motor PWM channels and I didn't how to work on channels #1 #14 #15 because the servotest.py is working on channel #0 by default

Admin

70 months ago
Score 0++

Hello sir,

We get your email, please see our reply with the email,thanks!

Anonymous user #5

70 months ago
Score 0++
Is there a way to stack two of the Motor HAT in order to be able to drive 4 stepper motors ?

Admin

70 months ago
Score 0++

Hello dear friend,

You can modify the I2C address by shortcut the A0~A3 on the board (shortcut A0 and A1, shortcut A1 and A2...), thus you can get the different I2C address. But we do not test or try this, hope to get your understanding!

Anonymous user #4

72 months ago
Score 0++
can you run a servo and a dc motor at the same time? or do the servo pwm commands change the signal on all outputs?

Admin

72 months ago
Score 0++

Hello, We have updated your questions to our wiki FAQ above, please check the details, thanks very much! Best regards,

Cindy/Geekworm

Anonymous user #2

73 months ago
Score 0++
Has anyone been able to test PWM servo motor on this boards? I tried the ServoTest.py in Raspi-MotorHAT.zip but it not seem working.

Admin

73 months ago
Score 0++

Hello sir, It has been tested no problem, as the steering engine voltage is 5V, the current should be around 200mA. We suggest that you can change the 996, 995 series steering engine to have a try. Thank you! Best regards,

Cindy/Geekworm

Anonymous user #3

73 months ago
Score 0++
Hello, I am also having the same problem. I am running ServoTest.py and it sits there. Servos do nothing.

Anonymous user #1

74 months ago
Score 0++
In Step 3 it looks like the directory name is wrong. Check via ls command and cd to correct directory to complete instructions.

Admin

73 months ago
Score 0++

Hi, Sorry, we can not confirm your problem. If you still have problem, it is better to contact us by email: support@geekworm.com. Best regards,

Geekworm