7

I am trying to control a Nema 17 motor with a L298n dual bridge and an Arduino Mega.

My wiring is from this Instructable:

http://www.instructables.com/id/Control-DC-and-stepper-motors-with-L298N-Dual-Moto/?ALLSTEPS

When I connect it to my laboratory power supply the current limitation blinks. Normally when there is too much current needed the LED is all the time on and not blinking.

So I increase the current limit and the motor just starts moving on 3.1A @ 12V (doesn't move if less current) and in the description of the motor on amazon they say "Rated Current/Phase:1.2A" so I am wondering what did I do wrong here?

From my understanding "Rated Current/Phase:1.2A" means that I should run this motor (it's a bipolar stepper motor with 2 phases) not higher than 2.4A?

These are the informations from amazon about this motor:

Specifications:

  • Led screw diameter: 8mm

  • Lead screw length: 300mm

  • Step angle :1.8 degree

  • Nut material: Brass

  • Holding Torque: 400mN*m

  • Thrust(full step): 12.5kg

  • Rated Current/Phase:1.2A

  • Rate Voltage: 3.3v

  • Rated Resistance/Phase:2.2±10%ohm

What would be a good voltage to run this motor? I thought 12V is a good idea with.

The motor L298n gets really hot when I run it at 3.2A or more so I think my setup will destroy the dual bridge and / or the motor.

I really appreciate help on this! :-)

Arduino Mega with L298n dual bridge, Nemi 17 stepper motor, Arduino Mega and QJ3005EIII

ce_guy
  • 73
  • 1
  • 1
  • 5
  • one thing i can think of is that your PSU is too fast/good. Motors often need "infinite" amps to start moving, then they drop-off quickly. If your supply limits those high-voltage startup impulses, it might not be able to get off the ground. Read https://learn.adafruit.com/all-about-stepper-motors/matching-the-driver-to-the-stepper for info about avg current. I suspect your high heat is because the motor is not turning when consuming power. – dandavis Apr 02 '17 at 19:26
  • Do you think my motor will get destroyed or can I use it with high amp? – ce_guy Apr 03 '17 at 13:23
  • i think the motor is more likely to get damage if there's not enough current, not from having too much. current limiting causes the volts to drop, and the motor need a certain voltage to turn. if it can turn, heat will build-up on the coils. if it does turn, it consumes less power and can self-cool. – dandavis Apr 03 '17 at 17:18
  • I was running the motor for a while (few minutes) and the motor driver was getting hotter and hotter and already smelled a bit. The current was jumping from 3.2A (was the current limitation) to 2.6A and again to 3.2A from time to time. My sketch loaded on the arduino is just a non stop stepping, will my current decrease if I put in some delays? – ce_guy Apr 03 '17 at 20:04
  • you could be over stepping, or smearing microsteps, but it's hard to say without knowing virtually everything about your code, gear, internal wiring, etc. _instant amps_ can jump around a lot and mislead humans and meters, don't use current limiting. excess heat is more important, and you might need to adjust your driving hardware/software in order to avoid that. if the extra heat is happening under no-load, i strongly suspect some software timing issues are in play. – dandavis Apr 03 '17 at 20:52
  • I replaced my L298 with a easy driver A3967 and it works perfectly with just 0.2A. Maybe the L298 was broken or something. I still can't understand that. – ce_guy Apr 06 '17 at 18:24
  • if it's not being controlled correctly, that explains the heat for sure, good to hear. – dandavis Apr 06 '17 at 20:12
  • What voltage are you running it at? The motor is rated for 3.3V so you should probably be running it at 3.3V. – Alex May 23 '17 at 02:11

1 Answers1

2

The stepper motor does not directly control or limit its own current. When using the L298n for stepper control, the motor current control is performed by a PWM signal to the L298n ENABLE pin. If you have ENABLE high (100% duty), current will be a factor of only the DC resistance of the stepper winding and the power supply voltage. Here you are trying to drive a 1.2A@3.3V-rated stepper from 12V, so naturally the current will be ~3 times greater.

To adjust the motor current to a safe range for the driver, use analogWrite() from a PWM-capable pin on the Arduino connected to the ENABLE pin on the L298n, and set it to something less than 255 (50% is usually a good starting point). Even then, the instantaneous current draw on the L298n will likely be stressing it outside of its operating envelope.

EDIT: I reviewed the info at the link, and this is the relevant area of the code:

// set speed to 200 out of possible range 0~255
analogWrite(enA, 200);
// set speed to 200 out of possible range 0~255
analogWrite(enB, 200);

Here is where the code is setting PWM of the two ENABLE pins to 200 (~80% duty cycle). Drop this to 50 (~20% duty cycle) and you would likely resolve your overcurrent issue. Reading further still, even the author gives you your first hint at what is happening:

This is not a speed value, instead power is applied for 200/255 of an amount of time at once.