Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

stepper motor input pulse problem

Hello
I've purchased 4 autonics a41k-m599 model 5-phase stepper motors and 4 MD5-MF14 model drivers. I want to pulse the drivers via parallel port with c++. Now I have some serious problem, first I can't get a higher speed than 666 pps (1500 microseconds interval), second and more important when I send pulse to driver I see motors rotate smoothly but in some moments (and not regularly) they produce some small pauses which result in some small shakes or vibrations. Here I send you a scrap of my c++ code:
// ten cycle
    for(int iLoop = 0; iLoop < 10; iLoop++) {
        // 500 step to complete a cycle (each step is 0.72 degree)
        for(int j = 0; j < 500; j++) {
            outp(LPT1, HIGH);    // send HIGH to CW through LPT1
            outp(LPT1, LOW);    // send LOW to CW through LPT1
            DelayMicroSleep(1500);    // delay 1500 microseconds as pulse interval
        }
    }

Here's a picture of my driver's time chart and input pulse specifications:
http://lh4.ggpht.com/_sFND_wFW_Qo/SttpJRzLpKI/AAAAAAAACGA/uRNWYH519dU/s800/StepperMotorTimeChartPuls...


So now what could be the problem?

0 Kudos
Message 1 of 5
(7,041 Views)

Should you not have a delay between sending the high and low pulse? Otherwise the pulse will happen very quickly.

 


// ten cycle
    for(int iLoop = 0; iLoop < 10; iLoop++) {
        // 500 step to complete a cycle (each step is 0.72 degree)
        for(int j = 0; j < 500; j++) {
            outp(LPT1, HIGH);    // send HIGH to CW through LPT1

            DelayMicroSleep(hightime);
            outp(LPT1, LOW);    // send LOW to CW through LPT1
            DelayMicroSleep(1500);    // delay 1500 microseconds as pulse interval
        }
    }

0 Kudos
Message 2 of 5
(7,023 Views)

I've tested that, but didn't get the desirable result.

I think this problem is due to windows multitasking nature. When I set the priority of my program to high or realtime,

I get better results (but not ideal). Can I solve this problem without getting help of a controller?

(I've also heard that a DOS system could do the trick as well)

0 Kudos
Message 3 of 5
(7,017 Views)

In Windows you are never going to really get sub-millisecond accuracy using the standard system timers, the OS was just not designed to do that.

 

Perhaps you can look into Real-Time (RT) LabVIEW, which runs a RTOS.

 

You could probably get quite good results from using a cheap DAQ which you could output a fast binary stream on one of the port pins instead of using your parallel port.

 

What rate do you want to step the motor? (i.e. what high period and then what low period?)

0 Kudos
Message 4 of 5
(7,015 Views)

I'm just getting good results when setting the priority of the program to realtime, so don't think if changing the way I step the motors would would give me better results.

 

outp(LPT1, HIGH);    // send HIGH to CW through LPT1
outp(LPT1, LOW);    // send LOW to CW through LPT1
DelayMicroSleep(1500);    // delay 1500 microseconds as pulse interval

 

But gonna test again this code:

outp(LPT1, HIGH);    // send HIGH to CW through LPT1

DelayMicroSleep(hightime);
outp(LPT1, LOW);    // send LOW to CW through LPT1
DelayMicroSleep(1500);    // delay 1500 microseconds as pulse interval

 

0 Kudos
Message 5 of 5
(7,012 Views)