Hello Guest it is October 14, 2019, 12:14:02 AM

Author Topic: Understanding Mach3 pulses  (Read 1446 times)

0 Members and 1 Guest are viewing this topic.

Offline Pader

*
  •  16 16
    • View Profile
Understanding Mach3 pulses
« on: May 18, 2018, 11:53:01 AM »
As I understand it, the Default setting for Mach3 is 25kHz but I need to understand more of how this works in practice.

Does this mean that   pulses to the Stepper Drivers are transmitted at this speed?

If so, does the number of stepper motor drivers affect the overall speed?

I am building a circuit that is required to physically count the pulses, are they 'clean' pulses or will I have to introduce some sort of 'debounce' into the circuit?

And finally, is the direction pulse of the same length as the positioning pulses and/or will that too require debouncing?

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Understanding Mach3 pulses
« Reply #1 on: May 18, 2018, 12:23:11 PM »
The quality, or cleanliness of the pulses may vary greatly from PC to PC.

25Khz is the maximum speed for each axis. So Mach3 can output up to 25,000 steps per second for each of 6 axis + the spindle.

Actual pulse rate depends on the  feedrate and acceleration of the current commanded move.

The pulse width setting will vary the length of the pulse.

There really isn't a direction "pulse". It's 0V in one direction, and 5V in the other direction. The pin doesn't change state unless the direction changes.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Pader

*
  •  16 16
    • View Profile
Re: Understanding Mach3 pulses
« Reply #2 on: May 18, 2018, 02:40:40 PM »
Thank you very much for the information coming so quickly.

It has clarified a lot of things for me and will enable me to get on with my project.

Thanks once again.
Re: Understanding Mach3 pulses
« Reply #3 on: May 18, 2018, 04:28:30 PM »
Hi,
in a sense a stepper motor is like your pulse counter.

Every step pulse with the direction pin high cause the rotor to go 1.8 degrees clockwise and if the direction pi  is low it will go 1.8 degrees counter-clockwise.
If you like the rotor position is an accumulation of all previous pulses. If for instance from the start of the session the rotor has turn 431 turns and 113.4 degress
then net number of pulses in one direction  is (200 X 431)+(113.4/1.8 )=86200+63=86263.

Does you project require the net number of pulses, ie a position accumulator or  a total number of pulses?

Craig
My wife left with my best friend...
     and I miss him!

Offline Pader

*
  •  16 16
    • View Profile
Re: Understanding Mach3 pulses
« Reply #4 on: May 18, 2018, 07:40:54 PM »
I am building a DRO for the work position coordinates on my home built CNC machine. 

By using stainless steel threaded rod with a pitch of 1.75 at 10 microsteps, gives me a figure of 1142.85714 pulses per millimetre.  As my display is 4 digits plus decimal 2 places it will give me a resolution on the DRO of /100th of a millimetre (0.394 thou) which is more than enough given the inaccuracy of the threaded rod manufacture.

If my calculations are correct, then the significant figures (ll42) would be enough to provide a reading for a single millimetre (with two decimal places) travel using up/down counter chips.  However, this is unlikely to be very accurate due to both the inaccuracy of the lead screw threads and the accumulated decimal places over the 1600mm travel of my X Axis.

Although I have no experience of microprocessors, I am using a programme for PICAXES that uses graphical algorythms for programming.  Ignoring the last two decimal places (0.00014) as being too small to make any appreciable difference, I intended to count pulses up to 7 (third dec place), increment the second dec place then reset, then the same again up to 5 for the second dec place and up to 8 for the first dec place.  And then the processor outputs to the second decimal place of the actual display and so on by inputting to the 'UP' on the CD40110 up/down counter-driver chips (Cascaded; one for each digit).   hope that iis not too convoluted.

I will have a second routine for decrementing the figures when the 'DIR' signal is present outputting to the 'DOWN' connection on the CD40110 up/down counter-driver chips

If anyone is interested, I have attached the schematic for the actual display circuit.
Re: Understanding Mach3 pulses
« Reply #5 on: May 18, 2018, 08:01:59 PM »
Hi,

