2019年11月11日星期一

Troubleshooting of getting speed up on a Nema 34 Motor

Hi Guys, i was hoping someone on here could help me work out a issue I'm having.


I have a ESAB waterjet machine. It has 3 heads the first two have failed. This is a very expensive yet older machine, so rather than pay to fly in a tech, put him up in a hotel, pay for $1000's servo drives to be replaced. I decided to replace the first head AC servo motor with a nema 34 stepper motor controlled by an arduino. I have it installed and all my code and buttons work, I'm using a very primitive coding system to pulse the microstepper 1 step every time the button is pressed. It takes 1400 steps to do a revolution. If I hold the button it will just turn until I let go. I control the speed by changing the delay. The lower the delay the faster the rotation. The longer the delay the slower. So to get my speed up to a usable speed I had to set it to 90 microseconds.


I'm using a SainSmart CNC Micro-Stepping Stepper Motor Driver 2M542 Bi-polar 2phase 4.2A Switch.

I'm using a 960 oz-in NEMA 34 Motor capable of 7 amps of current.

I'm using a NEWSTYLE 24V 15A Dc Universal Regulated CNC Switching Power Supply 360W.

I'm using a Arduino Nano as well.


Now I know my microstepper is only capable of 4.5 amps of current but that is plenty to lift and lower my head. I was actually going to use a Nema 23 but the nema 34 was a direct replacement. I also know the Nema 34 and microstepper would be better suited to a 48v power supply but for now the 24v should be fine.


So the Problem. The way I set it up is 4 buttons, one slow up/one slow down and one fast up/one fast down. It does work, but I can't get my speeds as fast as i want. Also I know the machine is not moving with the torque I feel it should. If I try to change my delay down to say 10-75 microseconds the motor makes a noise and doesn't move. It's not missing steps and it's nowhere near using much in the terms of current. Maybe 1.6 amps at 600 microsecond delay and 1.2 amps at 90 microsecond delay. I'm sure there is a better way to code this using the accelstepper function library but i haven't got that far yet and this would work fine for me if I could get the speed up. I've seen this motor do 1400 ipm rapids on a cnc router so I know it's capable.


I'm wondering if by pulsing every 90 microseconds am I pushing too much code through the arduino causing it to stall out. Or is it possible my power supply is just to small. Regardless i do have a larger one on order. But meanwhile I was just curious what the experts thought. And also this code might help some people get a microstepper working in the simplest possible way IMO.


Thanks for any help in advance. I'm very new to the Arduino so take it easy on me. I'm trying.



As for my code here it is:

Troubleshooting help getting speed up on a Nema 34


#define DISTANCE 1 //Set the amount steps per button press, if set to 1 and held it will rotate forever at one step increments, if set to 1600 it will do one revolution per press//


int StepCounter = 0;
int Stepping = false;
int SteppingFast = false;

void setup() {
 pinMode(8, OUTPUT); //direction on microstepper//
 pinMode(9, OUTPUT); //pul on microstepper//
 digitalWrite(8, LOW);
 digitalWrite(9, LOW);

 pinMode(2, INPUT); //button slow up, not positive on these//
 pinMode(3, INPUT); //button slow down, machine is at work//
 pinMode(4, INPUT); //button fast down, will check later//
 pinMode(5, INPUT); //button fast up//
}

void loop() {
 if (digitalRead(3) == LOW && Stepping == false)
 {
   digitalWrite(8, LOW);
   Stepping = true;
 }
 if (digitalRead(2) == LOW && Stepping == false)
 {
   digitalWrite(8, HIGH);
   Stepping = true;
 }

 if (Stepping == true)
 {
   digitalWrite(9, HIGH);
   delayMicroseconds(600); //changing to delaymicroseconds allows the loop to run faster acting like a faster rpm//
   digitalWrite(9, LOW);
   delayMicroseconds(600);

   StepCounter = StepCounter + 1;
 }
 if (StepCounter == DISTANCE)
 {
   StepCounter = 0;
   Stepping = false;
 }

 if (digitalRead(4) == LOW && SteppingFast == false)
 {
   digitalWrite(8, LOW);
   SteppingFast = true;
 }
 if (digitalRead(5) == LOW && SteppingFast == false)
 {
   digitalWrite(8, HIGH);
   SteppingFast = true;
 }
 if (SteppingFast == true)
 {
   digitalWrite(9, HIGH);
   delayMicroseconds(90); //changing to delaymicroseconds allows the loop to run faster acting like a faster rpm//
   digitalWrite(9, LOW);
   delayMicroseconds(90);

   StepCounter = StepCounter + 1;
 }
 if (StepCounter == DISTANCE)
 {
   StepCounter = 0;
   SteppingFast = false;
 }
}

https://www.dopr.net/oyostepper

没有评论:

发表评论