Author Topic: Step Pulse Width  (Read 10300 times)

WallClimber

  • Posts: 16
    • View Profile
Step Pulse Width
« on: January 24, 2016, 01:56:34 PM »
I am trying to troubleshoot a loss of steps on my Z axis, which happens over the course of a long 3D operation (runs for about 2 hours).  At the end I find that my zero has moved up by a few mms.

I've reduced the acceleration and speed right down and still had the same problem so I'm just looking into some other areas.

I have my Step Pulse Width set to 5us.  My driver (CW8060) specifies "Rising edge effective ,rising edge duration >10μS".  Is this the same thing?  Should I set it to 10us?  http://cnc4you.co.uk/resources/CW8060.pdf

Also I am currently running the PMDX-422 through a separate breakout board (a cheap generic 5 axis BOB) to make it easier to switch over to my old USB Smoothstepper and use Mach3 when I need to for certain jobs.  Could this BOB be interfering with the quality/speed of the pulse signals?

Thanks in advance.
« Last Edit: January 24, 2016, 01:58:15 PM by WallClimber »

Steve Stallings

  • Administrator
  • Posts: 529
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: Step Pulse Width
« Reply #1 on: January 24, 2016, 02:18:10 PM »
The Z axis is often the most problematic because it has gravity working against it and because
during 3D operations that carve complicated surfaces, it reverses many more times than the
other axes.

The only way to know if setting the pulse width to 10 uS will help is to try it. It may take a long
time to do a meaningful test, but it is easy to do. No need to actually be cutting during the test.

Some cheap breakout boards tried to be sophisticated by having opto-isolators in all the signals
including the step and direction signals. Having them in the step and direction signals is a major
source of problems because it adds additional delays on top of the opto-isolators internal to the
stepper driver.
Steve Stallings
www.PMDX.com

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Step Pulse Width
« Reply #2 on: January 24, 2016, 09:44:41 PM »
I have my Step Pulse Width set to 5us.  My driver (CW8060) specifies "Rising edge effective ,rising edge duration >10μS".  Is this the same thing?  Should I set it to 10us?  http://cnc4you.co.uk/resources/CW8060.pdf
Looking at that data sheet and the web page for the device, I cannot find any such specification.  The data sheet makes no mention or pulse duration or rising/falling edge.  The web page says it can handle "an amazing" 1,000 KHz step rate, which means it should handle step pulses with a duration of 0.5 microseconds.

That said, if the docs you have mention 10 microsecond pulse width, then as Steve mentioned, go ahead and try it.  You also should have jumper JP3 on the PMDX-422 set for "GND" for the step/dir common voltage, and the step polarity should be "positive".  And this should be for all axis that are driving that model stepper driver.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

WallClimber

  • Posts: 16
    • View Profile
Re: Step Pulse Width
« Reply #3 on: January 25, 2016, 05:34:36 AM »
Thank you for your very helpful suggestions as always.  I attached the wrong link - here is the datasheet I was looking at http://www.smartautomation.it/CW8060.pdf.  I will give it a try, with the pulse width on 10microseconds and also I'll try removing this breakout board I've been using.  I have it running now so I'll find out in a couple of hours how things have gone!

Steve Stallings

  • Administrator
  • Posts: 529
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: Step Pulse Width
« Reply #4 on: January 25, 2016, 08:01:56 AM »
This new datasheet for the CW8060 does list a specification as follows:

   (Rising edge effective ,rising edge duration >10μS)

Though not clearly worded, I would interpret this as requiring a 10 uS minimum
step pulse width.

Steve Stallings
www.PMDX.com

WallClimber

  • Posts: 16
    • View Profile
Re: Step Pulse Width
« Reply #5 on: January 25, 2016, 11:07:26 AM »
Having run a job this morning, I have found that it is still losing steps, that's with changing the pulse duration to 10us and removing the breakout board (using the PMDX-422's in-built BOB).

I'm just wondering about one thing, you said:
Quote
You also should have jumper JP3 on the PMDX-422 set for "GND" for the step/dir common voltage, and the step polarity should be "positive".
however when I switch J3 to ground, none of my motors move.  I previously had it set to high which has been working so far.  Could you clarify this?

