Skip to content

RoboticsClubatUCF/ESP32-PWM-to-Stepper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-PWM-to-Stepper

Utilizes an ESP32 or Arduino to read a PWM signal and control a stepper motor.

Installation:

git clone https://github.com/RoboticsClubatUCF/ESP32-PWM-to-Stepper/

Learn how to install and use PlatformIO here. Open the folder in PlatformIO, compile, and upload the program to an Arduino or ESP32. Also, the main.cpp file could be copied into a blank Arduino project (.ino file) if you are more familiar with how to use that.

Pin Definitions:

  • Stepper Pulse: 7
  • Stepper Direction: 8
  • Potentiometer Input: 0
  • PWM input: 2

Tune these values:

  • The PWM_MIN and PWM_MAX refer to the min/max value of analogRead based on the PWM signals your flight controller sends.
  • MAX_RUDDER_ANGLE refers to how many degrees your rudder should rotate from center.
  • POTENTIOMETER_MIDDLE should be adjusted based on the calibration of your potentiometer. POTENTIOMETER_ERROR is tuned to the noise in the potentiometer reading. If the board is connected to the serial monitor, these values are printed so you can adjust them accordingly.
  • REVERSED is whether the movement of the stepper is reversed or not. If the ruder oscillates around a given point, this is likely inverted

About

Utilizes an ESP32 or Arduino to read a PWM signal and control a stepper motor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages