- Configuring LinuxCNC
- Configuration Tools
- PnCConf Wizard
- Lathe Spindle Control Help Needed in PNCCONF
Lathe Spindle Control Help Needed in PNCCONF
on the vfd and 7i77
also what power supply are you using to supply field power on the 7i77 this needs to be >12v
Please Log in or Create an account to join the conversation.
If you wish to edit the INI file directly - under the [SPINDLE_9] heading, look for:
OUTPUT_SCALE = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0
and change to:
OUTPUT_SCALE = 660
OUTPUT_MIN_LIMIT = -660
OUTPUT_MAX_LIMIT = 660
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
- Posts: 80
- Thank you received: 1
PCW said to set:
OUTPUT_SCALE = 660
OUTPUT_MIN_LIMIT = -660
OUTPUT_MAX_LIMIT = 660
In PNCCONF, the labels for the fields that change that information in the INI are Analog Min Limit and Analog Max Limit. Every time I saw them, I thought that the meant the max and min voltages that I wanted to send to the VFD, so I only changed them to numbers other than +- 10 a couple of times, (apparently while something else was set incorrectly because it didn't work), then changed them back.
Thanks to everyone for all the help! That's one hurdle behind me, now I have to figure out how to set up the gear change ratios. I have switches that indicate what gear the lathe is in, so hopefully I won't need to make a ratio comparison. Hopefully I just need to take the switch inputs and apply a fixed ratio to set the speeds based on their state. Anyone have a link or some input on how to do that?
Mr. Technical
Please Log in or Create an account to join the conversation.
Hopefully I just need to take the switch inputs and apply a fixed ratio to set the speeds based on their state. Anyone have a link or some input on how to do that?
If you look at where the INI values are used in the HAL file you will see:
setp hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE_9]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout5-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
So, you need to change that to work a different way.
The exact way to do it will depend on the outputs of your gear position switches, but the tool for the job is a "mux" (multiplexer).
linuxcnc.org/docs/html/man/man9/mux4.9.html
That has two input bits (from your switches) which choose between 4 values. You need to choose the input values to suit your switch pattern (and if you have more than 2 switches, look at mux8 instead, it's OK to ignore unused patterns).
Then you will end up with (as an example)
setp mux4.0.in0 0
setp mux4.0.in1 660
setp mux4.0.in2 2000
setp mux4.0.in3 10000000 #One meeeelion rpm!
net spindle-max mux4.0.out
net spindle-max hm2_5i25.0.7i77.0.1.analogout5-scalemax
net spindle-max hm2_5i25.0.7i77.0.1.analogout5-minlim
net spindle-max hm2_5i25.0.7i77.0.1.analogout5-maxlim
(if you prefer, that net can all be on one line:
net spindle-max mux4.0.out hm2_5i25.0.7i77.0.1.analogout5-scalemax hm2_5i25.0.7i77.0.1.analogout5-minlim hm2_5i25.0.7i77.0.1.analogout5-maxlim
You need to net the two "sel" pins to the switch inputs too, of course.
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
- Posts: 80
- Thank you received: 1
Mr. Technical
Please Log in or Create an account to join the conversation.
to make a minor adjustment to C Morely's comment:
If you wish to edit the INI file directly - under the [SPINDLE_9] heading, look for:
OUTPUT_SCALE = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0
and change to:
OUTPUT_SCALE = 660
OUTPUT_MIN_LIMIT = -660
OUTPUT_MAX_LIMIT = 660
Hey Peter:
would
OUTPUT_SCALE = 660/10
OUTPUT_MIN_LIMIT = -10
OUTPUT_MAX_LIMIT = 10
have worked also?
and if one wanted +-5 volts (for a max rpm of 660) instead would it have been:
OUTPUT_SCALE = 660
OUTPUT_MIN_LIMIT = -330
OUTPUT_MAX_LIMIT = 330
or would this have worked?:
OUTPUT_SCALE =660/5
OUTPUT_MIN_LIMIT = -5
OUTPUT_MAX_LIMIT = 5
Chris M
Please Log in or Create an account to join the conversation.
would
OUTPUT_SCALE = 660/10
OUTPUT_MIN_LIMIT = -10
OUTPUT_MAX_LIMIT = 10
have worked also?
No, unless you wanted the max output to be 10V / 66
and if one wanted +-5 volts (for a max rpm of 660) instead would it have been:
OUTPUT_SCALE = 660
OUTPUT_MIN_LIMIT = -330
OUTPUT_MAX_LIMIT = 330
That will limit the full scale output to +-5V (limit reached at 330)
If you wanted to limit the output to +-5V but have 660 as full scale
you would set
OUTPUT_SCALE = 1320
OUTPUT_MIN_LIMIT = -660
OUTPUT_MAX_LIMIT = 660
or would this have worked?:
OUTPUT_SCALE =660/5
OUTPUT_MIN_LIMIT = -5
OUTPUT_MAX_LIMIT = 5
660/5 is 132 so this would limit the max output voltage to 10*5/132 = ~0.378V
The important thing to understand is that the MAX_LIMIT and MIN_LIMIT parameters limit the range of the analog value _BEFORE_ its scaled
into volts, so if you set OUTPUT_SCALE to 10000 for a 10000 RPM spindle, MAX_LIMIT had better be 10000 or you will not get full output
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
- Posts: 80
- Thank you received: 1
After more investigation, it looks like the gear position is based on a truth table of 5 switches (LS31-LS35).
Neutral= LS32 and LS34 on
High= LS33 and LS34 on
Mid= LS32 and LS35 on
Low= LS31 and LS34 on
Low gear is what we've been discussing and has a top speed of 660 RPM. Mid gear is double that and maxes out at 1330 RPM and High gear is double Mid gear and tops out at 2660 RPM.
Is a mux8 the way to go here, or would you recommend a component to handle the logic. I really don't want to do it in classicladder, so hopefully one of these options will work. Thanks,
Mr. Technical
Please Log in or Create an account to join the conversation.
Is a mux8 the way to go here, or would you recommend a component to handle the logic
The switch logic is a bit odd, and mux8 only has 3 inputs.
www.linuxcnc.org/docs/html/man/man9/mux8.9.html
You need 5 inputs, which would be mux32, which doesn't exist. So you will need mux_generic.
www.linuxcnc.org/docs/html/man/man9/mux_generic.9.html
loadrt mux_generic config=ff32
You can work out the binary-number equivalents of the inputs from your truth-table, but there might be a more foolproof way:
Populate in0 with -1, in1 with 1, in2 with 2, in3 with 3 and so on up to in31. Then use halmeter to look at the output of the mux_gen in each gear, and populate _that_ input with the right number.
I think that Low will be 9, Mid 18 and high 12.
Actually... looking at the truth-table, if you are prepared to treat neutral as the same as Mid, you can actually use mux8 and just connect 31, 32 and 33.
Please Log in or Create an account to join the conversation.
- Mr. Technical
- Offline
- Premium Member
- Posts: 80
- Thank you received: 1
One thing that might have a bearing on this is that the limit switch numbers are arbitrary (or at least only how they used to be numbered). I think I could rename them fairly easily so that LS31 becomes LS1, and do the same up through LS35/LS5. Would that help?You can work out the binary-number equivalents of the inputs from your truth-table, but there might be a more foolproof way:
Populate in0 with -1, in1 with 1, in2 with 2, in3 with 3 and so on up to in31. Then use halmeter to look at the output of the mux_gen in each gear, and populate _that_ input with the right number.
Actually... looking at the truth-table, if you are prepared to treat neutral as the same as Mid, you can actually use mux8 and just connect 31, 32 and 33.
I like the sound of this one; it seems simplest. It's a possibility, but I need to see if there's a state that would cause problems, like one of the gear-change solenoids not firing or releasing.
Thanks as always,
Mr. Technical
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Configuration Tools
- PnCConf Wizard
- Lathe Spindle Control Help Needed in PNCCONF