Problem Step and Direction Pulse Length - Page 2

# Thread: Step and Direction Pulse Length

1. ## Re: Step and Direction Pulse Length

Originally Posted by TomKerekes
Hi ArHijawi,

That comes out to 37us per pulse and I wouldn't expect there to be a problem.

What RPM does that correspond to? What are your motor and encoder specifications? What motor supply voltage are you using?

Are the KFLOP Step/Dir outputs in Open collector mode?

Regards
Hello Tom,

Can you please show me how you got that number? and I am not sure because I could not tell how many pulses per second, but according to the 37us, I would have 5405.4 rounds per minute because my motor requires 300 steps to complete a revolution. Here is the datasheet:

http://www.cncshop.cz/PDF/HBS/HBS573_86_motors.pdf

Model: 573S20-EC-1000

I am using the Step/Dir in quadrature mode. For Output0 is set to be 16.

Can you suggest a 3 phase motor and its driver that is compatible with Kflop?

2. ## Re: Step and Direction Pulse Length

I'm not sure how you are getting all the numbers you are stating, but I get the idea that you do not have a good understanding of the math involved. Here are some fundamental concepts:

1. If you have a constant train of evenly spaced pulses, the frequency and the spacing from one pulse to the next are mathematically related. Frequency has the units or inverse time (1/t) and it is measured in cycles per second. There is no conversion constant, so the time internal from one cycle (pulse) to the next one is simply the reciprocal of the frequency. Pulse Spacing = 1 / frequency

This means that the time available for one pulse AND some space between that pulse and the next one is 1 / frequency. At 200Khz this formula yields: Pulse Spacing = 1 / 200,000 seconds. That equals 0.000005 s or 5 us.

If you are generating a pulse train at 200Khz, then when the pulse length equals 5us, each pulse's trailing edge runs into the leading edge of the NEXT pulse and there will be NO SPACE between the pulses. So your 200Khz pulse train becomes a DC Voltage, either 0 or +5 Volts, depending on the polarity.

2. Since point 1 says that you simply can not have 10us pulses at a 200Khz rate, something has to go awry when you get to that point with your circuitry. Different circuits can react differently. One type of circuit may simply produce a DC Voltage as I stated above.

Another type could produce that 10us pulse then wait until that pulse is over and a short interval at the other Voltage level has passed and then they would produce another 10us pulse. This would lower the 200Khz repartition rate of the pulses. If the circuit waits until the next 200Khz dictated interval, then it will skip at least one pulse and the frequency would be 100Khz. If it skips two pulses then the frequency would become 66.66Khz.

3. As I said, I don't know how you are getting your figures. Are you simply trusting what a circuit "should" be doing? As you can see from the above, the circuit will not act as it "should" when you reach a point where the pulses run together. Something else will happen.

Are you using a scope to see the pulses? If so, is it a digital scope or an analog one? Analog scopes may be old fashioned, but they are a lot easier to use to observe pulse trains. A digital scope will sample the pulses at some frequency of it's own and this can give misleading results. The five dollar word for this is aliasing. What that means is if you sample one repeating signal with a repeating sample rate, you can, ACTUALLY WILL get four different frequencies in the result: each of the original frequencies, the sum of those original frequencies, and the difference between those original frequencies. Which of these you will see on a digital scope will depend on the frequencies and the design and settings of the scope. Digital scopes are all the rage today. But this is NOT because they are better. It is because they are cheaper.

3. ## Re: Step and Direction Pulse Length

I'm not sure how you are getting all the numbers you are stating, but I get the idea that you do not have a good understanding of the math involved. Here are some fundamental concepts:

1. If you have a constant train of evenly spaced pulses, the frequency and the spacing from one pulse to the next are mathematically related. Frequency has the units or inverse time (1/t) and it is measured in cycles per second. There is no conversion constant, so the time internal from one cycle (pulse) to the next one is simply the reciprocal of the frequency. Pulse Spacing = 1 / frequency

This means that the time available for one pulse AND some space between that pulse and the next one is 1 / frequency. At 200Khz this formula yields: Pulse Spacing = 1 / 200,000 seconds. That equals 0.000005 s or 5 us.

If you are generating a pulse train at 200Khz, then when the pulse length equals 5us, each pulse's trailing edge runs into the leading edge of the NEXT pulse and there will be NO SPACE between the pulses. So your 200Khz pulse train becomes a DC Voltage, either 0 or +5 Volts, depending on the polarity.

2. Since point 1 says that you simply can not have 10us pulses at a 200Khz rate, something has to go awry when you get to that point with your circuitry. Different circuits can react differently. One type of circuit may simply produce a DC Voltage as I stated above.

Another type could produce that 10us pulse then wait until that pulse is over and a short interval at the other Voltage level has passed and then they would produce another 10us pulse. This would lower the 200Khz repartition rate of the pulses. If the circuit waits until the next 200Khz dictated interval, then it will skip at least one pulse and the frequency would be 100Khz. If it skips two pulses then the frequency would become 66.66Khz.

