Spindle and encoder

More
26 Aug 2023 15:12 #279009 by PCW
Replied by PCW on topic Spindle and encoder
If the commanded RPM is not correct, that's something to do with
the analog out scaling, (which is currently set for 2800 RPM full scale)
and not related to the encoder. This is probably best investigated by
checking the analog signal at the spindle drive with a voltmeter vs spindle RPM

The displayed spindle RPM filtering is set by the lowpass component with a line like:

setp lowpass.spindle.gain 0.500000

in the hal file

If you set this value to .0609:

setp lowpass.spindle.gain 0.0609

You will get a 10Hz bandwidth filter which should reduce most flickering

Please Log in or Create an account to join the conversation.

More
26 Aug 2023 20:05 - 26 Aug 2023 20:33 #279023 by smplc
Replied by smplc on topic Spindle and encoder
I did edit to setp lowpass.spindle.gain 0.0609 and suppose it did reduce some flicker but still some flicker.

Speed controller, immediate wire harness and terminals P1 and P2 digital multi-meter readings.
MDI                       Tachometer               VDC
g97 s2748 m3       2800                          8.8
s500 m3                328                            1.1
Speed controller off/on
s2753 m3              2800                          8.91
s500 m3                325                            1.36

8.8 / 2800 = approx. 0.00314V per RPM
Approx. 0.25V variation speed controller off/on of two tests.  A third test resulted in voltage and RPM comparable to the second test after the speed controller off/on.

In the PncConfig Wizard at the Spindle Motor page, the analog max voltage was set at 10. It was reset to 8.8 and saved but are the same voltage readings with the same RPMs. Could the Spindle Scale Calculation menu either 10V or 5V override any other number? Does the .hal or .ini file have a function or variable to refine the voltage and is that an option? The commanded RPM (g97) should verify the spindle RPM is correct if it matches the tachometer regardless of any flicker and if the analog out scaling and pulley ratio are configured accurately.

On the Spindle Motor page and Spindle Scale Calculation menu the Motor RPM at 10V command: 6100. The Pulley teeth are 1:2. Hence spindle is 3050 RPM. However, the headstock spindle is rated at 2800 RPM. Therefore the ratio is 1:2.174 or 0.92:2 (0.46). The Spindle Motor page didn't seem to convert the pulley ratio decimals equivalent to max spindle RPM close enough. Consequentially remaining with the pulley whole numbers. The Range 1 max RPM is edited to 2800. The pulleys are of different diameters but their ratio is approx. 0.46 RPM reduction.
Last edit: 26 Aug 2023 20:33 by smplc. Reason: Column and row spacing.

Please Log in or Create an account to join the conversation.

More
26 Aug 2023 21:08 - 26 Aug 2023 21:15 #279029 by smplc
Replied by smplc on topic Spindle and encoder
I wonder if the voltage should be increased.

Commanded s500 but the tachometer read 325 RPM at 1.36V. 325 / 500 = 0.65. 1.36 / 0.65 = 2.0923V. 2.0923 / 500 = 0.00418V. 0.00418 * 2800 = 11.704V.

Commanded s2753 but the tachometer read 2800 RPM at 8.91V. 8.91 / 2800 = approx. 0.00318V per RPM. 0.00318 / 0.65 = 0.004895V. 0.004895 * 500 = 2.4475V. 0.004895 * 2800 = 13.706V.

I wonder if 11.704V or 13.706V would coincide with the command s2800 and 2800 RPM.
Last edit: 26 Aug 2023 21:15 by smplc.

Please Log in or Create an account to join the conversation.

More
26 Aug 2023 22:05 - 26 Aug 2023 22:27 #279034 by PCW
Replied by PCW on topic Spindle and encoder
I'm wonder where all the uncertainty / non-linearity is coming from?

The 7I96S analog output is better the 1% linear

What is the spindle PWM frequency set for in the hal file and where
does the 8.8V come from? (I would expect close to 10V from a VFD)

You can increase the spindle speed display filtering by decreasing
the lowpass gain value, so for a 1 Hz bandwidth, you would use
0.0063. If you keep increasing the filtering, at some point the RPM
will lag actual changes in spindle speed enough to be annoying...

(man lowpass)
 
Last edit: 26 Aug 2023 22:27 by PCW.

Please Log in or Create an account to join the conversation.

More
26 Aug 2023 23:53 - 10 Sep 2023 20:54 #279041 by smplc
Replied by smplc on topic Spindle and encoder
Thanks. I edited to lowpass.spindle.gain 0.0063 and the PyVCP RPM only flickers about a couple RPM which appears an improvement and probably okay as is.

I haven't tried a VFD yet with the Sherline Chucker Lathe and LinuxCNC but maybe in the future. I want to utilize the 90VDC brush motor and speed controller that came with the lathe. Maybe in the future upgrade to a VFD. However, I have configured a servo spindle and VFD with a TaigTurn lathe and Mach4 Industrial and went okay.

