585,743 active members*
4,891 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Feb 2009
    Posts
    2143

    Index pulse on Mach3

    I just wired up the index pin on Mach3 (using port 2 on a USB SmoothStepper), and it is not working correctly. I am on the right pin, as when disconnected the signal is just 0. When connected I get messy readings. I have scoped the pin, and it is giving a good square wave. I have looked on the diagnostics screen, and the index light does come on but very erratically. The reported spindle speed is all over the map. The signal is coming from the Z bit on an encoder, and I am extending it by 100 microseconds.

    What could be wrong with the setup?

    Do I need to extend the Z bit signal longer?
    Do I need to tie the ground of the SmoothStepper to the ground of the encoder?
    Other ideas?
    CAD, CAM, Scanning, Modelling, Machining and more. http://www.mcpii.com/3dservices.html

  2. #2
    Join Date
    Nov 2012
    Posts
    1267

    Re: Index pulse on Mach3

    I would try extending the pulse further. You can even make it a 50% square wave with a flip-flop (that will divide the frequency by 2, which can be corrected in Mach3's pulley settings).

  3. #3
    Join Date
    Feb 2009
    Posts
    2143

    Re: Index pulse on Mach3

    Is my math right that I have 12 milliseconds per pulse available at 5000 rpm?

    Attached Thumbnails Attached Thumbnails Capture.jpg  
    CAD, CAM, Scanning, Modelling, Machining and more. http://www.mcpii.com/3dservices.html

  4. #4
    Join Date
    Dec 2003
    Posts
    24220

    Re: Index pulse on Mach3

    As mentioned, you would need to extend the pulse, then you may lose accuracy .
    The traditional CNC method of zeroing using an encoder Z pulse is to also use a limit switch, where the axis is moved in rapid until the LS is seen, then the axis is reversed very slowly, when the move off of the LS is detected, the slow move is continued until the Z marker is seen, the zero point is then registered.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  5. #5
    Join Date
    Feb 2009
    Posts
    2143

    Re: Index pulse on Mach3

    This is just for spindle speed, so the accuracy of the "position" doesn't matter (Mach3 can't do rigid tapping is my understanding). I'll try extending the pulse tonight. I didn't realize at 5000 rpm I would have so much time available! That said, an Arduino can keep up with the signal much faster using a 16 MHz processor. I'm surprised a 100 us is too fast for a computer in the 2+ GHz range.
    CAD, CAM, Scanning, Modelling, Machining and more. http://www.mcpii.com/3dservices.html

  6. #6
    Join Date
    Jan 2005
    Posts
    15362

    Re: Index pulse on Mach3

    Quote Originally Posted by mcphill View Post
    I just wired up the index pin on Mach3 (using port 2 on a USB SmoothStepper), and it is not working correctly. I am on the right pin, as when disconnected the signal is just 0. When connected I get messy readings. I have scoped the pin, and it is giving a good square wave. I have looked on the diagnostics screen, and the index light does come on but very erratically. The reported spindle speed is all over the map. The signal is coming from the Z bit on an encoder, and I am extending it by 100 microseconds.

    What could be wrong with the setup?

    Do I need to extend the Z bit signal longer?
    Do I need to tie the ground of the SmoothStepper to the ground of the encoder?
    Other ideas?
    It seems you have noise messing up the signal, the wiring needs to be Twisted pair shielded.

    Yes the +/- should be all connected to the correct outputs, or it will not work.
    Mactec54

  7. #7
    Join Date
    Nov 2013
    Posts
    4361

    Re: Index pulse on Mach3

    Hi,
    it may also be advisable to ask Andy on the Warp9TD forum. The USB is no longer manufactured but it has a smaller FPGA than the current ESS.
    There may well be a pulse speed limitation with the USS that does not occur in the ESS.

    I use an ESS and have no trouble monitoring the index pulse of a servo running at 3500rpm, and that is without any pulse extension.

    Craig

  8. #8
    Join Date
    Nov 2013
    Posts
    4361

    Re: Index pulse on Mach3

    Hi,

    I'm surprised a 100 us is too fast for a computer in the 2+ GHz range.
    This is a misunderstanding, its not the PC that monitors the index pulse but the motion board, in this case the USS. The USS will send to Mach at approximately 25ms intervals,
    a count of how many clock pluses have occurred between two successive index signals.

    Lets ay the USS has the same kernel frequency of the ESS, which is 4Mhz.
    At 5000 rpm or 83.33 rotations per second and therefore the time between pulses is 0.012 seconds.

    The USS will report a count of 4,000,000 x 0.012=48000.

    There was indeed a thread on this very matter on the Warp9TD forum just a few weeks ago.....although it referred to the ESS rather than the USS, but the same principles
    certainly apply, and most likely the same numbers also.

    Craig

  9. #9
    Join Date
    Nov 2013
    Posts
    4361

    Re: Index pulse on Mach3

    Hi,
    the last issue is what breakout board are you using. Many of the CNC4PC boards, like the C25 have a low pass filter at the input which will all but obscure the input pulse,
    its just too fast. You may have to take to the C25 with a soldering iron and remove the low pass filter capacitor.

    Craig

  10. #10
    Join Date
    Nov 2012
    Posts
    1267

    Re: Index pulse on Mach3

    Quote Originally Posted by mcphill View Post
    Is my math right that I have 12 milliseconds per pulse available at 5000 rpm?
    12ms pulse period (pulse+pause). 6ms pulse length, assuming 50% duty cycle.

  11. #11
    Join Date
    Nov 2012
    Posts
    1267

    Re: Index pulse on Mach3

    Quote Originally Posted by joeavaerage View Post
    Many of the CNC4PC boards, like the C25 have a low pass filter at the input which will all but obscure the input pulse,
    its just too fast. You may have to take to the C25 with a soldering iron and remove the low pass filter capacitor.
    The SmoothStepper manual shows a 1.5MHz low pass filter (100 ohms resistor and 1nF capacitor). So that should not be a factor.

    Of course, we don't know if there is any software filtering going on inside the SmoothStepper's FPGA.

  12. #12
    Join Date
    Nov 2013
    Posts
    4361

    Re: Index pulse on Mach3

    Hi,

    The SmoothStepper manual shows a 1.5MHz low pass filter (100 ohms resistor and 1nF capacitor). So that should not be a factor.
    The ESS is not in general connected to the outside world, but via a breakout board. The C25 breakout board has low pass filter at the inputs of something like
    2kHz, certainly low enough to screw with an index pulse. Its not the ESS that is the limitation but the breakout board.

    Craig

  13. #13
    Join Date
    Nov 2012
    Posts
    1267

    Re: Index pulse on Mach3

    Quote Originally Posted by joeavaerage View Post
    The C25 breakout board has low pass filter at the inputs of something like
    2kHz, certainly low enough to screw with an index pulse. Its not the ESS that is the limitation but the breakout board.
    I see. Yes, a 2kHz filter will definitely butcher a pulse from the encoder, even if you extend it to a few milliseconds.

  14. #14
    Join Date
    Feb 2009
    Posts
    2143

    Re: Index pulse on Mach3

    Quote Originally Posted by joeavaerage View Post
    Hi,



    This is a misunderstanding, its not the PC that monitors the index pulse but the motion board, in this case the USS. The USS will send to Mach at approximately 25ms intervals,
    a count of how many clock pluses have occurred between two successive index signals.

    Lets ay the USS has the same kernel frequency of the ESS, which is 4Mhz.
    At 5000 rpm or 83.33 rotations per second and therefore the time between pulses is 0.012 seconds.

    The USS will report a count of 4,000,000 x 0.012=48000.

    There was indeed a thread on this very matter on the Warp9TD forum just a few weeks ago.....although it referred to the ESS rather than the USS, but the same principles
    certainly apply, and most likely the same numbers also.

    Craig
    That's a good point.

    I am not using a "breakout board" per se. The Mikini has something built in, but it doesn't interface to an encoder. I have the encoder wired to an Arduino, and am essentially "making" my own breakout board using the Arduino as a go-between for the Mikini signal I/O, the VFD, and the USS. That's why stretching the signal from the encoder is easy, I was already stretching it by 100 us. I have been working long nights so haven't tried stretching it to 4-5 ms yet - that should work.

    FWIW once I get this working, I plan to upgrade to a new computer using an ESS and MACH4, but I didn't want to change too many things at once since debugging my Arduino work will be a challenge in and of itself.
    CAD, CAM, Scanning, Modelling, Machining and more. http://www.mcpii.com/3dservices.html

  15. #15
    Join Date
    Feb 2009
    Posts
    2143

    Re: Index pulse on Mach3

    Well, no luck. No matter what I do all I get is noise on the RPM readout in MACH3 (or 0). I have fed it many different known good square pulses, and it doesn't work. I extended the pulse 6000 milliseconds, no luck. Not sure, maybe my USB SS is bad. I won't worry about it, since I will be upgrading to a new computer and ESS once I get everything working (I'm close!). Hopefully it all works on the ESS.
    CAD, CAM, Scanning, Modelling, Machining and more. http://www.mcpii.com/3dservices.html

Similar Threads

  1. No Mach3 Index pulse with G540 controller
    By Pompey Dockyard in forum Gecko Drives
    Replies: 1
    Last Post: 02-16-2021, 04:24 AM
  2. Why use a pulse index card?
    By rusmannx in forum Benchtop Machines
    Replies: 8
    Last Post: 02-26-2016, 06:24 AM
  3. Calibrating Spindle in Mach3 with Index Pulse Sensor
    By zer0fighter in forum Mach Software (ArtSoft software)
    Replies: 2
    Last Post: 09-10-2014, 12:34 PM
  4. homing to index pulse
    By spoiledbrat in forum SmoothStepper Motion Control
    Replies: 0
    Last Post: 09-16-2012, 10:21 PM
  5. G540 and C3 index pulse card
    By cmanning in forum Gecko Drives
    Replies: 5
    Last Post: 02-12-2010, 02:09 PM

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
  •