Hello Guest it is March 28, 2024, 04:40:06 AM

Author Topic: Spindle calibration, how I manage to get it working  (Read 23913 times)

0 Members and 1 Guest are viewing this topic.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Spindle calibration, how I manage to get it working
« Reply #20 on: August 24, 2016, 05:55:11 PM »
Ah so!   :-*
What an excellent idea. I must try that out myself.
Thank you.
Roger
Re: Spindle calibration, how I manage to get it working
« Reply #21 on: September 20, 2016, 06:43:41 PM »
Yet another update:
Spindle calibration works fine in MILL mode.
I am still having a few issues in LATHE mode. I usually have to issue a spin command twice to get close to the calibrated spin, otherwise it runs faster - sometimes a little faster, sometimes a lot. Sigh.

The comment was made somewhere that there is little difference between spinning at 1500 RPM and 1600 RPM. This may be so on a Mill, but on a Lathe it can mean the difference between sitting right on tool/part resonance and being way off resonance and quiet. Mumble.

Cheers And Happy New Year
Roger


The spreadsheet is excellent and has done a great job of calibrating my lathe spindle speed. I have the same issue that you have regarding having to request the spindle speed twice. Did you ever find a fix for this?

Thanks davidimurray, good to know the spreadsheet was useful to someone!
Sorry I haven't been checking this post for a while...
You know, this need of  setting-speed-twice have been annoying me too. Sure it is not the best way to use workarounds, but the info you guys posted really helped me to make it work!
Cheers!
Re: Spindle calibration, how I manage to get it working
« Reply #22 on: November 11, 2016, 06:33:54 AM »
Thanks resalles for the script.

I got Spindle calibration to work with your script.

Here are the step i took to get it to work.
1. I set the pulley to 1, min to 0, max to 1000.
2. turn on the spindle, set speed from S0 till the spindle start to move. note the speed (mine is about 110 to 120 RPM)
3. Max out the motor speed by type S1000 into the MDI, speed was about 12928
4. change the min spped to 120 and max to 12928 ( I think can set to 12500 or anything max speed toy like)
5. key in the min and max in the spreadsheet
6. Type the speed from from the spreadsheet and key in the measured speed, repeat 100 times.
7. generate the Linearity.dat file.

it works within 200rpm + -
Re: Spindle calibration, how I manage to get it working
« Reply #23 on: March 17, 2017, 09:54:54 PM »
Thanks resalles for the script.

I got Spindle calibration to work with your script.

Here are the step i took to get it to work.
1. I set the pulley to 1, min to 0, max to 1000.
2. turn on the spindle, set speed from S0 till the spindle start to move. note the speed (mine is about 110 to 120 RPM)
3. Max out the motor speed by type S1000 into the MDI, speed was about 12928
4. change the min spped to 120 and max to 12928 ( I think can set to 12500 or anything max speed toy like)
5. key in the min and max in the spreadsheet
6. Type the speed from from the spreadsheet and key in the measured speed, repeat 100 times.
7. generate the Linearity.dat file.

it works within 200rpm + -

Thank you very much!
Spindle calibration, how I manage to get it working
« Reply #24 on: March 22, 2017, 05:02:00 AM »
I have a 3 axix CNC converted Conquest mill (from Chester UK) controlled by Mach3/Geckodrive G540 and recently got quite happy to make it work with the VFD (RPM controlled by Mach3).

For that I simply disconnected the potentiometer from the mill speed control  and replaced it by an analog optocoupler and a resistor. I know G540  VFD is already isolated, but the mill circuit board was powering the low voltage electronics directly from the 220V using a voltage divider... so it got me scared to simply plug the G540 directly.

The advantage of this approach is that I got a working VFD almost for free. The disavantage is that it is highly non-linear. The spindle only starts to turn at about 30 RPM when I command 400 RPM, it  gets close to the commanded value at about a 1000RPM then it undershoots.

So I thought "Lets use the Mach3 spindle calibration and it will work fine"... Well, wrong... for some reason the calibration, at least in my version of Mach3 would not work. Probably it works for correcting small deviations but for my cheapo VFD it was hopeless...

So I read some threads here about this problem and it seems somewhat usual. People referred to a file named "Linearity.dat" so I could not resist taking a look at it.

Long story short, the linearization strategy implemented in Mach3 is actually works great. The problem seems to be the function that generates the file, it probably does not assume that a VFD could be as bad as mine  :D.

So I wrote an Excel table that takes as input the commanded RPM vc Real RPM and produces a  "Linearity.dat" file that works fine.

