Problem Step and Direction Pulse Length


Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: Step and Direction Pulse Length

  1. #1
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Question Step and Direction Pulse Length

    Hello,

    I am working on a project with Kflop and a Hybrid Servo Motor and Drive by leadshine, the motor drive is HBS57, it is working on a maximum pulse frequency of 200KHz, and the step pulse length should be at least 10us, phase shift between step and direction pulses should be at least 5us.

    The problem is that Kflop offers a maximum pulse length of 3.78us set using the FPGA register to 63 (63/16.667MHz) and a maximum phase shift of 1.92us. Is there anyway around this?

    Tried measuring the pulses coming out of the Kflop, I get a different edge count every run. My guess is that its too fast to count. 132.275 KHz but small pulse length. Also if there is an explanation to pulse rate and acceleration that would be appreciated. I want to know the pulse per second too.

    Similar Threads:


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Hi arhijawi,

    I don't think there is a requirement of the pulse being 10us. In fact it would be impossible to go 200KHz if that were the case.

    If you use the 3.78us pulse and set the polarity so the drive steps on the trailing edge of the pulse then the drive will step 5.7us after the Direction changes and meet specification.

    But better yet may be to use the CW/CCW mode which I believe is supported by those drives and KFLOP. That avoids any Direction setup time issue.

    The Axis parameters will determine the Maximum Pulse/Step rate and the Acceleration. I'm not sure exactly what you are asking for here.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  3. #3
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Hello Tom,

    Thanks for your reply, my problem is persistent as the drive I'm using doesn't seem to support CW/CCW mode. The problem I believe is that the steps that the Kflop is sending are smaller than 10us, which causes the driver to miss steps.
    I am asking about the pulse rate and acceleration real time values, not the maximum. How to read them.

    Here is a link to the drive's data sheet:
    https://mecheltron.com/sites/default...r_HBS57eng.pdf

    Check page two PUL+ and DIR+ details.

    Your help is much appreciated
    ArHijawi



  4. #4
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Hi ArHijawi,

    You are correct. I now see the 10us specification. I haven't noticed that with any other Leadshine drives. And it seems strange as with a 10us pulse with 10us between pulses the max pulse rate would be 50KHz not the 200KHz they claim.

    I"m not aware of any way to make the pulses that long without some external pulse stretcher circuit (maybe, Diode, RC, and Schmidt trigger device like 74HCT14).

    The Axis variables contain a ch->last_vel variable for current velocity. There isn't a variable for acceleration. You would need to compute it from delta velocity / delta time.

    HTh
    Regards

    Regards
    TK http://dynomotion.com


  5. #5
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    10
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Something definitely does not make sense here. As others have stated and implied, a 10us pulse length could not be seen after the frequency exceeds 100Khz because the length of one cycle at that frequency is 10us. So at that point 10us pulses would run together and would only become a high level, not pulses. To get to 200Khz, you would have to have a pulse length that is shorter than 2.5us. I think that their specs. are screwy.

    If you are running at a 200Khz pulse rate, I would try shortening the pulse length to 2us or perhaps 1.25us or even less. A micro second is a millionth of a second and it seems like an awful short time. But having worked with circuits that have pulses that are 1,000 and even 10,000 times shorter, I can assure you that in the world of digital electronics that is an eternity. Your circuitry is probably based on some form of CMOS technology and it can probably operate at least ten times faster than 200Khz, probably 100 times faster or even more.

    Your problem is probably too LONG of a pulse duration, not too short.

    If shorter pulses do not work, try slowing the pulse rate down, perhaps to 100Khz, if you can.



  6. #6
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4252
    Downloads
    4
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    All of what several others have said about strange specs, but there is another possibility here.
    Does the drive have an opto-coupling on the input? If so, that may place a lower limit on pulse length. And that may mean that the claim of 200 kHz is simply false. It may have been carried over from another unit (one without optos) without checking.

    But I dunno.

    Cheers
    Roger



  7. #7
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Thank you all for your replies,

    But when I try to read the pulse with a sampling frequency of 125 kHz, the maximum I can have now, I see pulses of around 10us but its varying, also tried counting the number of steps, its not the same number but its always close to a factor of the move command value.

    I don't think I have an opto-coupling input. But yeah the documentation is quiet misleading.



  8. #8
    Member
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    4252
    Downloads
    4
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    A sampling frequency of 125 kHz is a period of 8 uS. That is far too close to 10 uS.
    I don't know how you are doing your measurements, but something does not sound right to me. I think you need a CRO.

    Cheers
    Roger



  9. #9
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Quote Originally Posted by RCaffin View Post
    A sampling frequency of 125 kHz is a period of 8 uS. That is far too close to 10 uS.
    I don't know how you are doing your measurements, but something does not sound right to me. I think you need a CRO.

    Cheers
    Roger
    Well I am sure there is something wrong. But these pulses operated my motor, but at high Jog values the motor will miss some steps causing it to vibrate and that's not really what I need. And my encoder had to be wired to the driver, which has PID position control.
    I am not sure what is a CRO, but I was thinking that maybe a small change in the Kmotion C library can fix the problem, because after all, making a pulse shorter is always the challenge to hardware not the other way around. Any advice on where to start?

    Thanks,
    ArHijawi



  10. #10
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Hi ArHijawi,

    The link to the manual shows the Leadshine input circuit using optos. Some optos respond slowly which is probably the reason for the 10us pulse requirements. I think Leadshine went to faster optos in their later designs.

    As I said I don't know of an easy way to stretch the pulses that long without adding an external circuit. KFLOP was designed for high step rates (2.5MHz) which requires short pulses.

    With pulses 3.78us or less sampling every 8us will not provide much useful information. It is unlikely that KFLOP is outputting pulses different than what is is configured for.

    At what "high Jog values" does the motor miss step? What speed are you commanding? Is it higher then 100K steps/second?

    Regards

    Regards
    TK http://dynomotion.com


  11. #11
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Hello Tom,

    After I command Jog0 more than 27K, the maximum speed is set to be 40K.



  12. #12
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    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

    Regards
    TK http://dynomotion.com


  13. #13
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Quote Originally Posted by TomKerekes View Post
    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?

    Last edited by arhijawi; 07-18-2017 at 06:18 AM.


  14. #14
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    10
    Downloads
    0
    Uploads
    0

    Default 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.



  15. #15
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    10
    Downloads
    0
    Uploads
    0

    Default 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.



  16. #16
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default 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

    Regards
    TK http://dynomotion.com


  17. #17
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default Re: Step and Direction Pulse Length

    Quote Originally Posted by ChipsNChips View Post
    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,

    Attached Files Attached Files


  18. #18
    Registered arhijawi's Avatar
    Join Date
    Jul 2017
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default 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,



  19. #19
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default 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

    Regards
    TK http://dynomotion.com


  20. #20
    Registered
    Join Date
    Jan 2008
    Location
    USA
    Posts
    10
    Downloads
    0
    Uploads
    0

    Default 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)



    Quote Originally Posted by arhijawi View Post
    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,




Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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


About CNCzone.com

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

Follow us on


Our Brands

Step and Direction Pulse Length

Step and Direction Pulse Length