Quote
Although I have no experience of microprocessors, I am using a programme for PICAXES that uses graphical algorythms for programming.  Ignoring the last two decimal places (0.00014) as being too small to make any appreciable difference, I intended to count pulses up to 7 (third dec place), increment the second dec place then reset, then the same again up to 5 for the second dec place and up to 8 for the first dec place.  And then the processor outputs to the second decimal place of the actual display and so on by inputting to the 'UP' on the CD40110 up/down counter-driver chips (Cascaded; one for each digit).   hope that iis not too convoluted.

Yes, I understand what you are getting at. What you have outlined is a 'position accumulator'. All step/dir servos for instance require such device.

The next question is why? Mach3 has it built in. The DROs in Mach usually display work co-ordinates but at a click of a button can display machine co-ordinates at programmable resolution.
If you wish it you can use the OEMDROs built into Mach and have access to the raw encoder count. That would place the data on the PC screen, would that be adequate?

If you wanted to have a separate numeric display that could be done by 'sending the numbers' by serial to a display unit, maybe with a micro to 'untangle' the incoming data.

You may have seen advertised CNC pendants. The ones I am thinking of are VitsaCNC but there are heaps of others  and some of there models have an LCD numeric display built in...

Craig
My wife left with my best friend...
     and I miss him!

Offline Pader

*
  •  16 16
    • View Profile
Re: Understanding Mach3 pulses
« Reply #6 on: May 18, 2018, 09:36:13 PM »
I would like a small DRO fixed to the gantry immediately at the work position.  My machine, overall, is 1800mm long and the position of the PC is beyond that.  It would enable me to keep an eye on the work as it progresses in case of error and the Emergency stop button is also on the gantry.  The chances are that is the place that I would most likely be whilst the work is going on.

 Apart from that, it is something that I would just like to do for the hell of it. ;D
Re: Understanding Mach3 pulses
« Reply #7 on: May 18, 2018, 09:45:03 PM »
Hi,
well yes, the challenge of doing something just for the hell of it is something I know a bit about....

While its being built though a wireless pendant with LCD display, and they have an Estop button on them could be sitting in a bracket on the gantry or
even in hand....

Craig
My wife left with my best friend...
     and I miss him!

Offline Pader

*
  •  16 16
    • View Profile
Re: Understanding Mach3 pulses
« Reply #8 on: May 19, 2018, 04:55:01 AM »
 I have a USB pendant that is quite basic, it doesn't even have a rotary speed dial let alone a DRO.  However, a more serious version would, for me, be an unnecessary expense.  As to the E stop button on a pendant.  That is great if you have the pendant in your hand the whole time, but Sod's Law says that you won't at the immediate time of needing it and then you may be fumbling around for it whilst your machine is chewing itself to pieces.  On the gantry is this nice big, 45mm diameter, red button that I could find in my sleep.  I have a similar button on the enclosure of of my control unit.

I am very much a hobbyist and far from sophisticated with my machining equipment.  I am, after all, a retired Building Surveyor with no prior machining experience except a small amount back in school more than half a century ago. 

I think I mentioned that my CNC is home built.  If you are interested, I made an 'Instructable' for it (https://www.instructables.com/id/Good-quality-CNC-Machine/).  I have changed the original design a little in that I now have a dedicated stepper motor for each of the two X Axis lead screws as I found that the original belt drive from a single motor caused problems with belt alignment and torque.  The machine is down at the moment as I am replacing the original, home made, HDPE and steel nut arrangement on the lead screws with sintered bronze bushings together with the original HDPE anti-back lash.  But, as I said, I don't have any particularly sophisticated equipment in my workshop.  More like hobby DIY although I do have a 14" Chinese lathe which, after a lot of adjustment, seems to work quite well.  I also have an abrasive type metal chop saw and a 6" vertical bandsaw with a variety of blades.

I probably could have saved and bought more sophisticated equipment but, for me, the fun was in building much of what I have.   The journey is better than arrival.
Re: Understanding Mach3 pulses
« Reply #9 on: May 22, 2018, 05:57:58 AM »
A word of warning, after fifteen years or so I wouldn't say that I had arrived yet  ;D