Index pulse on Mach3


Results 1 to 15 of 15

Thread: Index pulse on Mach3

  1. #1
    Member
    Join Date
    Feb 2009
    Location
    USA
    Posts
    2143
    Downloads
    0
    Uploads
    0

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

    Similar Threads:
    CAD, CAM, Scanning, Modelling, Machining...


  2. #2
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default 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
    Member
    Join Date
    Feb 2009
    Location
    USA
    Posts
    2143
    Downloads
    0
    Uploads
    0

    Default Re: Index pulse on Mach3

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

    Index pulse on Mach3-capture-jpg

    Attached Thumbnails Attached Thumbnails Index pulse on Mach3-capture-jpg  
    CAD, CAM, Scanning, Modelling, Machining...


  4. #4
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24216
    Downloads
    0
    Uploads
    0

    Default 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
    Member
    Join Date
    Feb 2009
    Location
    USA
    Posts
    2143
    Downloads
    0
    Uploads
    0

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

    Last edited by mcphill; 03-14-2023 at 02:30 PM.
    CAD, CAM, Scanning, Modelling, Machining...


  6. #6
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default 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
    Member
    Join Date
    Nov 2013
    Posts
    4282
    Downloads
    0
    Uploads
    0

    Default 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
    Member
    Join Date
    Nov 2013
    Posts
    4282
    Downloads
    0
    Uploads
    0

    Default 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
    Member
    Join Date
    Nov 2013
    Posts
    4282
    Downloads
    0
    Uploads
    0

    Default 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
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default 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
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default 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
    Member
    Join Date
    Nov 2013
    Posts
    4282
    Downloads
    0
    Uploads
    0

    Default 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
    Member CitizenOfDreams's Avatar
    Join Date
    Nov 2012
    Location
    USA
    Posts
    1267
    Downloads
    4
    Uploads
    0

    Default 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
    Member
    Join Date
    Feb 2009
    Location
    USA
    Posts
    2143
    Downloads
    0
    Uploads
    0

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


  15. #15
    Member
    Join Date
    Feb 2009
    Location
    USA
    Posts
    2143
    Downloads
    0
    Uploads
    0

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


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

Index pulse on Mach3

Index pulse on Mach3