Robotics StackExchange | Archived questions

Rover: raspberry pi3+L298 h-bridge and i2cpwm library

Hi! I've found a source code where the wheels of a rover are commanded with an Adafruit PCA9685 16-Channel Servo Driver. The library used is i2cpwm by Bradan Lane. Is it possible to use the same library connecting 2 DC motors to the L298 h-bridge? Or does anyone know to guide the rover with this hardware and ROS? Thanks a lot

Asked by v.leto on 2019-08-24 14:01:48 UTC

Comments

Answers

You could use the pca9685 to Controller the enable Inputs and other io for select the a and b. Und Drive you Rover.

Or use one for MCP23017 for the io.

Other cheap solution is a something linke this http://s.click.aliexpress.com/e/EIOLVWva

as you rover has only 2 motors you could connect the pins to both pwm pins you do not use andy audio

it ist the bmc 12 and bmc13

see the positon from here https://pinout.xyz/pinout/pin33_gpio13#

Asked by duck-development on 2019-08-28 15:58:50 UTC

Comments

Excuse me, but I haven't understood anything.... my hardware is composeded by a L298 h-bridge and 2 DC motors.

Asked by v.leto on 2019-08-29 02:35:13 UTC

It is not possible to use this library because the PCA9685 is an i2c to pwm chip.

If you like to drive with the full speed then you can use gpios of the pi. If you like to control the speed then you need at least a two channel pwm source. Something like the adafruit you said in you post.

Asked by duck-development on 2019-08-29 10:46:17 UTC

Ok thanks. I don'have the adafruit anyway, just the H-bridge. :(

Asked by v.leto on 2019-08-29 14:13:34 UTC

Then you can use this library https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/

And generate pwm with the pi gpios

Asked by duck-development on 2019-08-30 01:33:20 UTC

yeah, but I have to use ROS too.

Asked by v.leto on 2019-08-30 04:44:39 UTC

Yes. You can usually use ROS and other python libraries at the same time.

Asked by ahendrix on 2019-08-30 16:38:50 UTC

I know, but I have to write the code to do this............the i2cpwm library is ready to be used with ROS but unfortunately I can't use it because of the different hardware...

Asked by v.leto on 2019-08-31 04:22:13 UTC

Hello We had problems in controlling the 2 dc motor. You can find the solution in the our reporstory on Github. https://github.com/bekirbostanci/ROS_Arduino_PID_DC_Motors

Asked by bekirbostanci on 2019-12-04 12:49:57 UTC

Comments

Could you please update your answer with a copy and paste of the solution? If your repository were to disappear, then your answer will become less than useful. Also, it's difficult to find the solution by searching in a repository with many directories and files.

Asked by jayess on 2019-12-05 21:12:40 UTC

Solution is not very short so that I published github link. I am developing this reporstory and ı will write a readme file how to use this repo. Re-share the file link below

https://github.com/bekirbostanci/ROS_Arduino_PID_DC_Motors/blob/ROS_Arduino_PID_Motors/PID_Motors/PID_Motors.ino

Asked by bekirbostanci on 2019-12-06 00:18:57 UTC