nosamttam
Posts: 5
Joined: Mon Oct 31, 2016 10:31 pm

DC Motor Control Wiring

Mon Oct 31, 2016 10:35 pm

I've got the ASEPP MTD-1 DC motor Controller, and a tank track with 3 connectors (2 wires to each connector) - 1 battery, 1 to each motor.
the batter is 9 volts. What I am really struggling with is the wiring and trying to figure out what wires go where. I can do the coding, but not the wiring. I have a breakout T and a breadboard connected.

Using Raspberry Pi Model 3b.

Can anyone help?

Thanks!
Matt

pcmanbob
Posts: 9771
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: DC Motor Control Wiring

Tue Nov 01, 2016 11:44 am

Hi.

If you can provide a link to were you purchased the motor control board from or better still any data sheets I may be able to help, I did try searching for your broad but could only find one for an Arduino.
failing that post some good quality pictures of board and wiring.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

nosamttam
Posts: 5
Joined: Mon Oct 31, 2016 10:31 pm

Re: DC Motor Control Wiring

Tue Nov 01, 2016 2:09 pm

Here is the DC Motor Controller:
http://www.mcmelectronics.com/product/O ... -/83-16560
Image

Here is the tank part:
https://www.sinoning.com/damping-balanc ... .html.html
three wire groups of two. two from the motors, one from the battery pack which totals 9V.

Thanks for your help!

pcmanbob
Posts: 9771
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: DC Motor Control Wiring

Tue Nov 01, 2016 3:40 pm

So from info supplied from web site
connections are these
Image

now this translates to these places on board.
Image
black arrows show were to connect motors just connect any way round and then once you have them running you can change the connection round if a motor is running the wrong way.
your battery and its ground will connect on the connector shown by the yellow arrow but as I cant see the markings for this connector I cant say which terminals to connect to, but you will need to connect battery ground to GND terminal and your battery to 12v terminal.
now the web site does say its 100% compatible with Arduino which means its 5v logic so it may or may not work with Pi connected directly.

hope this helps
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

BMS Doug
Posts: 3823
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: DC Motor Control Wiring

Tue Nov 01, 2016 4:15 pm

That's a standard L298 motor controller board.

Motor and power connections as described by pcmanbob

Link the enables to the 5v directly above them.

Link In1 - In4 to 4 gpio pins.

Test operation by enabing 1 pin at a time.
Doug.
Building Management Systems Engineer.

nosamttam
Posts: 5
Joined: Mon Oct 31, 2016 10:31 pm

Re: DC Motor Control Wiring

Sun Nov 06, 2016 4:51 am

Guys -
Thanks for all your wiring tips. After much troubleshooting, I found that there were some cold solder joints on the batter pack, which I fixed and the unit lit up when I turned on the power. Yay.

Now, I did tap each of the 4 enables on the VCC and each motor went a different direction based on which enable. So check, the DC Motor controller works.

However, I have tried now to control when each motor fires with GPIO. As there are 4 Enables I connected to GPIO pins 12,16, 23, and 24, respectively.

I've tried a couple of different routines, and nothing seems to fire the enables.

Here is what I've tried:

Code: Select all

import RPi.GPIO as GPIO
from time import sleep
 
GPIO.setmode(GPIO.BOARD)
 
Motor1A = 16
Motor1B = 23

 
GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
 
print "Turning motor on"
GPIO.output(Motor1A,GPIO.HIGH)
GPIO.output(Motor1B,GPIO.LOW)
 
sleep(2)
 
print "Stopping motor"
GPIO.cleanup()
Does this look like it should start? Any coding suggestions would be greatly appreciated!

Thanks again!

User avatar
joan
Posts: 14998
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: DC Motor Control Wiring

Sun Nov 06, 2016 11:24 am

The quickest way to find out what is wrong is to post a photo of the connections between the Pi and the motor driver board.

Major Tom
Posts: 65
Joined: Wed Feb 03, 2016 8:13 am
Location: Strung up in heavens high.

Re: DC Motor Control Wiring

Sun Nov 06, 2016 11:35 am

Do you have a ground connection from the Pi to the motor driver?
My circuit's dead, there's something wrong.

nosamttam
Posts: 5
Joined: Mon Oct 31, 2016 10:31 pm

Re: DC Motor Control Wiring

Tue Dec 06, 2016 8:41 pm

Got everything working. Thanks for your help!

User avatar
mikronauts
Posts: 2803
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: DC Motor Control Wiring

Tue Dec 06, 2016 11:04 pm

Correction.

There are two enables, and four direction pins.

Some boards come with the enables tied to 5V, in which case you control the motors with a pair of IN pins each.

So basically:

if ENA/ENB are tied to 5V

send PWM to either IN1 OR IN2, with the other set to 0 in order to go in the two different directions

ditto for IN3 / IN4

Personally, I prefer the three wire control mode for each motor:

Use PWM on ENA for motor 1 speed control
Use IN1/IN2 to set the direction

ditto for ENB & IN3/IN4
nosamttam wrote:Guys -
Thanks for all your wiring tips. After much troubleshooting, I found that there were some cold solder joints on the batter pack, which I fixed and the unit lit up when I turned on the power. Yay.

Now, I did tap each of the 4 enables on the VCC and each motor went a different direction based on which enable. So check, the DC Motor controller works.

However, I have tried now to control when each motor fires with GPIO. As there are 4 Enables I connected to GPIO pins 12,16, 23, and 24, respectively.

I've tried a couple of different routines, and nothing seems to fire the enables.

Here is what I've tried:

Code: Select all

import RPi.GPIO as GPIO
from time import sleep
 
GPIO.setmode(GPIO.BOARD)
 
Motor1A = 16
Motor1B = 23

 
GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
 
print "Turning motor on"
GPIO.output(Motor1A,GPIO.HIGH)
GPIO.output(Motor1B,GPIO.LOW)
 
sleep(2)
 
print "Stopping motor"
GPIO.cleanup()
Does this look like it should start? Any coding suggestions would be greatly appreciated!

Thanks again!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “Automation, sensing and robotics”