

set the duty cycle around 128 to send a square wave. In order to avoid this you can use hardware PWM on the arduino. It keeps the arduino busy in the main loop. The code given in the example is rather inefficient. The freq of the pulses determines the speed of the motor. Each pulse you send moves the motor 1 step. Stepper drives seems like use PFM (Pulse freq modulation). Gift the gift of Make: Magazine this holiday season! Subscribe to the premier DIY magazine todayĬommunity access, print, and digital Magazine, and more Share a cool tool or product with the community.įind a special something for the makers in your life. Skill builder, project tutorials, and more Get hands-on with kits, books, and more from the Maker Shed Initiatives for the next generation of makers.

With the controller wire disconnected, my button presses show pin 11 going from HIGH (4.9v), to LOW (0v) as coded. When DIR- (DIR+ is VCC - 5V) on the contoller is tied to the Arduino, I can't get it to pull ground/LOW. The DIR pin is at around 3.8 volt and will cause the motor to reverse if I short it to ground. The diargram with the controller shows the control pins on it are going to an opto-isolator.


I have pin 11 (PORTBP3) set as an input (default, no PinMode). Mostly working ok, stepping fine, but having a bit of a prob controlling the Direction pin on the driver box. I am controlling an ST-M5040 stepper motor driver with an Arduino Pro Mini.
