Connecting a stepper motor to digital output

Hello
I was wondering if it would be possible to connect a stepper motor to the digital output so that it can be controlled with the I / O signals. The intention is that the motor always takes the same number of steps in the same direction.

At the moment, the stepper motor is controlled by an arduino that is not (yet) connected to the cobot.

First of all you would need to find a stepper driver handling 24V signal inputs, or have some level-shifting as the typical arduino stepper drivers like stepsticks handle 5v signal only for step/dir pulses. Then it should be easy to implement a naive “set DI0 HIGH, sleep, set DI LOW, sleep” for N number of steps forward or backward. Downside is you wont have any acceleration managment so depending on application it might be very crude or unusable results. Implementing acceleration management might be pretty complex to do since you’ll hit strict timing issues.

To be able to handle that motion planning aspect we are approaching this by developing an Arduino-based device handling stepper drivers like stepsticks with the Accelstepper library and we control them from the UR controller over Modbus TCP. So we can send commands over Modbus to the Arduino for a specific position and then we can handle it on the Arduino side with acceleration planning etc as you are currently doing, and nothing needs to be computed on the UR side, simply send the target position.

In term of hardware it means you only need an Ethernet module for your Arduino to talk between the UR and the Arduino, and there is a Modbus library for Arduino.

why dont take the Input from arduino and use the analog outputs of the robot to make the movements?

Hi, I accidentally stumbled upon this post and realized that you might have a solution to my problem

via ModbusTCP I developed communication with arduino for motor control, but it happened to me that everything works normally for about 50 cycles and then the communication is lost for the following reasons (the answer I received from a forum member):
part of one of my posts:
Problem with Modbus TCP / IP communication between URCap and Arduino (a library on Arduino that enables ModbusTCP over Ethernet). Communication is established and the code works for some time say 50 cycles of repetition and then it happens to stop:
and answer:
It should be noted that MODBUS/TCP has strict timing deadlines, e.g. requires clients to respond within a max of 100msec to any information exchange. Failing to do so is treated as an error and the connection will be shut down by the server, as per standard.
Make sure your client can meet this deadline (typically 10Hz or 100msec) or this behaviour will occur

how did you solve this problem and did it happen at all?
Best regards,

Hello, if you use a stepper motor that supports Modbus TCP, then you can connect it directly to the UR robot. For example, Festo has stepper motors that can be controlled over Modbus TCP.

Here is a link to a HOW-TO-VIDEO explaining how to control a Festo servomotor with a UR robot.

1 Like