Skip to content

Arduino library for closed-loop position control of a DC motor via the L298N motor driver IC

License

Notifications You must be signed in to change notification settings

JB515/L298NPositionControl

Repository files navigation

L298NPositionControl

This (work in progress) Arduino library implements closed-loop position control of a DC motor, via the popular L298N driver chip. It makes use of Paul Stoffregen's excellent Encoder library, available here: https://github.com/PaulStoffregen/Encoder.

Hardware

The library is designed to work with any DC motor with a quadrature encoder, as long as it is driven by an L298N driver module. Motors either sold with or connected to gears are also supported.

The driver/encoder can be connected to the Arduino on any pins, provided that the L298N . For best performance, the two encoder connections, encA and encB should be connected to interrupt pins. See this page for details. If in doubt, the following wiring is used in the provided examples:

Hardware schematic used in example programs

Code

The library provides a number of example programs to demonstrate various aspects of the functionality

About

Arduino library for closed-loop position control of a DC motor via the L298N motor driver IC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages