I would recommend that you reconsider the choice of your h-bridge. The LD298 was a fine piece of electronics back in the 70's when it was designed, and it works well with the 40V power that it was designed for. For hobby uses, though, its 5V voltage drop across the motor power lines makes it a pretty bad choice, especially when you plan to power the motors with a low-voltage battery. The bridge will eat half of the power just sitting there.
Why don't you use something more modern, like DRV8833 or the TB6612 that is also used in that Adafruit shield? They are not much more expensive, and much better suited for small hobby stuff.
PCA9685 PWM Driver
Re: PCA9685 PWM Driver
Thanks for tour advice, I will look this way.
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: PCA9685 PWM Driver
Hello,
What about mixing dc motors + servos ?
It seems not possible because each kind work at different frequency. servo: 50Hz, dc_motor: 1600Hz
And it's a global property of the pca9685 class, so if I change it for servo, it will change for dc_motor and vise-versa...
Could you confirm my guess please ?
Thanks.
What about mixing dc motors + servos ?
It seems not possible because each kind work at different frequency. servo: 50Hz, dc_motor: 1600Hz
And it's a global property of the pca9685 class, so if I change it for servo, it will change for dc_motor and vise-versa...
Could you confirm my guess please ?
Thanks.
nodemcu V2 (amica)
micropython firmware Daily build 05/31/2016
micropython firmware Daily build 05/31/2016
Re: PCA9685 PWM Driver
Yes, the PWM frequency is a global property of the chip.pidou46 wrote: Could you confirm my guess please ?
Re: PCA9685 PWM Driver
@deshipu
Hi, I'm new to MicroPython and find it very confusing how to get files running in general.
I would like to control a spider robot consisting of 12 micro servos 9G. I found these pages which made me very happy!
But ... I can't get it working.
I use a Mini D1 ESP32 module (with microPython on it), connected to the pca9685: I2C-SCL to GPIO 22 and I2C SDA to GPIO 21, connected V5 and gnd. I use an external power supply (5V 2A).
I managed to upload the two files: pca9685.py and servo.py to the ESP32-module and added a main.py file with this content:
Then I added a line to the boot.py file to load main.py.
Can you please help me where I went wrong?
EDIT:
I found the problem. There was one ")" missing at the end of the line:
servos = servo.Servos(I2C(scl=Pin(22), sda=Pin(21))
Can you please add it in your example. For us newbees it's very confusing finding something that's on the internet already for quite some time and is not working properly because of a typo (?).
Hi, I'm new to MicroPython and find it very confusing how to get files running in general.
I would like to control a spider robot consisting of 12 micro servos 9G. I found these pages which made me very happy!
But ... I can't get it working.
I use a Mini D1 ESP32 module (with microPython on it), connected to the pca9685: I2C-SCL to GPIO 22 and I2C SDA to GPIO 21, connected V5 and gnd. I use an external power supply (5V 2A).
I managed to upload the two files: pca9685.py and servo.py to the ESP32-module and added a main.py file with this content:
Code: Select all
# This should move all servos to the central positions:
from machine import I2C, Pin
import servo
servos = servo.Servos(I2C(scl=Pin(22), sda=Pin(21))
for i in range(16):
servos.position(i, us=1500
)
Code: Select all
# This file is executed on every boot
import main
EDIT:
I found the problem. There was one ")" missing at the end of the line:
servos = servo.Servos(I2C(scl=Pin(22), sda=Pin(21))
Can you please add it in your example. For us newbees it's very confusing finding something that's on the internet already for quite some time and is not working properly because of a typo (?).
Re: PCA9685 PWM Driver
FYI - You don't need to do this -- main.py is always executed automatically after boot.py (regardless of what's in boot.py)
Re: PCA9685 PWM Driver
Thanks. I read that somewhere ....