
dknieder (Customer) asked a question.
Is there any way to count the number of pulses sent to a stepper driver when using a p1-04pwm card. The stepper motor turns great but i am using time right now to calculate volume. I would rather use steps.

dknieder (Customer) asked a question.
Is there any way to count the number of pulses sent to a stepper driver when using a p1-04pwm card. The stepper motor turns great but i am using time right now to calculate volume. I would rather use steps.

Could you be a bit more specific? The whole reason for a stepper is to have a known speed/profile via. a prescribed number of steps issued to the motor.
Am I missing something you are saying?

Currently the P1 series does not have a high speed output card. the way to get around the issue is a P1-04PWM (pulse width modulation). I am doing the same thing as well but all I care about is speed control.
the P series does have a high speed input card the p1-02HSC that you could parallel an output off of the P1-04PWM to count the pulses.

I think that is a good solution for high accuracy. The HSC card can also have scaling set up so once the OP figures out how many pulses are equivalent to a specific weight of his product, he can work in his application specific units. Then when doing a stepper move, a registration instruction can be used so that as soon as the target count/weight is reached it can immediately turn off the stepper. And since a registration instruction can run outside of scan time, it eliminates that variance and makes things much more accurate.

On a P1k with a PWM card there are no move profiles, he is simply turning on the PWM at a certain frequency to get the velocity to the motor he needs and there is no way to know the number of pulses sent out via any built in stuff to the platform.
In order to know how many pulses were sent out, you need to take your frequency (pulses per second, or hertz) and multiply by the number of seconds it has been on, that will tell you how many pulses have gone out. There will be lag time and variance for scan time, and in the end it is basically still time based since you are just taking pulses * time to get a total.
If you want a specific number of pulses, you need to use a pre-made move profile in the stepper, or use a P2k and a HSO card to actually set up a move profile with the number of pulses/counts you want.

Thanks for that explanation, I have only ever done profile type stepper stuff.
Makes perfect sense now, I have no suggestions for a solution.

So the PWM card is set with the duty cycle to 50% and the Carrier Frequency is the stepper speed?

The duty cycle doesn't have to be at 50% but that is what I use. It just cant be 0% or 100% but I haven't experimented how close the duty cycle can get to 0 and 100 and still work. The Carrier Frequency is the output in Hz. To get velocity we would need to know what the stepper drive is sett up for PPR gear ratio and all that stuff.
Copyright © 1999-2023 AutomationDirect. ALL RIGHTS RESERVED
On a P1k with a PWM card there are no move profiles, he is simply turning on the PWM at a certain frequency to get the velocity to the motor he needs and there is no way to know the number of pulses sent out via any built in stuff to the platform.
In order to know how many pulses were sent out, you need to take your frequency (pulses per second, or hertz) and multiply by the number of seconds it has been on, that will tell you how many pulses have gone out. There will be lag time and variance for scan time, and in the end it is basically still time based since you are just taking pulses * time to get a total.
If you want a specific number of pulses, you need to use a pre-made move profile in the stepper, or use a P2k and a HSO card to actually set up a move profile with the number of pulses/counts you want.