Spindle speed tuning

More
23 Mar 2021 20:37 #203429 by mooser
Spindle speed tuning was created by mooser
On my lathe that I've been using for a while, the spindle speed is consistently (or at least seems to be) a bit slow compared to what I'm commanding (m3 s1250 will give typically a 1210 rpm output according to the encoder and my tach)
For no good reason i would like it to be closer so I wanted to tweak the setting a little without re-running the entire setup processes and screwing something else up
Where is the "factor" for spindle / VFD speed located. I looked through the different ini files and tried a couple of different places that seemed logical but they had no affect.
Thanks

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

More
23 Mar 2021 21:20 #203433 by chris@cnc
Replied by chris@cnc on topic Spindle speed tuning
If the encoder is connected, the pid controller should correct this. In this case increase the P value in the ini file section Spindle. If the encoder is not connected, check the parameters of your VDF. Maybe there is a parameter to compensate for the analog signal. Another possibility would be to reduce the max speed in your ini file by 3.3 percent. That should work too.
Chris

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

More
23 Mar 2021 23:00 #203458 by andypugh
Replied by andypugh on topic Spindle speed tuning
If you don't already have closed-loop spindle control (with a PID) then you could add it in.

Can you post your HAL and INI? Quite often systems are configured with the structure of closed-loop but open-loop with FF0 only.

I would expect the I term of the PID to do most of the work in a spindle application.

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

More
24 Mar 2021 00:52 #203476 by mooser
Replied by mooser on topic Spindle speed tuning
When I originally set it up I didn't have the encoder and added it a little later. I've threaded so the index is working etc but now I'm wondering if I never made it feedback the speed....
I'll copy out the HAL and INI tomorrow and post

Thanks
M

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

More
24 Mar 2021 18:57 #203532 by mooser
Replied by mooser on topic Spindle speed tuning
ini and hal

File Attachment:

File Name: SM_Lathe.hal
File Size:10 KB

File Attachment:

File Name: SM_Lathe.ini
File Size:4 KB


M
Attachments:

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

More
24 Mar 2021 22:28 #203552 by chris@cnc
Replied by chris@cnc on topic Spindle speed tuning
I remember some weeks ago to read same problem here. forum.linuxcnc.org/39-pncconf/41183-solv...ck-correctly?start=0
It seems this could be solved your problem.
The following user(s) said Thank You: mooser

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

More
25 Mar 2021 00:55 #203560 by mooser
Replied by mooser on topic Spindle speed tuning
Made some of the changes and I may or may not have helped. According to my tach the speed in and around 750 up to 1500 seems better but anything under the 750 is now way off (500 is reading 250 on the tach)
Normally I'd switch gears to a lower one for that speed so it's not really an issue.

That said, one of the lines I changed has made the on-screen rpm gauge stop working so I'll need to have another look at what those 4 or 5 lines actually did to figure it out.

But progress was made, thanks
M

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

More
25 Mar 2021 23:24 #203652 by mooser
Replied by mooser on topic Spindle speed tuning
OK, I seem to have the lower speeds dialed in (still lost the on-screen tach but that's something else)

So how does it use the encoder to control the signal going to the VFD

I thought:
I send a command for 1500rpm, the board is feeding my VFD increasing signals until it gets 1500 back from the encoder
drop to 1000 and it reduces until it reads 1000
The max speed (and VFD output) is in the settings so there's a limit to how high so if I command 3000 it will go as high as it can

But there has to be more to it than that or it would still work if I changed gears
M

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

More
26 Mar 2021 11:52 #203697 by chris@cnc
Replied by chris@cnc on topic Spindle speed tuning
Basically is the way: Programmed speed -> analog output set -> VDF frequency set -> encoder to nc -> PID correct analog output
Example for 3000rpm max speed set in ini file:
1500rpm programmed -> 5V analog out set -> VDF frequency set half speed -> 1490rpm from encoder to nc -> PID correct 5V little higher.

But i realize now you have a gearbox and this work little different. I never set up a config with gearbox but i guess you have to use additional function in hal like
linuxcnc.org/docs/2.8/html/man/man9/gearchange.9.html
forum.linuxcnc.org/10-advanced-configura...ration-help?start=10.
I found this in forum. But i know many users have a gearbox with encoder running. Maybe one user have a hal example for us.

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

More
26 Mar 2021 21:19 #203753 by mooser
Replied by mooser on topic Spindle speed tuning
Thanks, I've been through a couple of those threads trying to figure out the gearbox, even with Andy's help back when I first put this version together and never really managed to wrap my head around it. Mainly I guess since I'm not very understanding on how the HAL is actually working type of thing.
I keep telling myself I need to put another computer together here in the house to experiment with but that never gets to the front burner.

As for the closed loop spindle, maybe what I'm missing is that there must be a limit to how much "tweak" that the feedback can do at any given point. Maybe it's limited to a +/- 10% or something?

M

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

Time to create page: 0.134 seconds
Powered by Kunena Forum