Hi all,
I am fixing an old delay line and I did manage to make it work using an L298N driver and Arduino.
This is the stepper motor of the delay line: QSH4218-51-10-049 .
These are the specifications of the delay line (see attached picture, M-531.2S)
However I know it is not working at optimal conditions because the speed is very slow and according to specifications, it should run much faster.
Since I am not an engineer I am not really an expert with these tools.. however, I believe that the problem might be that I would need to supply more Voltage perhaps current to the driver.
At the moment the power is coming only from the USB connection with the laptop (around 5V), but probably that's not enough.
Can someone please help me?
I also would like to switch to the A4988 big easy driver, even if I should rewrite part of the Arduino code because I was told that the L298N driver is pretty obsolete.
Would the power connection in this case be different? I don't think so, but I might be wrong.
I am asking because I was trying to supply some more voltage to Arduino and I did manage the card...
Hello Eldorado_am
good day.
Have you checked the Arduino page: Stepper
Your motor has 4 wiring I think, means it is a bipolar once.
The main job of a stepper motor is not to run very fast. The main job is to run to some exact positions.
The increasing of the voltage supply will not speed up. You need to clock the stepper motor faster, then he will "step" faster.
Please also google for "Arduino NEMO 17". You will find some examples and more details on how a stepper motor will work.
BR Mascho
You cannot power that stepper with USB - you need an extra PSU with more power.
That's definitely a good idea. The DRV8825 is similar but can provide a bit more amps and more microsteps. I would switch to the DRV8825.
The L298 is a ancient driver with much voltage/power loss and not a suitable stepper driver.
Proivde at least 12V to the driver - more is better ( within the limits of the driver of course ). The PSU should be a >=20W type.
hi mascho11,
The thing is that the motor is working and precise and doing what I ask for.
My problem is not to control or move the stepper motor as I wish, but that probably it is not running as it should be in full operation mode (according to the specifics).
Mainly, the thing is that it is moving slower and that I cannot get the 6400 steps/rev (even if this is not superessential to me).
Thanks for the very helpful answer.
However do I need these extra amps? the mototr specification says that should work with 5V and 1A right? I can't understand how much to supply to make it work fully without damaging it...
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Both of these are very important to understanding your project.
The 1A is per coil. If both coils are energized, its 2A. For a stepper in the end only the coil current is of importance if you use the modern current controlling drivers like the DRV8825. The coil current must be changed or even reversed with each step - - but a coil always tries to keep the current flowing. With higher voltage it is easier for the driver to change the coil current. That means higher torque at higher speeds. Because those drivers work similar to a buck converter the PSU current is not the same as the coil current. It's lesser with highr voltages. To select the correct PSU you must consider the needed power - not the coil current (and this is where the coil voltage comes into consideration again ).
{EDIT] If you use the DRV8825 ( or similar boards ) don't forget the big capacitor close to the Vmot input of the driver. This capacitor, the board itself and the coils of the motor are mandatory elements for the system to work correctly.
Briefly: from Arduino, I connect the cables from GND (purple) and Vin (grey) to supply the L298 driver respectively to the GND channel and +12V channel.
Then I connected the pins 8 (red), 9 (orange), 10 (yellow) and 11 (green) from Arduino to IN1, IN2, IN3 and IN4, respectively.
Then I connected one coil of the motor to the driver OUT1 (dark blue) and OUT2 (purple), and the other coil of the moto to the driver OUT3 (gray) and OUT4 (green).
It follows a schematic sketch
regarding the wire connected to the motor, maybe I placed them not in the correct way in the drawing, but in real life it moves as it should so I believe it is connected properly to the stepper motor).
Then I control the motor using Labview and sending the millimeters I want the motor to move:
50.00: moves the stage forward of 50 mm.
-50.00: moves the stage backward of 50 mm.
Here the code:
// Stepper Motor Model:
// QMot.eu QSH 4218-51-10-049
const long stepsPerRevolution = 200; // Change this value based on your stepper motor
const long distancePerRevolution = 2; // mm
const long RPM = 80;
const long MaxSpeed = (RPM * stepsPerRevolution) / 60.0; // Steps per second
// Define the motor connections
#define motorPin1 8
#define motorPin2 9
#define motorPin3 10
#define motorPin4 11
// Define parameters
float distance = 0;
long steps = 0;
// Create a new instance of the Stepper class
AccelStepper myStepper(AccelStepper::FULL4WIRE, motorPin1, motorPin2, motorPin3, motorPin4);
void setup() {
// Set the speed of the stepper motor (RPM)
myStepper.setMaxSpeed(MaxSpeed);
// Set the speed of the stepper motor (RPM)
myStepper.setAcceleration(10000);
// Initialize the serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Check if there is any incoming data from LabVIEW
while (Serial.available() > 0) {
String receivedString = Serial.readString();
distance = receivedString.toFloat(); // Read the desired distance from LabVIEW
// Calculate the number of steps required to move the desired distance
steps = distance / distancePerRevolution * stepsPerRevolution;
// Rotate the stepper motor
if (steps != 0) { // Moving motor clockwise for 'distance' mm (front to end stage)
myStepper.move(steps);
myStepper.runToPosition();
//No movement
} else {
}
Serial.println(distance);
Serial.println(steps);
}
}
The components I am using are: Arduino Uno Rev3, L298N driver, QSH4218-51-10-049 stepper motor and the power is coming only from the USB connection from laptop to the Arduino.
The TMC2209 is a good and modern driver and it can operate the stepper very very silently. It has much more operating modes than the DRV8825 which makes it more flexible, but also a little bit more complicated
Thanks! I think I will follow @jim-p and @MicroBahner suggestions, using a TMC2209 driver.
I saw there are different type of TMC2209 driver available, would this work?
Then my original question: what are the characteristics of the power supplier I should use to power the TMC 2209 driver to not damage the stepper motor?
Sorry for the probably not very deep questions but I am not an electrical engineer so I have very limited knowledge on the topic, I am still learning
Best,
E
From your link in the first post we can see that your stepper needs 5V*1A = 5W per coil or 10W totally. Because of losses and mechanical work you need more power at all, but the 24W of your PSU should be sufficent.