Lathe Spindle Control Help Needed in PNCCONF

More
09 Oct 2014 22:58 - 09 Oct 2014 23:18 #51921 by cncbasher
how are you connecting to the vfd ...can you identify the pins please
on the vfd and 7i77

also what power supply are you using to supply field power on the 7i77 this needs to be >12v
Last edit: 09 Oct 2014 23:18 by cncbasher.

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

More
09 Oct 2014 23:52 - 09 Oct 2014 23:53 #51922 by PCW
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
Last edit: 09 Oct 2014 23:53 by PCW. Reason: remove duplication
The following user(s) said Thank You: Mr. Technical

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

More
10 Oct 2014 00:46 #51925 by Mr. Technical
That did it! :cheer:

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.

More
10 Oct 2014 01:22 #51927 by andypugh

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
Or combinations of the two formats.

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.

More
10 Oct 2014 02:41 #51928 by Mr. Technical
Thanks Andy. That's just what I was looking for. I'll digest this, and see if I can do it without too much trouble. We'll see.

Mr. Technical

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

More
10 Oct 2014 07:30 #51932 by cmorley

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.

More
10 Oct 2014 09:03 - 10 Oct 2014 09:10 #51935 by PCW

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
Last edit: 10 Oct 2014 09:10 by PCW.

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

More
10 Oct 2014 22:51 #51950 by Mr. Technical
Hi Andy,

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.

More
10 Oct 2014 23:28 #51954 by andypugh

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
Connect LS31 to sel0, LS32to sel1 and so on
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.

More
11 Oct 2014 01:31 #51958 by Mr. Technical
Looks like I need to do some reading and thinking :)

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.

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?

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.

Moderators: cmorley
Time to create page: 0.137 seconds
Powered by Kunena Forum