Post Top Ad

Monday, July 24, 2023

on video Driving DC Motors with Microcontrollers


 You’ll see how there are actually three methods used among all of these drivers for controlling speed and direction. Because of this, it’s pretty easy to swap drivers and use a sketch for small motors to be used with much larger ones (or vice-versa).


I’ll be driving everything with a simple Arduino Uno today, but you could use any microcontroller to work with these motor drivers.


The code for all these motors is pretty simple, I’ll show it to you, and I’ll also introduce you to a few libraries that make coding for these motor drivers a breeze. We’ll also check out a motor driver library from Cytron that is a hidden gem, as it can be used with ANY of these drivers!

I write C code to control four brushed DC motors using two motor drivers (TB6612FNG) and a microcontroller (MSP430). Each motor driver requires two control inputs and one pulse-width modulation (PWM) input. I create three abstraction layers: a PWM driver at the bottom, a motor driver in the middle, and a simplified drive interface at the top. 21 videos in and something is finally moving.



 You’ll see how there are actually three methods used among all of these drivers for controlling speed and direction. Because of this, it’s pretty easy to swap drivers and use a sketch for small motors to be used with much larger ones (or vice-versa).


I’ll be driving everything with a simple Arduino Uno today, but you could use any microcontroller to work with these motor drivers.


The code for all these motors is pretty simple, I’ll show it to you, and I’ll also introduce you to a few libraries that make coding for these motor drivers a breeze. We’ll also check out a motor driver library from Cytron that is a hidden gem, as it can be used with ANY of these drivers!

I write C code to control four brushed DC motors using two motor drivers (TB6612FNG) and a microcontroller (MSP430). Each motor driver requires two control inputs and one pulse-width modulation (PWM) input. I create three abstraction layers: a PWM driver at the bottom, a motor driver in the middle, and a simplified drive interface at the top. 21 videos in and something is finally moving.


No comments:

Post a Comment

Post Top Ad

Pages