Hi
I recently received a NEMA34 6A stepper and controller 2DM860H.
I am using a Nano and 24V/10A power supply. I tried your code in this article. Everything is working fine except that maximum speed is not very impressive. That is probably because the "microstep setting starts from 400" and I can't see any option to disable the microstepping.
Now, how do I increase the RPM of the motor?
I just found a manual for the controller.
The first thing mentioned in the manual is:
"This driver will not provide one to one stepping ie. (200 steps/rev). The minimum setting is 400 steps/rev."
Just out of curiosity, have you measured the max speed you can get out of it with a nano?
You might need to get a better micro controller, one that offers higher resolution PWM.
Cheers.
Probably, you haven't watched the video in that article.
The code does not uses the analogWrite command, instead it manually generates pulses based on the value of the potentiometer.
My apologies... I had PWM on my mind!
I meant to say: " a better micro controller, one that offers higher resolution frequency".
In any case, what kind of RPM are you obtaining?
Cheers.
Here is the code for your better understanding:
// Define pins
int reverseSwitch = 2; // Push button for reverse
int driverPUL = 7; // PUL- pin
int driverDIR = 6; // DIR- pin
int spd = A0; // Potentiometer
// Variables
int pd = 500; // Pulse Delay period
boolean setdir = LOW; // Set Direction
// Interrupt Handler
void revmotor (){
setdir = !setdir;
}
void setup() {
pinMode (driverPUL, OUTPUT);
pinMode (driverDIR, OUTPUT);
attachInterrupt(digitalPinToInterrupt(reverseSwitch), revmotor, FALLING);
}
void loop() {
pd = map((analogRead(spd)),0,1023,2000,50);
digitalWrite(driverDIR,setdir);
digitalWrite(driverPUL,HIGH);
delayMicroseconds(pd);
digitalWrite(driverPUL,LOW);
delayMicroseconds(pd);
}
I think the 'setdir' variable should be declared as volatile, and I also don't think you should be calling digitalWrite(driverDIR,setdir); at every iteration of the loop... better to add some logic in there to do it only when you press the button.
So again... do you know what RPM are you currently obtaining?
I'm interested to know, as I may be obtaining one of these Nema34's in the future.
If you don't know, or have no way of testing it, then that's fine.
Cheers.
As I mentioned in the my first post, I am using the code (available in the article published in this website) just to check the maximum speed of the motor.
After thorough research I learnt that the driver I am using, offers minimum 400 steps/rev. so the maximum speed is naturally slower than that with 200 steps/rev.
I do have a tachometer, I will be glad to intimate you the maximum RPM I can get with this blue controller. However, if you are concerned about the speed I would recommend you to get the black controller as shown in the article.
Just now, I checked the specs. of controller MA860H which has been used in the video shown in the article. The specs. shows that, that controller also offers minimum 400 steps/rev. So I wonder how Bill managed to rotate the stepper at high RPM.