Page 1 of 1

Connect Motor controller and Raspberry PI via GPIO?

Posted: Sat Jul 21, 2012 8:03 pm
by seregus
Hi all,

I've an idea about creating a wheeled robot with webcam controlled over internet using RPI as it's main board.
At the moment I'm stacked trying to make my robot move. I've got Sabertooth 2X12 R/C connected to motors and powered up also I've go Raspberry Pi up and running, but I've no clue how to connect the cables coming out of the motor controller to the GPIO...

Any help will be really appreciated!

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Sun Jul 22, 2012 7:17 am
by IanH
I've just had a quick look at the manual, and it looks like you can control it over a serial interface ('simplified serial' or 'packetised serial' will do; you won't need the 'slave select' option if you have just one of them).

The Pi has a serial port available on the GPIO header, described in detail at:
http://elinux.org/Rpi_Low-level_peripherals

You'll need to wire the TxD pin (GPIO 14) to the controller. Now the Pi has a 3.3V output, and the controller says it needs 5V 'TTL' levels, but that's probably OK - most 5V inputs actually work perfectly well driven off 3.3V.

By default the serial port gets used as a Unix console, which will get in the way of using it for your program. Handy instructions about fixing this are at:
http://www.irrational.net/2012/04/19/us ... rial-port/

Hope that helps,
Ian

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Sun Jul 22, 2012 8:39 am
by exartemarte
IanH wrote:You'll need to wire the TxD pin (GPIO 14) to the controller.
And ground/0v on the Pi to ground/0v on the 2X12. My apologies if that was obvious.

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Mon Aug 06, 2012 10:27 pm
by seregus
Hi,

Thank you very much, it did work! Thanks a lot! Now next steps ;-)
Thanks again!

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Sun Aug 26, 2012 7:15 pm
by seregus
Well, after a while I figured out 1 PWM output of Raspberry is not an option for controlling robots.
So I continued my search and... got a very beautiful solution from Adafruit.com:
http://learn.adafruit.com/adafruit-16-c ... pberry-pi/

Size of the extra board is really small and it allows you to connect 16 motors and even organise a chain to control 992 motors (claimed by Adafruit).

After getting my own one - it didn't work straight forward, because I'm using Rasbian and I2C drivers are disabled by default, here is a good example of how to enable I2C:
http://www.skpang.co.uk/blog/archives/575

Also Anker Astro 3 battery is working perfectly to power my Raspberry and DC motors at the same time (it has 2 usb and also 9/12 switchable output)

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Sun Aug 26, 2012 7:43 pm
by joan
The Pi has no problems driving servos so if that's your only need for pwm you should be ok. For instance search for servoblaster in this forum.

For other pwm needs Gordon has produced a userland service in his wiringPi C library which may be satisfactory.

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Tue Aug 28, 2012 11:42 pm
by seregus
Well, thanks for reply, first of all.

But I didn't actually expect any answer, because it was kinda sharing an updates/upgrades I got.
So making it simple, yes, you can control a lot of DC/Servo motors using some small extensions for Raspberry, for example I'm using "Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685" as a 16 PWM output module to control 2 DC motors (movement of the robot) and 2 servo motors (moving web-cam of the robot). As a DC motor controller I selected Sabertooth as it was part of LynxMotion 4AWD robotic platform.

But instead of using cheap batteries I've bought Anker Astro 3 with 2 usb output:
1. First USB output I've soldered to add 5V power to Adafruit module
2. Second USB output is used to power up Raspberry + WebCam + WiFi dongle
3. 12V output is used to power UP DC motors.

So it's a kind of Linux based (Raspberry PI) robot controlled over Internet (my router is already setup to be accessible, through VPN, from outside world)! I'm planing to add some Gyro/Distance sensors after it's fully functional base (hope this weekend), if someone is interested, follow me up on my blog:
http://seregus.wordpress.com

Thank you very much Raspberry PI - I can walk through my home from all around the world if I have internet connection! Thank you everyone who was patience enough to answer my stupid new bee questions in robotics!

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Mon Feb 15, 2016 9:03 am
by thegoodrobot
email me at [email protected] yahoo.com
with no spaces

and i will talk to you about the project i'm working on
sabertooth 2x25 with raspberry pi b+ controlling tank over the internet

Re: Connect Motor controller and Raspberry PI via GPIO?

Posted: Wed Feb 17, 2016 2:56 pm
by BMS Doug
thegoodrobot wrote:email me at [email protected] yahoo.com
with no spaces

and i will talk to you about the project i'm working on
sabertooth 2x25 with raspberry pi b+ controlling tank over the internet
1. don't broadcast your e-mail address to the internet.

2. I imagine that the OP has either resolved his problems or given up as he originally posted in 2012.