Skip to content

BTS7960AD is an Arduino library for controlling a linear actuator using a BTS7960 motor driver module

License

Notifications You must be signed in to change notification settings

digitalbirth/BTS7960AD

Repository files navigation


Logo

BTS7960 Linear Actuator Driver

Control for potentiometer feedback linear actuator
Designed and tested using STM32 Black Pill Built for Arduino.

Explore the docs »
Report Bug · Request Feature . Donate



How to use

Define object

BTS7960AD actuator(R_EN, R_PWM, R_IS, L_EN, L_PWM, L_IS, sensor, strokeLength, debug);

Pin out for BTS7960

  1. RPWM Forward Level or PWM signal, Active High
  2. LPWM Reverse Level or PWM signal, Active High
  3. R_EN Forward Drive Enable Input, Active High/ Low Disable
  4. L_EN Reverse Drive Enable Input, Active High/Low Disable
  5. R_IS Forward Drive, Side current alarm output
  6. L_IS Reverse Drive, Side current alarm output
  7. Vcc +5V Power Supply micro-controller
  8. Gnd Ground Power Supply micro-controller

Methods in set up

actuator.init(); Resets actuator id's in EEPROM. (important)

actuator.begin(); Sets up actuator pins defined in object and EEPROM memory positions.

actuator.enable(true); Enable driver pins R_EN and L_EN bringing them high. (May have issues - connected EN pins to the +ve rail so always on)

actuator.calibrate(127); Fully extends and retracts to record min max potentiometer values.

On initial start the calibrate function will test to see if there are values saved in EEPROM, if not it will fully extend and retract and record the min max values of the potentiometer and save to EEPROM as these can differ from the min max values due to gearing, when the board is re-powered, the values can be pulled from EEPROM saving loading time.

actuator.recalibrate(127); The actuators can be recalibrated by calling method, this is called from a button press in the example sketch.

(back to top)

Methods in loop

Direction

Action Direction
Extend 1
Stop 0
Retract -1

Speed

input value between 0-255

Methods

actuator.controlActuator(1, 127); Direction and speed

actuator.actuateByDistance(25, 1, 50); Distance mm, direction and speed

(back to top)

Roadmap

  • Add Calibration for multiple actuators - Test
  • Synchronized motor movement function
  • Add position memory
    • Digital read buttons for memory positions

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contact

A simple star to this project repo is enough to keep me motivated on this project for days. If you find your self very much excited with this project let me know.

Follow Digital Birth on LinkedIn Follow Digital Birth on Instagram

Dean Bateman

Project Link: https://github.com/digitalbirth/BTS7960AD

(back to top)

Coded by

    ____  _       _ __        __   ____  _      __  __
   / __ \(_)___ _(_) /_____ _/ /  / __ )(_)____/ /_/ /_    
  / / / / / __ `/ / __/ __ `/ /  / __  / / ___/ __/ __ \   
 / /_/ / / /_/ / / /_/ /_/ / /  / /_/ / / /  / /_/ / / /  
/_____/_/\__, /_/\__/\__,_/_/  /_____/_/_/   \__/_/ /_/ 
        /____/    
    ------------ BRINGING YOUR IDEAS TO LIFE ------------                                      

About

BTS7960AD is an Arduino library for controlling a linear actuator using a BTS7960 motor driver module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages