Stepper Motor Control - L298N

Hi there,

I am trying to control this stepper motor (LINK), using an L298N motor controller with this power supply (LINK). Datasheets are found in both of the links.

I am using an Arduino Nano for the control, and it is all hooked up as per the schematic.

I am using the stepper_oneRevolution sketch with the pins altered as follows:

Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5);

The issue that I am having seems to be power related. Every second or so the motor stops spinning, and the LED lights on the power supply, L298N, and arduino all turn off. A moment later they all turn back on again, and so on and so on. The stepper never manages to complete a full revolution before turning off and on.

Anyone have any idea what the issue here is? I thought that all the parts would be compatible with each other, but maybe I was wrong. I don't have much experience with mechatronics-type stuff like this so any help would be hugely appreciated.

Many thanks in advance.

You can't use the 5V regulator on the L298 module with a 24V supply, you need a separate 5V supply for Arduino and remove the jumper on the L298. Also, using a 1 Amp power supply for a 1 Amp motor may be cutting it too close, the PS may be overloading and shutting down.
L298 guide

JCA34F:
You can't use the 5V regulator on the L298 module with a 24V supply, you need a separate 5V supply for Arduino and remove the jumper on the L298. Also, using a 1 Amp power supply for a 1 Amp motor may be cutting it too close, the PS may be overloading and shutting down.
L298 guide

Thank you for your help! So therefore a solution would be getting a new power supply that can both supply less voltage to make the 5V regulator work, and also to provide more current to the motor. Is there a minimum supplied current you think I should use for the motor? Would 2A be acceptable? Or higher still.

Thanks again for your help.

Before you spend money on other parts you should know that an L298 is a very poor choice for controlling a stepper motor.

It may also be rather unfortunate that you have chosen a stepper motor that requires a 24v supply - they are unusual. Most stepper motors have a nominal voltage of the order of 2v or 3v. With a specialised stepper motor driver they can be driven with a 24v power supply for much better performance. The specialised stepper driver can control the current to protect the motor.

If you intend to continue with the 24v motor then you will need to use the 24v power supply but it would be wise to have a 100% margin over the current required by the motor - in other words, a 2 amp power supply for a 1 amp motor. A specialised stepper motor driver (such as the DRV8825) will be a lot more efficient than an L298 and will also take a significant amount of the computation load from the Arduino.

...R
Stepper Motor Basics
Simple Stepper Code

The 24V motor is specified for 1 Ampere/winding, which means that with a 24V power supply, it will draw 2 Amperes at all times. Your power supply is overloaded and shutting down.

Also, the ancient, inefficient and falsely advertised L298 driver will tend to overheat and shut down with motor currents around 1 Ampere per channel.

To be safe, you need a power supply capable of providing 3-4 Amperes, minimum. To be wise, buy a modern motor driver. Pololu has a great selection.

jremington:
The 24V motor is specified for 1 Ampere/winding, which means that with a 24V power supply, it will draw 2 Amperes at all times.

That's not correct, generally only 1 coil is energised, and when the motor is moving it will only be drawing the full 1 amp for the latter part of the step.

But I agree that a power supply with more current is needed.

...R

You must be thinking of low power single phase mode.

For full power, two phase, full step operation, two coils are energized at all times. So 2 Amperes are drawn.

In half step mode, current is either 2 coils/2 Amperes or one coil/1 Ampere, alternating.

jremington:
You must be thinking of low power single phase mode.

I was - and I believe this was extensively discussed on the Forum a while back.

Thanks for the link. It suggests that the actual answer depends on the driver.

...R

JR is right again :stuck_out_tongue: , I wasn't thinking, the stepper lib energizes both coils and alternates polarity to step.

Hi all,

Thank you so much for all your responses.

Based on what you all have said, I can still use the existing stepper motor (LINK). But in order to make it work, I should get a 24V power supply that can supply more current such as this one (LINK), and a stepper motor controller more up to the job such as this one from Pololu (LINK).

Do you see any other issues that might arise with these new components?

Again thank you all so much! I am learning and you have all been so helpful.

The "24V rating" of the stepping motor you linked is misleading. The important parameters are the coil resistance of 4.8 Ohms and the maximum coil current of 1A.

You can use any power supply voltage between about 8V and (somewhat less than) the maximum allowed by the stepper driver, but you MUST be careful to set the current limit to 1A. The higher the voltage, the faster the stepper will move, and the less current will be drawn from the motor power supply.

If you buy the driver from Pololu, follow their video instructions (they won't necessarily work for knockoffs, of which there are many).