Thanks!

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Step Pulse Width
« Reply #6 on: January 25, 2016, 12:00:14 PM »
Quote
You also should have jumper JP3 on the PMDX-422 set for "GND" for the step/dir common voltage, and the step polarity should be "positive".
however when I switch J3 to ground, none of my motors move.  I previously had it set to high which has been working so far.  Could you clarify this?
I was presuming a few things:
- that you have the "CP-" and "CW-" terminals  connected to the "COM" terminals on the PMDX-422
- that when the data sheet says "rising edge effective" that it means when the "CP+" voltage goes
   positive with respect to the "CP-" terminal.
- and that "rising edge duration" really means "pulse duration" or "duration of CP+ voltage positive with respect to CP-"

If you have the PMDX-422 JP3 set to "+5V" as the common voltage, and *IF* you have CP- and CW- wired to the COM terminals on the PMDX-422, then the CP+ and CW+ terminals can *never* have a voltage higher then CP-/CW-.  The CP+/CW+ terminals will either be at +5V (same as COM) or 0V (minus 5V with respect to COM).  And indeed, this will cause no motion from the stepper driver.

On the other hand, **IF** you have CP+ and CW+ connected to the COM terminal and CP-/CW- connected to the Pin2/Pin3 (for example) terminals, and **IF** you have the step polarity in our plug-in configured for "positive" (oops, we actually call that "Active High"), that effectively inverts the step pulse.  What you then get is a very wide "active" portion with the in-active portion being 5us or 10us (whichever you have selected as the step pulse width).  It is possible that this "in-active" duration is not sufficient for the CW8060.

As you can see, this starts getting very confusing because how your signals are connected to the PMDX-422 affect the meaning of "pulse width" and "step polarity" in ways that our plug-in cannot detect.

I presume from the fact that things stopped working when you set JP3 to GND that you have the CP+/CW+ connected to the COM terminals.  Is that correct?  If so, then return JP3 to "+5V", and configure the PMDX-422 step polarity to "Active Low" and step pulse width to 10us.

If not, please tell me exactly how you have the CW8060 connected to the PMDX-422.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

WallClimber

  • Posts: 16
    • View Profile
Re: Step Pulse Width
« Reply #7 on: January 25, 2016, 12:13:29 PM »
Thanks Bob,  looks like I have been running it with the step pulse inverted then.  My CP+ and CW+ terminals are the ones I have connected to the board.  I'll swap things round and fire up another test run! 

WallClimber

  • Posts: 16
    • View Profile
Re: Step Pulse Width
« Reply #8 on: January 28, 2016, 07:05:07 AM »
An update on this problem I am having with losing Z steps.

I have extensively worked through a lot of factors to try to solve this problem (list below).  Interestingly my latest find is this; when I switch the board back to my USB smoothstepper, and use Mach3 with all the same motor settings, and run the same gcode, I don't get this problem.  It is sat next to me right now having run for an hour and a half with no "drifting" of the Z axis as I have had with the PMDX-422 and Mach4.