I am attaching the Excel file so that you guys can try it out. CanĀ“t guarantee anything but that it worked for me. But if some of you have the same issue, I hope it helps.

The way it works is the following:

1- Only make changes to the GREEN cells.
2- Enter your min and max RPM. It will generate a list with 101 input values for you to fill.
3- For each entry, command your machine to spin at the COMMANDED column (blue), take note of the real RPM it is spinning and enter it in the MEASURED column (green)
4- Click the CREATE FILE button. It will run a macro that writes a linearization file. That is the  "Linearity.dat" file that Mach3 is able to read.
5- Shut down Mach3 and copy that file as to replace the one you have. In my case it happens to be at "C:\Mach3\macros\Mill_RS".
6- Start Mach3 and try to see if the RPM is correct now.

Hope it helps.


 
Could someone send me a copy of VB macro in this spreadsheet?  The one used to create the .dat file. Everytime I download the spreadsheet excel tells me macro is corrupt and deletes it.

Thanks,
Kelvin

Sent from my SM-P900 using Tapatalk
Re: Spindle calibration, how I manage to get it working
« Reply #25 on: April 15, 2020, 05:10:18 PM »
It work for my NEWever VFD.
Thanks a lot.
Re: Spindle calibration, how I manage to get it working
« Reply #26 on: May 15, 2020, 11:52:30 AM »
Hi Roger,

Hope you are still active on this forum.
Indeed i get the #REF! errors.

I want to measure from 500 to 24000. But if i input anything over 1500 in D3 i get the #REF! errors.
You write above:

You can NOT freely increase the maximum speed in the spreadsheet without updating the observed spindle speed column, as that may create invalid data in some spreadsheet cells (#REF I think).

How can i use your sheet and be able to measure from 500 to 24000 to create a nice linearity.dat file ?


Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Spindle calibration, how I manage to get it working
« Reply #27 on: May 15, 2020, 06:32:34 PM »
Hi Hobby

Ah - not my spreadsheet actually. I did play around with it a bit but the download was missing bits.
In the end I simply used a linear dat file and left it at that. FAR more important for me was using the latest ESS driver and getting it to work for threading - which it does.
The problem with the first S command after starting Mach3 remains. One gets used to it ...

Sorry about that.
Cheers
Roger
Re: Spindle calibration, how I manage to get it working
« Reply #28 on: July 10, 2020, 07:52:21 PM »
I had to register again just to post this, hope it helps someone someday.

Here is the macro from the spreadsheet talked about above, attached is a screen shot of the macros in the spreadsheet

Code: [Select]
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub spindle_correction_write_bin()
  Dim row As Long
  Dim x As Double
 
   
    Open "Linearity.dat" For Binary As #1
   
   
    For row = 3 To 103
        x = Cells(row, "N").Value
        Put #1, , x
    Next
    Close #1
End Sub
Re: Spindle calibration, how I manage to get it working
« Reply #29 on: November 29, 2020, 10:30:20 PM »
I recently changed drives from a Gecko G540 to a Leadshine MX4660 and later realized it has a 1.1V drop in its PWM to analog circuitry so the 0-10V output is actually 0-9V. As a result my spindle speed no longer tracked with S commands.

After searching found some threads about Linearity.dat, including this one. Unfortunately, I didn't have a copy of excel on my computer so I wasn't able to use the macro to generate the Linearity.dat file. I ended up writing a small python script to take a csv of measurements and output the dat file. Referencing it here in case someone else finds it useful: https://github.com/modbog/mach3linearity

it does some interpolation so I didn't have to take that many measurements to get a pretty accurate result. Here's the input from my test. Left column is the requested RPM, right column is the observed value using a digital tach:

Code: [Select]
0,0
1000,0
2000,1456
3000,2480
4000,4095
5000,5419
6000,6745
7000,8076
8000,9411
9000,10745
10000,12080
11000,13416
12000,14748
13000,16088
14000,17416
15000,18756
16000,20100
17000,21443
18000,21555
19000,21555
20000,21555
21000,21555
21555,21555

After calibration I got pretty accurate measurements.

Code: [Select]
0,0
1000,0
1500,1505
2000,2006
3000,2998
4000,3993
5000,4991
6000,5999
7000,7003
8000,7992
9000,8998
10000,9993
11000,10992
12000,11993
13000,12998
14000,13998
15000,14992
16000,15998
17000,17000
18000,17998
19000,18990
20000,19996
21000,21299
21561,21584