Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Mauk on January 01, 2020, 09:00:00 AM

Title: Index pulse and Spindle RPM?
Post by: Mauk on January 01, 2020, 09:00:00 AM
First of all, a Happy New Year to Everyone!

I have a question about the use of the input signal named Index. The 'Mach4 CNC Controller Software Installation and Configuration Guide version 1.0' describes this as input for a once per revolution signal to get the RPM of the spindle (pg. 23). When running the spindle I can see the Index Led on the 'Machine Diagnostics' page flashing. The Spindle DRO for true RPM remains at zero however. I also tried with a signal generator on the input pin, varying frequency and duty cycle, no joy.

The same input signal is used to 'home' the spindle, part of tool change macro, and that works OK.

Setup: Mach4 build 4300, Screen wx4.set; Motion controller CSMIO/IP-S, firmware v3.122;

Maybe this is related? Was this issue solved?

Hi All,

A few weeks ago, I switched over to Mach 4 build 4162. I was successful in getting all my screens and setting imported correctly, however the spindle DRO (which showed true RPM from my spindle index sensor) now sits at 0. I don't think I've changed any scripts or settings since the migration and it worked well beforehand.

Does anyone know any tricks to get this running again?

Thanks!

I was able to get an indication by writing a PLC script. It takes the motor position feedback register to calculate RPM once per second. Stores the result at mc.mcSpindleSetSensorRPM(), but the indication is somewhat unstable. I would like to use the 'build-in' functionality of the mach4 core here.

Title: Re: Index pulse and Spindle RPM?
Post by: Graham Waterworth on January 01, 2020, 01:19:14 PM
I once had a similar issue with a lathe, I ended setting the de-bounce to zero.
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on January 01, 2020, 02:42:47 PM
Thanks for the suggestion about de-bouncing, but, the signal is not from a mechanical switch. It's electronically generated from the spindle encoder index pulse, elongated to about 9.5 milliseconds.

I am still wondering why the Index pulse is not giving me a true RPM indication. The manual suggests this should be possible. Anyone?
Title: Re: Index pulse and Spindle RPM?
Post by: Graham Waterworth on January 02, 2020, 02:37:41 PM
Have you tried my suggestion ?
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on January 02, 2020, 03:23:31 PM
OK, I would like to try your suggestion, but.. Mach4 doesn't have a signal de-bounce setting in the configuration AFAIK. Also the motion controller doesn't provide a setting for that.

I tried with a signal generator directly on the Index input pin. This gives a good clean signal, the led for Index on the diagnostics page is flashing nicely. But, no resulting True RPM DRO indication.

Can you confirm you have an indication of true RPM by Index pulse on your lathe, using Mach4 build 4300?
Title: Re: Index pulse and Spindle RPM?
Post by: Graham Waterworth on January 02, 2020, 07:16:55 PM
I have just noticed you are using a CS-Labs I am using ESS so the setup is different, ignore my rambling

Title: Re: Index pulse and Spindle RPM?
Post by: mcardoso on January 02, 2020, 10:07:35 PM
Whoops... I really should have followed up on that issue...

In the ESS configuration, there were check boxes to get the spindle RPM display from the index sensor or an encoder. The boxes were a tad confusing in their placement and I had selected the wrong one.

Took Andy (Warp9TD) and I far longer than I care to admit to find the issue. He has moved the location of these check boxes for future builds.

Since you are using CS labs, This doesn't apply... Sorry :(
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on January 03, 2020, 05:33:55 AM
@mcardoso: Thank you very much for the follow up.

I am becoming aware of the fact that my interpretation of the Mach4 manual is not correct. I have to read the signal descriptions like: 'the signal has a name and an intended purpose'. But the signals have no connection to the Mach4 core; a plugin has to take care of any functionality and has to report results to the core. Please correct me if I'm wrong.

Title: Re: Index pulse and Spindle RPM?
Post by: joeaverage on January 03, 2020, 05:52:29 AM
Hi,
my understanding is that in order to calculate the spindle rpm the time between index pulses is measured and
the inverse calculation is done to arrive at the rpm.

Given that the index pulses happen very rapidly it is not possible for Mach to do that measurement, remembering that
a PC is not and cannot be a realtime device. That interval measurement must be done by the realtime motion controller.

