Control Stepper Motor Using Edp Stepper Component - Visuino

About the project

In this tutorial we are going to control a stepper motor Nema 17 by using a 3rd Party EDP stepper component in Visuino.

Project info

Difficulty: Moderate

Platforms: ArduinoDigilentSparkFunVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Jumper wires (generic) Jumper wires (generic) x 1
Digilent 60W PCIe 12V 5A Power Supply Digilent 60W PCIe 12V 5A Power Supply x 1
Arduino UNO Arduino UNO x 1
SparkFun Stepper motor driver board A4988 SparkFun Stepper motor driver board A4988 x 1
Stepper Motor, Power Step Stepper Motor, Power Step x 1

Software apps and online services

Visuino Visuino
Arduino IDE Arduino IDE

Story

The EDP stepper component was created by Jim Ryan, you can read more about this component on his Patreon pagewhere you can also support his work.

Step 1: What You Will Need

  • Arduino UNO (Or any other Arduino)
  • Stepper motor NEMA 17
  • A4988 Stepper Motor Driver or (DRV8825)
  • DRV8825/A4988 Stepper Driver Expansion Module
  • Jumper wires
  • Power Supply 12V
  • Visuino software: Download here
  • Install Stepper Ramp EDP component Download here

Step 2: The Circuit

  • Arduino Digital Pin 2 will be used for Steps
  • Arduino Digital Pin 3 will be used for Motor Direction
  • Optional - Arduino Digital Pin 4 will can used for driver pin Enable

If using a Stepper Motor Driver Shield:

  • Connect Motor Shield GND pin to Arduino negative pin [GND]
  • Connect Motor Shield [5V] pin to Arduino positive pin [5V]
  • Connect Motor Shield GND pin to Power Supply negative pin [GND]
  • Connect Motor Shield [9V] pin to Power Supply positive pin [+]
  • Connect Motor Shield pin[S] to Arduino digital pin [2]
  • Connect Motor Shield pin[D] to Arduino digital pin [3]
  • Connect stepper motor as shown on the picture.

If using a Stepper Motor Driver 8825:

  • Connect DRV8825 GND pin to Arduino negative pin [GND]
  • Connect DRV8825 DIR pin to Arduino digital pin [3]
  • Connect DRV8825 STEP pin to Arduino digital pin [2]
  • Connect Power Supply for the motor to DRV8825 VMOT and GND
  • Connect Capacitor across VMOT and GND
  • Connect stepper motor as shown on the picture.

Note: If you plan to use Pin for Enable, then connect it to Arduino digital pin [4] or any other free digital pin

Step 3: Start Visuino, and Select the Arduino UNO Board Type

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

Step 4: In Visuino Add Components

  • Add "Stepper Ramp EDP" component
  • Add 3X "Integer Value" component

Step 5: In Visuino Set Components

  • Select "IntegerValue1" and in the properties window under "Value" set the Speed of the motor in our case we will use 1000
  • Select "IntegerValue2" and in the properties window under "Value" set the Acceleration Speed & Deceleration Speed of the motor so called Ramp Up and Ramp Down where you set how many steps it should Accelerate and Deaccelerate, in our case we will use 1000

Note that if you do not want to use the Ramp Up or Ramp down of the stepper motor then just don't use this step

  • Select "IntegerValue3" and in the properties window under "Value" set the amount of steps, in our case we will use 8000

Step 6: In Visuino Connect Components

  • Connect "IntegerValue1" pin [Out] to "StepperRampEDP1" pin [Frequency]
  • If you plan to use Ramp Up & Ramp Down then Connect "IntegerValue2" pin [Out] to "StepperRampEDP1" pin [Ramp Steps]
  • Connect "IntegerValue3" pin [Out] to "StepperRampEDP1" pin [Total Steps]
  • Connect "Start1" to "StepperRampEDP1" pin [Start]
  • Connect "StepperRampEDP1" pin [Ena] to Arduino digital pin [4]
  • Connect "StepperRampEDP1" pin [Dir] to Arduino digital pin [3]
  • Connect "StepperRampEDP1" pin [Pul] to Arduino digital pin [2]

Step 7: Generate, Compile, and Upload the Code

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 8: To Use Return Type (Dir)

To return the motor position to the start after it finishes the steps, we can select "StepperRampEDP1" and set "Return Type (Dir)" to true, this means that when it finishes the steps if you start it again by sending the clock pulse to the "Start" pin it will reverse and do the same amount of steps backward.

To test this we are going to add the "Sequence" component, in the properties window set "Repeat" to True, double click on the "Sequence1" and in the "Elements" window drag 2X "Period" to the left side, for the first period in the properties window set "Interval" to 1000, this meant that it will be activated after 1s, for the second period set in the properties window "Interval" to 10000, this meant that it will be activated after 10s.

  • Close the "Elements" window
  • Connect pins [Out] of both Periods to the "StepperRampEDP1" pin [start]
  • Connect "Start1" pin [Out] to "Sequence1" pin [start]

Step 9: Play

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu

Schematics, diagrams and documents

Visuino File

Visuino File

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...