Serial. I am using ST-M5045 Microstep Drivers with NEMA23 Stepper Motors in my mill. A short version of my code that shows how to control speed and direction of one motor with a JoyStick is included at the bottom of this post. const int flatline = 10000000 // forced low or zero logic value for testing The 'FrequencyTimer2::setPeriod(iPulseTime) ' is a very simple way to set the Stepper Motor speed without any jitter.
500 likely max speed // Full wave in 700 mircosconds Here is the code: // ARDUINO DUE Conrol of 2x ST-M5045 Stepper Motor ControllersĬonst int interval = 700 // Pulse inteval. Could anyone help point us in the right direction? Current concerns are internal pull-up resistors (logic switch), pulse inversion, or the switch itself using 3.3 volts as high. The current code that we have allows the steppers to rotate CCW when we press down on our switch but nothing for the up direction. Stepper Motors: ( STEPPERONLINE CNC Stepper Motor Nema 23)Ĭontrollers: ( SainSmart CNC Micro-Stepping Stepper Motor Driver) We are using the following:ĭPDT Switch: ( Baomain Momentary 6 Pin DPDT Button On/Off/On Rocker Switch AC 250V/10A 125V/15A) Our goal is literally to just drive two stepper motors up and down on the switch command. I am a complete noob when it comes to anything Arduino and i'm working with a buddy to get our program working.