3. As I said, I don't know how you are getting your figures. Are you simply trusting what a circuit "should" be doing? As you can see from the above, the circuit will not act as it "should" when you reach a point where the pulses run together. Something else will happen.

Are you using a scope to see the pulses? If so, is it a digital scope or an analog one? Analog scopes may be old fashioned, but they are a lot easier to use to observe pulse trains. A digital scope will sample the pulses at some frequency of it's own and this can give misleading results. The five dollar word for this is aliasing. What that means is if you sample one repeating signal with a repeating sample rate, you can, ACTUALLY WILL get four different frequencies in the result: each of the original frequencies, the sum of those original frequencies, and the difference between those original frequencies. Which of these you will see on a digital scope will depend on the frequencies and the design and settings of the scope. Digital scopes are all the rage today. But this is NOT because they are better. It is because they are cheaper.

4. ## Re: Step and Direction Pulse Length

Hi ArHijawi,

I don't think you can use quadrature mode with your drives. It will generate bigger pulses but it will also toggle the direction and cause other problems. Why are you doing that?

http://dynomotion.com/Help/StepAndDi...n/AllModes.png

Also how do you figure 300 steps/rev? The link you posted indicates 1000 line encoders that would be 4000 counts/rev.

Regards

5. ## Re: Step and Direction Pulse Length

Originally Posted by ChipsNChips
This means that the time available for one pulse AND some space between that pulse and the next one is 1 / frequency. At 200Khz this formula yields: Pulse Spacing = 1 / 200,000 seconds. That equals 0.000005 s or 5 us.

If you are generating a pulse train at 200Khz, then when the pulse length equals 5us, each pulse's trailing edge runs into the leading edge of the NEXT pulse and there will be NO SPACE between the pulses. So your 200Khz pulse train becomes a DC Voltage, either 0 or +5 Volts, depending on the polarity.
Hello ChipsNChips,

I really appreciate your help, I just don't understand why there will be no space between pulses, doesn't that relate to the duty cycle of the pulse?
I am using a MyRIO DAQ device, it allows FPGA and FIFO registers. However, when I wire the pulses to the digital inputs, I don't read anything. That's why I used the analog inputs along with filters and normalizing the signals so it becomes ones and zeros. I don't trust the circuit that's why I had it scoped. But yes, every run I get a different frequency and duty cycle. I had it to count rising edges of the pulse I'm sending. It gives me a count close to the number of steps I commanded on the Kflop. But it is obvious too that the move command will cause it to accelerate, have a constant velocity and then decelerate. On the scope, I can see that clearly and I can tell it doesn't have a constant frequency, since the pulse width in acceleration stage is wider but keeps decreasing till it reaches a constant stage. I attached a file of scope results.

Regards,

6. ## Re: Step and Direction Pulse Length

Hello Tom,

Right now I am only investigating the pulse width requirements, but I think my drive works with quadrature mode because they stated that the direction pulse should lead or lag the step pulse by 5us. What mode do you suggest for my drive?
And since my motor does 1.2 degrees per step, a revolution will require 300 steps. And yes my encoder reads 4096 counts/rev but that is for feedback, I still couldn't get the encoder to work on the Kflop.

Great thanks,

7. ## Re: Step and Direction Pulse Length

Hi ArHijawi,

Right now I am only investigating the pulse width requirements, but I think my drive works with quadrature mode because they stated that the direction pulse should lead or lag the step pulse by 5us.
I don't think that indicates your drive accepts quadrature. The manual clearly indicates it requires Step/Dir. The timing requirement for the Direction Signal wouldn't indicate quadrature. It just means the Direction should not change in close proximity to a step command.

What mode do you suggest for my drive?
Step and Direction. Although KFLOP's step pulse length will need to be stretched to meet the specification.

And since my motor does 1.2 degrees per step, a revolution will require 300 steps
I doubt if this is correct. Whatever the "step angle" of the motor is doesn't necessarily indicate what a step to the Driver will do. The Driver likely does mircrostepping or other things to servo the motor to higher resolution.

Regards

8. ## Re: Step and Direction Pulse Length

Boy, you must be a student in some kind of technology class. Is this an actual classroom type class or home study? I ask this to see if you have any access to real test equipment or are you working with your own computer and that National Instruments, MyRIO DAQ device. As far as I can tell, that device is just a way to acquire digital data and it does not have much capability to present it beyond giving you a text file. I looked at your "file of scope results" and it is an almost endless list of zeros and ones. That is very hard to interpret. The data may be there, but you or I would have to sit down and count the strings of ones and zeros for a long time to see any kind of waveform emerge from it. A scope, either a digital or an analog one, would present you with a single picture of that data drawn in the form of an X-Y graph. That would almost instantly show you things like the frequency, duty cycle, pulse length, and how regular or irregular the pulses are.

