I have an Arduino controlling a NEMA 23 motor using a digital stepping driver (DM542T).
I am trying to have it go a a given speed in RPM (60), but when I try it results in a very jerky movement of the motor that does not go at the expected RMP
Here is my Arduino code:
int driverPUL = 7; // Pulse pin
int driverDIR = 7; // Direection pin
int stepsPerTurn = 200;
int RPM = 60;
float stepsPerSecond = (stepsPerTurn*RPM)/60;
float waitInMilliseconds = (1/stepsneededPerSecond)*1000;
void setup() {
pinMode (driverPUL, OUTPUT);
pinMode (driverDIR, OUTPUT);
}
void loop() {
digitalWrite(driverPUL,HIGH);
delay(wait);
digitalWrite(driverPUL,LOW);
}
In the motor documentation I have the following table but I'm not sure what impulse/turn means.
EDIT
Here is the DM542T settings, it is configured to the 4.20 A and 400 Pulse/rec settings.
Any help would be welcome,
3 Answers 3
I remember these drives need a comparatively long pulse width. Checking the datasheet (page 9) of this drive confirmes this. The minimum low time is specified to be 2.5 microseconds. In your code you set the pulse immediately high after setting low. This might explain the jerky operation, every now and then it misses pulses, resulting in inconsistent driving.
Caveat to my assumptions: I think your code is not the actual code, the posted version will not compile! (Missing/inconsistent variable names.)
Acceleration may be limited by;
- current limiting,
- lack of low ESR bulk cap on supply.
- excess load, friction
- or lack of software control to prevent skipping with controlled acceleration or rate of change of velocity.
Verify these are not the problem.
Show all settings on DM542T.
-
\$\begingroup\$ Thanks for your help, I've added an image showing the DM542T settings. As for the other points, it is not excess load or friction as the motor is not attached to anything at the moment. For the current the driver should deliver 4.2A and the NEMA 23 nominal current is 4.2A. I will look into the other two points. \$\endgroup\$Anthony Lethuillier– Anthony Lethuillier2020年02月18日 11:59:36 +00:00Commented Feb 18, 2020 at 11:59
-
\$\begingroup\$ I have had some success by reducing the current settings to 1A but I don't know why, The nominal current of the motor is 4,2 A \$\endgroup\$Anthony Lethuillier– Anthony Lethuillier2020年02月18日 12:57:47 +00:00Commented Feb 18, 2020 at 12:57
-
\$\begingroup\$ Unless current is reduced during hold or idle, something may be overheating at 4.2A \$\endgroup\$Tony Stewart EE since 1975– Tony Stewart EE since 19752020年02月18日 14:35:54 +00:00Commented Feb 18, 2020 at 14:35
The next two signals are on the same digital pin.
They should be separated as seen below.
int driverPUL = 7; // Pulse pin
int driverDIR = 8; // Direction pin