I use an ESS as it alone has the speed and resolution to make the measurement. I presume the CSMIO does the same.
It must also be said that CSLabs have been very slow, you might almost say reluctant, to add and/or debug realtime features
for their Mach4 plugin. I think an email to CSLabs seeking clarification about the interval measurement capability
of the CSMIO is in order.

Craig
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on January 03, 2020, 12:13:26 PM
Thank you, Craig,

Email to CSLabs is on its way. You can almost predict the answer... They do have a solution for the spindle, the CSMIO-ENC expansion module for threading. It will require, officially, an extra, separate encoder on the spindle axis. But let's see what their answer will be.
In the meantime, my PLC script will have to do. It takes the motor position feedback register, "CSMIO-IP/Feedback Ch[5]" to calculate RPM once per second. It stores the result at mc.mcSpindleSetSensorRPM(). The indication is somewhat unstable, probably caused by timing issues. The script is added here for your entertainment, remember, newbie. I'm certain someone can come up with a better procedure, timing wise.

Mauk
Title: Re: Index pulse and Spindle RPM?
Post by: daniba73 on January 07, 2020, 01:36:03 PM
I own CSMIO IP S on a lathe.
I have ENC module on spindle line.
nonetheless I have problems with the thread.
I point out that as an engine I have classic asynchronous and VFD.
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on January 09, 2020, 03:26:51 PM
A few days ago, I requested CSLabs to add Spindle RPM signal function based on the "Index" signal to the CSMIO firmware.
Today I received confirmation that CSLabs software engineers will take this up. So, hopefully, with the next? firmware update?
Title: Re: Index pulse and Spindle RPM?
Post by: Azalin on January 29, 2023, 11:49:52 AM
Hi,

How did it end?
Title: Re: Index pulse and Spindle RPM?
Post by: daniba73 on January 30, 2023, 01:27:21 AM
Hello.
I'm using a translator.
in my case it was our unsuitable wiring.
the signal cable was too close to the VFD power cable.
wires moved and shield electrically connected to earth.
everything worked.
the thread is perfect.
Title: Re: Index pulse and Spindle RPM?
Post by: Azalin on January 30, 2023, 01:37:14 AM
Good idea. I better check my wiring.

Thanks.
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on February 18, 2023, 04:13:26 PM
A few days ago, I requested CSLabs to add Spindle RPM signal function based on the "Index" signal to the CSMIO firmware.
Today I received confirmation that CSLabs software engineers will take this up. So, hopefully, with the next? firmware update?

It's three years since I mailed the request to CS-Lab concerning the spindle rpm. All this time the machine was rarely used. Reply #12 by Azalin made me look into the rpm indication thing again. After updating the CSMIO IP-S to v3.412 there are some new to me registers for the CSMIO IP-S:
   Spindle Axis Cmd
   Spindle Axis State
   Spindle Axis Position
   Spindle Axis Velocity
   
It looks like the Velocity register gives the spindle speed in Index passes per second. So for now I selected this register in the screen editor for the True RPM DRO. When running CCW the value is shown as negative.

Nice, thank you CS-Lab.

But.. In the mean time I lost speed control of the spindle. Any Gcode "m3 s[number other than zero]" runs the spindle at maximum rpm as defined in the Mach4 configuration motors tab. Something has changed since the update?
Title: Re: Index pulse and Spindle RPM?
Post by: Mauk on February 20, 2023, 02:40:20 PM
.. continued ..

This morning I received a link to a (new?) PDF by CS-Lab. An answer to my question about the spindle configuration for Mach4 and CSMIO IP-S in their support forum:

Title Spindle Axis in Mach4; applies to CSMIO IP-S and IP-A, for v3.nnn (Mach4) firmware.

https://en.cs-lab.eu/wp-content/uploads/asgarosforum/58/Spindle-axis-in-Mach4_EN.pdf (https://en.cs-lab.eu/wp-content/uploads/asgarosforum/58/Spindle-axis-in-Mach4_EN.pdf)

This PDF documents explains very nicely how to configure the spindle. Speed is calculated in degrees per second and pulses per degree of rotation instead of rotations per minute and pulses per revolution. After correcting my motor settings the spindle now runs as intended.

Also found that the register "Spindle Axis Velocity" under the CSMIO-IP entry in the Diagnostic / Regfile gives the speed in degrees per second now.
Title: Re: Index pulse and Spindle RPM?
Post by: Azalin on February 20, 2023, 02:45:15 PM
Good to hear that you figured it out.

In my case it turned out that I had a bad solder on the ground wire of the spindle servo power cable connector.