Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: irakandjii on April 23, 2019, 04:13:21 PM

Title: How to understand Spindle readings? I am confused..
Post by: irakandjii on April 23, 2019, 04:13:21 PM
Help I am confused and cannot find detailed references (in the manuals)

I am setting up a CNC Lathe with a PoKeys57CNC. 
My goal is to have a CNC based threading capability on my Sherline Lathe.  Hence.
I am using a Dyn4 servo controller and 400W motor to run the "spindle".

The servo is setup in Speed mode and I have it working with MACH4 I can increase / decrease the rpms etc.  This is done thru the Analog 0-10v pins.  The manuals got me this far. :)

My questions:
1) The "True RPM" is accurate, I tested with a Tachometer on the chuck.

Is there a "manual" or "chapter" that covers the spindle in more detail and covers the above?  I have not been able to find it.  Since my goal is threading I would really like to understand the spindle parameters much better.

Thanks in advance
Title: Re: How to understand Spindle readings? I am confused..
Post by: mcardoso on April 24, 2019, 09:38:33 AM
I'll do some research and try to get back to you, but if you go to the diagnostics tab in the top right corner, it shows the full calculation of spindle RPM with DRO's for each piece of data and the math operators between them. This should be the easiest way to understand what it is doing.
Title: Re: How to understand Spindle readings? I am confused..
Post by: mcardoso on April 24, 2019, 09:43:54 AM
According to the Mach 4 API:

- TrueRPM is the measured RPM from the motor index pulse multiplied by the feedback ratio (this is the speed of your tool)
- MotorRPM This is not the spindle RPM!!! It is the motor RPM without any ratios for ranges (pulleys), etc...
- CommandRPM is the current value set by the S code (will be non-zero even after M05)
- SensorRPM is the RPM of the spindle at the spindle sensor and does not include any feedback ratio.
Title: Re: How to understand Spindle readings? I am confused..
Post by: irakandjii on April 24, 2019, 09:44:16 AM
Thank you I will look into that too, I did not know that was there.

Was able to get the PGM RPM to match True RPM this morning by manually adjusting a range max value.  But, I need to readjust the range for each new PGM I enter.





Title: Re: How to understand Spindle readings? I am confused..
Post by: irakandjii on April 24, 2019, 09:49:00 AM
Thank you

It would seem that the problem is a calibration issue with the Analog Voltage supplied by the PoKeys and the response from the servo motor.

Not sure what to do about that.
Title: Re: How to understand Spindle readings? I am confused..
Post by: mcardoso on April 24, 2019, 09:57:07 AM
Analog calibration is required across industry, most hardware will have some way of adjusting this. Haven't used PoKeys so I cannot comment directly there. I don't think the DMM DYN2 has software configuration for that. Alternatively you can adjust the Mach 4 gear ratios to accommodate this.
Title: Re: How to understand Spindle readings? I am confused..
Post by: irakandjii on April 24, 2019, 10:05:40 AM
Thanks again, It would seem I am on the right track then.

I can pick an "informed" value for max range for each speed range I want and then select that each time.  Just seems a bit of a hack.

It looks like the "slope" of the actual Analog signal is different than Mach4's expected curve.   I get negative (-) errors at the high end and positive (+) errors at the low end.  Almost like Mach4 could use a "look-up" table rather than a formula.

I am using the DYN4 controller, I will look into it more.  I saw dead zones but nothing about slope.
Title: Re: How to understand Spindle readings? I am confused..
Post by: irakandjii on April 24, 2019, 10:23:08 AM
I just received an update from the Mach4 team.   It seems this is normal behavior for the PoKeys57CNC.

Maybe I should consider changing that out...
Title: Re: How to understand Spindle readings? I am confused..
Post by: mcardoso on April 24, 2019, 04:03:34 PM
Love my ethernet smoothstepper, no affiliation other than a happy customer. Great support from them.
Title: Re: How to understand Spindle readings? I am confused..
Post by: reuelt on April 25, 2019, 01:39:06 AM