Are they teaching electronic design work without oscilloscopes today? I have over 50 years in electronics and absolutely can not imagine that. You need to SEE the waveforms. At least that is my experience of over 50 years. I used an ANALOG scope on a daily basis for much of that time. It was an invaluable tool.

In my previous post I tried to tie the pulse width and the frequency together with some math. I don't think you understood what I was saying. Think of this and read that post again. If you have a circuit that is making 10 pulses in one second, then those pulses are starting every 1/10th of a second. Now, if each of those pulses is 1 second long, then the second pulse will be starting before the first one has ended. And the third one will start before the second one has ended. All those pulses will run together and you will no longer see individual pulses, just a constant string of high levels (1s).

Frequency, pulse length, and duty cycle are mathematically related. If you have values for two of them, then the third is fixed (formula below). Perhaps I should have said that before. As I said before, the frequency dictates the amount of time available for a single pulse. In my example above, a frequency of 10 Hz allows only 1/10 of a second for each pulse. That includes both the on time and the off time for a complete pulse. So if the pulse is high for 1/20 s and then low for 1/20 s it has a 50% duty cycle and the entire pulse takes up 1/10 s (1/20 s + 1/20 s = 1/10 s). And there can be 10 such pulses with a 50% duty cycle in one second. They fit. But if you increase the pulse's high time to 1/10 of a second, then there is zero time left for it to go low before the next pulse comes along. So the level stays high (1) and you no longer have a train of pulses. Instead you have a DC Voltage level. The same kind of thing will happen if you use larger and smaller numbers, like 100,000KHz and 10us. You get a "pulse" that has a 100% duty cycle and they run together. And they no longer are pulses; just a DC Voltage. An image on a real oscilloscope would show this instantly. I have seen circuits do exactly this when they were "tuned" beyond their limits: as you adjust one of the parameters too far, the pulses just disappear and you have a flat line on the scope.

f = frequency in Hertz
d = duty cycle in percent
p = pulse duration in seconds

p = d / (100 x f)

Originally Posted by arhijawi
Hello ChipsNChips,

I really appreciate your help, I just don't understand why there will be no space between pulses, doesn't that relate to the duty cycle of the pulse?
I am using a MyRIO DAQ device, it allows FPGA and FIFO registers. However, when I wire the pulses to the digital inputs, I don't read anything. That's why I used the analog inputs along with filters and normalizing the signals so it becomes ones and zeros. I don't trust the circuit that's why I had it scoped. But yes, every run I get a different frequency and duty cycle. I had it to count rising edges of the pulse I'm sending. It gives me a count close to the number of steps I commanded on the Kflop. But it is obvious too that the move command will cause it to accelerate, have a constant velocity and then decelerate. On the scope, I can see that clearly and I can tell it doesn't have a constant frequency, since the pulse width in acceleration stage is wider but keeps decreasing till it reaches a constant stage. I attached a file of scope results.

Regards,

9. ## Re: Step and Direction Pulse Length

Originally Posted by TomKerekes
I doubt if this is correct. Whatever the "step angle" of the motor is doesn't necessarily indicate what a step to the Driver will do. The Driver likely does mircrostepping or other things to servo the motor to higher resolution.
Hello Tom,

Then how to know what the pulses do to the driver, how did you deduce the 37us in your previous post?

Great thanks

10. ## Re: Step and Direction Pulse Length

Hello ChipsNChips,

It is more of a home study, but the data acquisition device I am using is much more capable than an old fashion oscilloscope, not only I see the pulses, I can measure the duty cycle, period, frequency and rising or falling edges count, the data file I attached was a sample for sending a Move command of 10000, I want to know how many steps will that cause. I really appreciate your help in explaining, but I understand the mathematics behind waves. My problem is that every time I run, I get a different reading.
The reciprocal of frequency results in the period, the time required to complete one cycle, now this cycle has a duty cycle, a ratio between how long it was on vs how long it was off, in your previous post you said that
Originally Posted by ChipsNChips
If you are generating a pulse train at 200Khz, then when the pulse length equals 5us, each pulse's trailing edge runs into the leading edge of the NEXT pulse and there will be NO SPACE between the pulses. So your 200Khz pulse train becomes a DC Voltage, either 0 or +5 Volts, depending on the polarity.
That is the case when the pulse has a 100% duty cycle.

It is not the method of measurement that I'm having troubles with it's the pulses I'm sending from the Kflop. I am trying a higher sampling frequency today, I will update you with the results soon.

Regards

11. ## Re: Step and Direction Pulse Length

Hi ArHijawi,
Then how to know what the pulses do to the driver
You would need to obtain that information from the manufacturer of your Drivers. Or run an experiment such as give a certain number of pulses and observe how far the motor moves.
how did you deduce the 37us in your previous post?
You said the problem occurs at 27KHz. 27KHz=37us period.

12. ## Re: Step and Direction Pulse Length

Hello Tom,

Thanks a lot for your help, can you suggest other 3 phase motor and driver that I can look at?

Regards

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!