Spindle speed calibration
- bill.anderson
- Offline
- Junior Member
Less
More
- Posts: 29
- Thank you received: 0
16 Aug 2016 17:09 #78891
by bill.anderson
Spindle speed calibration was created by bill.anderson
I am using a Mesa 5i25 with a G540 using PWN to control a VFD driven spindle. How can I calibrate the spindle speed to the gcode "S" command. The only thing I've found that affects the speed speed seems to be the SCALE value in the .ini file. Nothing seems to affect the linearity.
Also how can I verify that Axis is seeing the index pulse I have set it up using a encoder?
Thanks
bill a
Also how can I verify that Axis is seeing the index pulse I have set it up using a encoder?
Thanks
bill a
Please Log in or Create an account to join the conversation.
19 Aug 2016 13:34 #79071
by andypugh
You could consider using a HAL component (lincurve) to linearise the response, but a better solution is probably to close the spindle-speed loop.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Closed...pindle_Speed_Control
Or, for extra-fancy, add spindle orient too:
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient
Replied by andypugh on topic Spindle speed calibration
The only thing I've found that affects the speed speed seems to be the SCALE value in the .ini file. Nothing seems to affect the linearity.
You could consider using a HAL component (lincurve) to linearise the response, but a better solution is probably to close the spindle-speed loop.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Closed...pindle_Speed_Control
Or, for extra-fancy, add spindle orient too:
wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrient
Please Log in or Create an account to join the conversation.
- bill.anderson
- Offline
- Junior Member
Less
More
- Posts: 29
- Thank you received: 0
19 Aug 2016 16:30 #79082
by bill.anderson
Replied by bill.anderson on topic Spindle speed calibration
Thanks for the leads, I am studying the advanced HAL tutorial hoping to learn to convert the example to use the Mesa 5i25 instead of the parallel port. I didn't plan on having to learn Linuxcnc internals in order to convert from Mach3 to Linuxcnc but it is what it is.
Please Log in or Create an account to join the conversation.
21 Aug 2016 23:40 #79224
by andypugh
Replied by andypugh on topic Spindle speed calibration
[quote="bill.anderson" post=79082 I didn't plan on having to learn Linuxcnc internals in order to convert from Mach3 to Linuxcnc.[/quote]
Are you saying that the spindle was more linear in Mach3?
Are you saying that the spindle was more linear in Mach3?
Please Log in or Create an account to join the conversation.
- bill.anderson
- Offline
- Junior Member
Less
More
- Posts: 29
- Thank you received: 0
22 Aug 2016 00:09 #79226
by bill.anderson
Replied by bill.anderson on topic Spindle speed calibration
No, it's just that I have never in the last eight years been able to successfully "thread" with Mach3. I have a Shoptask bridgemill and have used Mach3 to mill relatively successfully but never to "thread". I went to Linuxcnc not only to mill but also to "thread". I went with a Mesa 5i25 utilizing my existing G540. I am trying
to learn how to use my PWM VFD Spindle to accomplish this. Any help would be appreciated! I output pin 1 as Spindle CCW - pin 14 as Spindle PWM - pin 17 as Spindle CW. I've configured an encoder and use pin 10 as Index in. The only adjustment I seem to have is Scale in the ini file.
to learn how to use my PWM VFD Spindle to accomplish this. Any help would be appreciated! I output pin 1 as Spindle CCW - pin 14 as Spindle PWM - pin 17 as Spindle CW. I've configured an encoder and use pin 10 as Index in. The only adjustment I seem to have is Scale in the ini file.
Please Log in or Create an account to join the conversation.
22 Aug 2016 09:22 #79239
by andypugh
Replied by andypugh on topic Spindle speed calibration
Yes, scale is the only adjustment. You can be pretty confident that the PWM output is linear, so either the G540 PWm to Voltage or the Voltage to frequency in the VFD must be the source of the nonlinearity.
How bad is it? Spindle speed numerical accuracy isn't all that important as long as you can get the right speed consistently.
Closed-loop spindle speed control is a nice thing to have, though. However it involves a PID controller, and PID controllers always need a bit of adjustment.
How bad is it? Spindle speed numerical accuracy isn't all that important as long as you can get the right speed consistently.
Closed-loop spindle speed control is a nice thing to have, though. However it involves a PID controller, and PID controllers always need a bit of adjustment.
Please Log in or Create an account to join the conversation.
- bill.anderson
- Offline
- Junior Member
Less
More
- Posts: 29
- Thank you received: 0
22 Aug 2016 18:17 #79269
by bill.anderson
Replied by bill.anderson on topic Spindle speed calibration
Closing the loop around the index pulse is what I would like to achieve. The example you referred me to utilizes the parallel port. I am trying to figure out how to make it work with the Mesa 5i25 card.
Please Log in or Create an account to join the conversation.
22 Aug 2016 20:34 #79277
by andypugh
Replied by andypugh on topic Spindle speed calibration
Do you only have an index or is there A B quadrature + index?
To convert the parport config you simply swap encoder.N... for hm2_5i25.0.encoder.N...
To convert the parport config you simply swap encoder.N... for hm2_5i25.0.encoder.N...
Please Log in or Create an account to join the conversation.
- bill.anderson
- Offline
- Junior Member
Less
More
- Posts: 29
- Thank you received: 0
22 Aug 2016 21:50 #79282
by bill.anderson
Replied by bill.anderson on topic Spindle speed calibration
Just an index
Please Log in or Create an account to join the conversation.
22 Aug 2016 22:18 #79285
by andypugh
Workable, though not ideal.
You need to connect the index pulse to both the encoder index input pin _and_ the A-channel of the encoder, and then set the encoder to counter-mode. Set the encoder scale to 1.
I think pncconf should know how to do that. You just need to wire A and I inputs together (with wires, at the board) and edit the HAL file to enable counter-mode:
If you tell PnCConf that you are using a 5i25 with a pbx-rf11 (or something like that) then it will create a config for a simple breakout. The HAL config for a G540 end up looking exactly the same, the differences such as pin assignment on the DB25 are handled by the firmware flashed to the 5i25.
Replied by andypugh on topic Spindle speed calibration
Just an index
Workable, though not ideal.
You need to connect the index pulse to both the encoder index input pin _and_ the A-channel of the encoder, and then set the encoder to counter-mode. Set the encoder scale to 1.
I think pncconf should know how to do that. You just need to wire A and I inputs together (with wires, at the board) and edit the HAL file to enable counter-mode:
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.01.counter-mode 1
setp hm2_5i25.0.encoder.01.filter 1
setp hm2_5i25.0.encoder.01.index-invert 0
setp hm2_5i25.0.encoder.01.index-mask 0
setp hm2_5i25.0.encoder.01.index-mask-invert 0
setp hm2_5i25.0.encoder.01.scale [SPINDLE_9]ENCODER_SCALE
If you tell PnCConf that you are using a 5i25 with a pbx-rf11 (or something like that) then it will create a config for a simple breakout. The HAL config for a G540 end up looking exactly the same, the differences such as pin assignment on the DB25 are handled by the firmware flashed to the 5i25.
Please Log in or Create an account to join the conversation.
Time to create page: 0.074 seconds