I am setting up a CNC Lathe with a PoKeys57CNC. 
My goal is to have a CNC based threading capability on my Sherline Lathe.  Hence.
I am using a Dyn4 servo controller and 400W motor to run the "spindle".

The servo is setup in Speed mode and I have it working with MACH4 I can increase / decrease the rpms etc.  This is done thru the Analog 0-10v pins.  .

1. To get a more linear relationship, you need to increase the PWM base frequency to about 120Hz
2. 10V may not be exactly 10V. You need to have one "ferrite sleeves" (chokes) each for the 10V cable and the analog ground. Put the wires though ferrite sleeve or core a few turns.
3. After that, measure the highest voltage you can get with a good multimeter. e.g. it may be 9.7V or 8.5V. Now try to adjust until you can get  exactly 10V. Without the ferrite sleeves or chokes, it is no point calibrating as the readings will be all over the place due to noise.
4. In my VFD, I can just set the top freq to 382Hz instead of 400Hz to get true rpm from my spindle using  M3 or M4 because my BOB cannot give me exactly 10V but only 9.55V.
Title: Re: How to understand Spindle readings? I am confused..
Post by: irakandjii on April 25, 2019, 08:56:48 AM
Thank you Reuelt

I will get a choke I do not have one on hand.  I am using 24awg twisted pair I did not realize one was necessary. 

That being said I have read the voltages with a Keysight Multimeter and get 9.997v at the peak, 18mV at 0 both measured at DYN4 motor controller.   The odd thing appears to be the slope of the curve.  There seems to be a difference between expected "voltage-rpm" points and actual, I will create a table when I get more time.
 
I get a deviation of as much as +/- 30% between programmed speed and true rpms.  '+' error at high rpm, '-' error at low RPM

The folks at Artsoft say that what I am seeing is normal, Mach4 uses true rpms for thread cutting and I will be able to cut threads.
Title: Re: How to understand Spindle readings? I am confused..
Post by: Dim1964 on May 06, 2023, 08:00:20 PM
The Pokeys57CNC has a non-zero volt output when Mach4 outputs a S0 (zero RPM) G-Code.
In my case the offset was 71mV. My servo drive has a setting where I can compensate for that. So that went well. BUT: there is a temperature drift on the 0-10V Pokeys57CNC output as well. It is in the mV/°C range and it does affect the output.
For zero RPM, my servo drive has a dead zone programming in increments of 10mV around 0V, so it is usefull. But the true RPM will also fluctuate with that temperature drift.
Now, because we are in the analog world here, with a servo drive set up as a speed controller, we can expect some deviations, which is fine.
Since for threading operations Pokey57CNC is synchronizing with the real RPM it gets through the Ultra High Speed encoders there is no issue, other than cosmetics on your DRO Mach4 screen where there is some mismatch (if all is well in the single percent range).

I did initially set up the servo drive as a Step/Dir device and there the speed was 100% accurate. The dynamics of the drive were also superior and much more stable than the analog speed control setup. I was very happy with that. Until I tried to do some G32 and G76 threading. It is a no go. After consulting Polabs, they confirmed Step/Dir and threading combination are not supported. So I was forced to use the servo drive in analog speed mode. Very unfortunate.

Now, in analog speed controller mode, my drive has some stability problems.
Not the usual ones. The setup on a timing belt driven lathe is easy as long as you use low gains and high timing constants to avoid harsh oscillations.
In this case it seems to nicely rev up to it's set point and then starts oscillating very slowly over and under that setpoint. The frequency is low, some 0.5Hz to 2Hz and faster at RPMs higher than 500RPM. No PI setting seems to solve this. I know a lot about PI and PID controllers but somehow I still am missing something here. The voltage on the Pokeys output seems to be rock solid with a fast multimeter but I will connect a scope to it tomorrow to see how it really behaves and if there is a correlation with the RPM swing that I can see.

Hope this helps anyone working with POkeys57CNC and analog 0-10V setup.