I have worked through the following which have not helped:
- Adjusting pulse width and correcting reverse polarity on pulse setting, now running at 10us on each motor (though I have also tested it with 5us and 15us)
- Re-wired signals cables to motor drivers using shielded cable and minimum length (about 4 inches to Z motor driver)
- Swapped out motor driver for CWD556 (digital driver, see link http://cnc4you.co.uk/resources/CWD556%20Manual.pdf)
- Turned acceleration and speed RIGHT down on Z axis to 11.8ipm acc and 100ipm speed (have converted to imperial for you Americans)
- tried various microstepped settings on the driver to achieve a range of steps per unit (mm) from about 64 to 600.  Motor obviously runs smoother on the higher numbers but still loses a similar amount of Z height.

The main breakthrough right now is as I've mentioned, the fact that on reverting to my old setup, Z axis height is maintained and no loss of steps.  I was expecting to eliminate the electronics/software side by performing this test (and turn my attention to the mechanics), and in fact I was suprised to find this seems to confirm the issue is with the control side of things.

I have attached an image with some notes showing the different results.

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Step Pulse Width
« Reply #9 on: January 28, 2016, 06:32:51 PM »
While I ponder what else could be going on - when the Z axis is not at the physical position that it should be, does the DRO on the Mach4 screen show what the position *should* be?  For example, if after running a GCode file, move the Z axis back to zero.  Does the DRO read 0.0000?  Or does it read something slightly different?
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

WallClimber

  • Posts: 16
    • View Profile
Re: Step Pulse Width
« Reply #10 on: January 28, 2016, 06:46:37 PM »
Hi Bob, yes the DRO shows 0.0000.  I tend to either pause the job part-way through or wait till it finishes, then use the Goto Work Zero button and check out whether I have a gap or not!  On finishing the complete job with Mach3, the tool was in perfect position on the material surface.  With Mach4/PMDX-422 I get half way through the job before it has moved up by approximately 4mm.

Also it has occurred to me that I haven't made certain that I'm not losing position on the other axis.  It's certainly not been obvious and as far as I can tell it's not, but I should make a mark at my work zero and check in case the problem is evident on the X and/or Y to any extent. 

Thanks for your time.

Steve Stallings

  • Administrator
  • Posts: 529
  • www.PMDX.com/Images/Avatar120.jpg
    • View Profile
Re: Step Pulse Width
« Reply #11 on: January 28, 2016, 07:12:24 PM »
On the chance that your motor driver opto inputs are really slow, could you try setting the
step pulse width for the SmartBOB to 20 uS to see if it makes any difference?
Steve Stallings
www.PMDX.com

Bob at PMDX

  • Administrator
  • Posts: 368
    • View Profile
    • PMDX
Re: Step Pulse Width
« Reply #12 on: January 29, 2016, 01:13:48 AM »
Hi Bob, yes the DRO shows 0.0000.  I tend to either pause the job part-way through or wait till it finishes, then use the Goto Work Zero button and check out whether I have a gap or not!  On finishing the complete job with Mach3, the tool was in perfect position on the material surface.  With Mach4/PMDX-422 I get half way through the job before it has moved up by approximately 4mm.
If the DRO shows that you are back at zero that means that the PMDX-422 generated every step pulse given to us by the Mach4 motion planner (i.e. it is not the plug-in or PMDX-422 that is dropping step pulses).  So it looks like the issue is somewhere between the PMDX-422's step and direction output buffers and your motor drivers.  See Steve's suggestion above about setting the pulse width to 20us.

Hmmmm....  Is the error always in the same direction?  Does the Z axis always end up higher than it should be?  Or has it ever ended up lower (further into the work piece)?

Quote
Also it has occurred to me that I haven't made certain that I'm not losing position on the other axis.  It's certainly not been obvious and as far as I can tell it's not, but I should make a mark at my work zero and check in case the problem is evident on the X and/or Y to any extent. 
Yes, that would be helpful.  Thanks.

Bob
Engineering Hell: Everything's right and nothing works.
Bob's Corollary: If everything's right and nothing works, double check your assumptions.

WallClimber

  • Posts: 16
    • View Profile
Re: Step Pulse Width
« Reply #13 on: January 29, 2016, 10:54:55 AM »
Quote
On the chance that your motor driver opto inputs are really slow, could you try setting the
step pulse width for the SmartBOB to 20 uS to see if it makes any difference?
I have tried that previously, on all axis.  But just in case I will try it again! 

To be honest I am very close to throwing in the towel, I think mainly with Mach4.  I understand that people have different needs and the program is designed to be adaptable, but many many of the basic features that Mach3 had are not there yet.  Every time I want to do one small thing I have to trawl through endless forums hoping that perhaps someone else has put a snippet of code on there for me that might work.  For example manual tool changing which although I have now found a script, stops working and I have to restart Mach to make it work again.  Every time there is an M6 toolchange it restarts my program and I have to restart Mach.  Except I have to force quit because it keeps running in the background.  It crashes or gets stuck on things quite often and I have to do this.  At the end of the day, I have paid for a piece of software so I expect it to be "finished" to some extent.  You don't buy Microsoft Word and expect to have to learn a programming language and code in your own spell checker.  I understand that it should take some time to setup, as it did with Mach3.  But even with no previous CNC knowledge, a year and a half ago I spent a LOT less time getting Mach3 up and running.  But I'm trying to run a business and for the last two weeks I have been creating a backlog of work.  I am not a programmer, and I don't have days on end to spend messing with buttons and macros.  I think they should make it VERY clear that the software is NOT finished and that when paying money for it we are signing up to be part of a development process. 

Sorry, rant over.  Not directed at you because your support is impeccable  - very much appreciated.  It's a shame though that I can't use your board with any other software, just as I can't use my Smoothstepper USB with anything other than Mach3.  For now I'm going to "unplug" Mach4 and try to make the best of the setup I had before.  Unless anyone can persuade me otherwise???