I can't not sure where in the hal file to locate the PWM. Attached is the hal file. Which function is it?

I measured the outer diameter of each sheave and they're 2.575 and 1.265. The pitch diameters would calculate a more accurate ratio but if the sheeves greater outer diameters are to specification then their ratios might match the pitch diameter ratios. Hence the ratio is 0.4912. 6100 - (6100 * (1 - 0.4912)) = 2996 RPM. The speed controller acceleration dial max setting and pulley ratio coincide near the headstock spindle max 2800 RPM. Then if the PncConfig Wizard pulley ratio is 1:2 the spindle error is 0.0088 and there may be a shortage each revolution. For instance 500 RPM * 0.0088 = 4.4 RPM. 2800 * 0.0088 = 24.64 RPM. The commanded RPM and tachometer RPM may be too great a difference for the error only to be the pulley ratio. The tachometer reading and encoder RPMs match closely as a reminder.

Commanded s2790 but tachometer reads 2961 RPM at 9.77V. The RPM won't go any faster to reach the 10V. Probably because the speed controller acceleration dial is about 1/64 less rotation maxed out. I see the motor could go faster than 6100 RPM, yield and I need to turn down the acceleration dial to match the spindle to 2800 RPM.

I guess the PncConfig Spindle Motor page and analog max voltage could save other numbers than 5 and 10 after all.  I powered off the control box and speed controller, powered on them and launched LinuxCNC.  MDI wouldn't accept any higher commands that'd exceed a tachometer reading of about 2000 RPM.  The inserted 8.8V remained in the PncConfig but I didn't test it with a multi-meter.

I ran a short automatic cycle including g97 and g95 and the grumbling noise from the X and Z axis motors was gone.  I suppose the spindle encoder's increased resolution was a benefit to it.  I still have to test g96.
Attachments:
Last edit: 10 Sep 2023 20:54 by smplc. Reason: 8.8V

Please Log in or Create an account to join the conversation.

More
27 Aug 2023 03:12 #279070 by smplc
Replied by smplc on topic Spindle and encoder
I went back to the PncConfig, Spindle Motor page and tried changing the analog max voltage to 11.704 but it wouldn't accept it. It did accept less than equal 10. That's why the 8.8 was saved earlier. The 8.8 was just to adjust the spindle acceleration but it seems the voltage could increase instead.

s500 but the tachometer is 325 RPM as recorded earlier. That's a 0.65 ratio. 2800 * 0.65 = 1820 max spindle. s500 and the tachometer is 551 RPM. Reducing the max spindle might not match the command to the tachometer RPM. Should the analog max voltage be greater than 10 and is way to do it?

Please Log in or Create an account to join the conversation.

More
27 Aug 2023 06:18 #279075 by smplc
Replied by smplc on topic Spindle and encoder
hal
# ---PWM Generator signals/setup---

setp hm2_7i96s.0.pwmgen.00.output-type 1
setp hm2_7i96s.0.pwmgen.00.scale [SPINDLE_0]OUTPUT_SCALE

ini
[SPINDLE_0]
P = 0.0
I = 0.0
D = 0.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_OUTPUT = 2800.0
ENCODER_SCALE = 4000.0
OUTPUT_SCALE = 2800
OUTPUT_MIN_LIMIT = -2800
OUTPUT_MAX_LIMIT = 2800

Please Log in or Create an account to join the conversation.

More
27 Aug 2023 16:01 #279096 by PCW
Replied by PCW on topic Spindle and encoder
It may be that the speed controller has some nonlinearity or perhaps an offset
near 0 speed.

What is the lowest speed you can command before the spindle stops?

Please Log in or Create an account to join the conversation.

More
27 Aug 2023 19:38 - 27 Aug 2023 19:39 #279108 by smplc
Replied by smplc on topic Spindle and encoder
g97 s300 m3 and tachometer 290 rpm.
Spindle override 32% and tachometer 16 rpm.
Spindle override 28%, tachometer 0 rpm, no rotation and 0.38V.
I see the spindle override is a bit-off too after calculating its percentiles but can investigate it later. I'd like the spindle commands to match the rpm for now.
Last edit: 27 Aug 2023 19:39 by smplc.

Please Log in or Create an account to join the conversation.

More
27 Aug 2023 20:12 #279112 by smplc
Replied by smplc on topic Spindle and encoder
I went back to PncConfig and Spindle Motor page and maintained Motor RPM at 10V command: 6100, Pulley teeth 1:2 and entered. Maintained analog max voltage 10 and default max spindle 3050. Exited and saved. I edited the ini file for all the spindles 3050 to 2989 (3050 * 0.49 pulley ratio). The speed controller acceleration dial is a little higher than 2800 and I'll max it at 2800 later.
g97 s300 m3 and tachometer 142 rpm.
Spindle override 53% and tachometer 18 rpm.
Spindle override 46% and tachometer 0 rpm, no rotation and 0.39V.

Please Log in or Create an account to join the conversation.

Time to create page: 0.219 seconds
Powered by Kunena Forum