Spindle speed control
24 May 2014 05:49 #47267
by billn
Spindle speed control was created by billn
Hello, I just added a two relay board to my gantry mill to enable the CW and CCW rotation of my spindle. I'm using PDM mode to control the speed of the Huanyang VFD. I have an issue with the speed of the spindle running at the correct RPM with M3, but when the direction is reversed, M4, the spindle RPM's drop considerably. I've checked the voltage from LinuxCNC going to my VFD and it is lower on the M4 command than on the M3. Am I missing something on the configuration that is effecting the RPM's on the CCW direction? I'm not using any special HAL files at all. Does anyone have any Idea what I need to tweak to maintain the same RPM regardless of the spindle rotation? Thanks for your help in advance. Bill N.
Please Log in or Create an account to join the conversation.
24 May 2014 06:48 #47268
by PCW
Replied by PCW on topic Spindle speed control
Are you using the pwmgen in mode 1?
The pwmgen needs to be in mode 1 to support signed
PWM values and the spindle speed is signed in HAL
The pwmgen needs to be in mode 1 to support signed
PWM values and the spindle speed is signed in HAL
Please Log in or Create an account to join the conversation.
24 May 2014 06:55 #47269
by billn
Replied by billn on topic Spindle speed control
Thanks for your reply, When I access my "my-mill.hal" file, it shows "loadrt pwmgen output_type=1" Is this correct?
Please Log in or Create an account to join the conversation.
28 May 2014 07:06 #47428
by billn
Replied by billn on topic Spindle speed control
Could the speed issue be due to a configuration issue in my "Stepconf"? It seems the pwmgen.0.value in the Hal meter shows a negitive number during a CCW rotation. Is this correct? I'm not sure what steps to take to trouble shoot this issue. Thanks for any input possible.
Please Log in or Create an account to join the conversation.
29 May 2014 00:58 #47474
by andypugh
Can you attach the HAL file?
Replied by andypugh on topic Spindle speed control
Could the speed issue be due to a configuration issue in my "Stepconf"
Can you attach the HAL file?
Please Log in or Create an account to join the conversation.
29 May 2014 02:49 #47479
by billn
Replied by billn on topic Spindle speed control
Yes, Please see the attached file. Thanks for your help. Bill N.
Please Log in or Create an account to join the conversation.
29 May 2014 03:35 #47485
by andypugh
Replied by andypugh on topic Spindle speed control
setp pwmgen.0.offset -0.0175949367089
is a bit of a surprise. What do you get if you set that to 0?
I am a bit surprised by the negative scale too. That is one way to reverse the motor direction, though, and no less valid than any other.
is a bit of a surprise. What do you get if you set that to 0?
I am a bit surprised by the negative scale too. That is one way to reverse the motor direction, though, and no less valid than any other.
Please Log in or Create an account to join the conversation.
29 May 2014 04:30 #47488
by billn
Replied by billn on topic Spindle speed control
We're on to something, After changing the value to 0 the speed is the same in both directions but on a programmed speed of 1000 RPM's, it's running at 744 RPM's. Can I now go back into my stepconfg and readjust the spindle calibration? Bill N.
Please Log in or Create an account to join the conversation.
29 May 2014 04:46 - 29 May 2014 04:46 #47489
by andypugh
You can, but first you need to find the right number.
With LinuxCNC running open a terminal window and typeto open a command-line HAL session. Then try repeatedvalues until the spindle speed is correct.
Then try it at some different speeds and see if you get the right speed there too. You might find that the response is non-linear. If it is then we can advise further.
typeto get out of the HAL session.
Once you have found the correct scale number you can either put it in with Stepconf, or leave Stepconf behind and edit the HAL/INI files directly to put the new value in.
Replied by andypugh on topic Spindle speed control
Can I now go back into my stepconfg and readjust the spindle calibration? Bill N.
You can, but first you need to find the right number.
With LinuxCNC running open a terminal window and type
halcmd -kf
setp pwmgen.0.scale -300000
Then try it at some different speeds and see if you get the right speed there too. You might find that the response is non-linear. If it is then we can advise further.
type
exit
Once you have found the correct scale number you can either put it in with Stepconf, or leave Stepconf behind and edit the HAL/INI files directly to put the new value in.
Last edit: 29 May 2014 04:46 by andypugh.
Please Log in or Create an account to join the conversation.
29 May 2014 06:42 #47492
by billn
Replied by billn on topic Spindle speed control
Its perfect! Before I noticed your last post, I was tweaking my spindle calibration and found the following values provide the correct RPM's within a couple of percent throughout the RPM range with the speeds the same in both directions. I found that
speed1 1300 pwm .055
speed2 13000 pwm .55
are the correct values for the machine.
I'm real happy with the accuracy of the programmed VS actual speed, I hate to touch it now other than to backup my settings at this point. Thanks for your help on this, It is appreciated!
Bill N.
speed1 1300 pwm .055
speed2 13000 pwm .55
are the correct values for the machine.
I'm real happy with the accuracy of the programmed VS actual speed, I hate to touch it now other than to backup my settings at this point. Thanks for your help on this, It is appreciated!
Bill N.
Please Log in or Create an account to join the conversation.
Time to create page: 0.098 seconds