RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Reality Check – Raspberry Pi & DC Motor Control

Fri Oct 24, 2014 2:02 pm

After reading the material on this site, and elsewhere, I believe I have a conceptual framework to proceed with detailed planning to provide locomotion to a Raspberry Pi based robot (Pi-Bot) equipped DC motor driven wheels.

That said, I would appreciate feedback from forum members to confirm, correct, and refine the following conceptual framework to provide locomotion and skid steering control to the Pi-Bot:

RPi PWM → level shifter → L298 motor driver → DC motor
↑---------------------------------------------------------------- ↓
PID feedback <----------------------------------------< motor encoder

Based on my understanding of RPi PWM I do not believe it necessary to have a microcontroller between the RPi and the motor driver (L298).

My intent is to build-out the Bot slowly adding features, capabilities, support circuits, sensors, etc. after verifying the previous stages work properly.

With this in mind, I must take care to plan carefully for future build-out of the Pi-Bot so as not to do something in the early stages of the build-out that would require major rework to in order to meet the original design specs of the Pi-Bot.

Thank you for any feedback you may provide.

Regards,

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Reality Check – Raspberry Pi & DC Motor Control

Fri Oct 24, 2014 4:17 pm

Sounds possible, but obviously the motor must be able to be driven with a PWM signal, instead of a variable DC signal, some will some won't. The driver IC will have a diode for back EMF, but as its essentially a coil, it must be capable of working with a HF stream of DC pulses.

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

Re: Reality Check – Raspberry Pi & DC Motor Control

Fri Oct 24, 2014 4:20 pm

I personally don't use a level shifter for output to 5V inputs, I just use a current limiting resistor (2k4)

For feedback from your encoder, if the signal is 3.3v max, you can feed it directly to a Pi pin

If the encoder outputs a 5v signal, a simple voltage divider is all you need.

For software, you can use joan's pigpio library, or gordon's wiringpi
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

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: Reality Check – Raspberry Pi & DC Motor Control

Fri Oct 24, 2014 9:45 pm

mahjongg wrote: The driver IC will have a diode for back EMF, but as its essentially a coil, it must be capable of working with a HF stream of DC pulses.
mahjongg - I am not clear about the above quote. When you say "as its essentially a coil" you are referring to the motor's ability to respond to PWM not the L298N ability to deal with PWN -- correct?

I have been away from electronics for a long time; therefore, I do not always understand what good people like you are trying to tell me.

Thank you for taking the time to comment on my post.

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: Reality Check – Raspberry Pi & DC Motor Control

Sat Oct 25, 2014 12:51 pm

mikronauts wrote:I personally don't use a level shifter for output to 5V inputs, I just use a current limiting resistor (2k4)

For software, you can use joan's pigpio library, or gordon's wiringpi
mikronauts - thank you for the feedback - it is helpful. Using a current limiting resistor for outputs to 5V makes good sense - it saves both money and board space.

I checked out your website and put it in my favorites folder and look forward to repeat visits.
Russell

Return to “Automation, sensing and robotics”