Lathe Spindle Control Help Needed in PNCCONF

More
16 Oct 2014 05:20 #52128 by Mr. Technical
Hi Andy,

I've been reading about the mux4 tool, and have decided to practice with that instead of going right to the mux_generic suggestion that you gave in order to ease the learning curve. I made the changes that you suggested to my custom postgui hal, but I'm getting the following error message (in part):

Debug file information:
Can not find -sec MOT -var MOT -num 1
Can not find -sec IO -var IO -num 1
Can not find -sec LINUXCNC -var NML_FILE -num 1
Can not find -sec EMC -var NML_FILE -num 1
custom_postgui.hal:23: Pin 'hm2_5i25.0.7i77.0.1.analogout5-scalemax' does not exist
24029
PID TTY STAT TIME COMMAND
24110
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

Here's what I have added to the custom_postgui hal file:

loadrt mux4 count=1
addf mux4.0 servo-thread


#*****************
#Start mux testing
setp mux4.0.in0 0
setp mux4.0.in1 660
setp mux4.0.in2 1330
setp mux4.0.in3 2660 #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

I haven't changed the main HAL file or the INI file at all.

Also, you'll notice that I haven't netted the 2 "sel" pins to the switch inputs yet.
Am I forgetting something, or doing it wrong?

Mr. Technical

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

More
16 Oct 2014 06:32 #52129 by andypugh

custom_postgui.hal:23: Pin 'hm2_5i25.0.7i77.0.1.analogout5-scalemax' does not exist


It looks like I got the name of the analogue outputs wrong.
(I don't have a 7i77, so I had to guess).

Right at the top of your custom_postgui (you could actually use another custom hal file, your new stuff doesn't need to be in the postgui hal really) put the command
show pin
then start linuxCNC from the command-line.
Eventually your terminal window will show a list of every single HAL pin, copy and paste that to a text file for future reference.

Then work out exactly what analogue out 5 is really called (maybe hm2_5i25.0.7i77.0.1.analogout05-scalemax')

Also, you'll notice that I haven't netted the 2 "sel" pins to the switch inputs yet.


One step at a time is probably wise.

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

More
16 Oct 2014 15:42 #52135 by cncbasher
hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE_9] OUTPUT_SCALE
is correct if it helps

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

More
16 Oct 2014 23:18 #52137 by Mr. Technical
Thanks for the help guys. Still no go.

Here's where I'm at:

I copied and pasted the following from my main hal file to the custom_postgui hal file:

hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE_9]OUTPUT_SCALE
hm2_5i25.0.7i77.0.1.analogout5-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT

Then I added this prefix to each line: net spindle-max

Now the
custom_postgui hal file says this:
net spindle-max hm2_5i25.0.7i77.0.1.analogout5-scalemax [SPINDLE_9]OUTPUT_SCALE
net spindle-max hm2_5i25.0.7i77.0.1.analogout5-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
net spindle-max hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT

When I run linuxcnc it get the following debug message:
Debug file information:
Can not find -sec MOT -var MOT -num 1
Can not find -sec IO -var IO -num 1
Can not find -sec LINUXCNC -var NML_FILE -num 1
Can not find -sec EMC -var NML_FILE -num 1
custom_postgui.hal:24: Pin 'hm2_5i25.0.7i77.0.1.analogout5-scalemax' does not exist
9318
PID TTY STAT TIME COMMAND
9374
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

If I comment out those 3 lines and show hal config, I can confirm that there is a pin called "hm2_5i25.0.7i77.0.1.analogout5" which has the signal "spindle-vel-cmd" netted to it. I don't see the scalemax suffix on this pin here nor anywhere else.

I ran show pin from both the main hal file and the custom_postgui one, then started linuxcnc using the icon, and copied out the pin list from each error message. (Hopefully that gives a full picture). The pin lists both show this line:
12 float IN 0 hm2_5i25.0.7i77.0.1.analogout5 <== spindle-vel-cmd

Any ideas?

Mr. Technical

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

More
16 Oct 2014 23:27 #52138 by andypugh

net spindle-max hm2_5i25.0.7i77.0.1.analogout5-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT


You can't "net" a pin to an INI file value.
You can't "net" a parameter at all.

You need to use "setp" in the lines above, to set the parameter to the value defined in the INI (or you can use absolute values right there in the HAL)

There is no signal name in a "setp" either.

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

More
17 Oct 2014 00:26 #52140 by Mr. Technical
I guess I'm rustier than I thought after months away from this. I made the changes that you suggested, but get the following message:

Debug file information:
Can not find -sec MOT -var MOT -num 1
Can not find -sec IO -var IO -num 1
Can not find -sec LINUXCNC -var NML_FILE -num 1
Can not find -sec EMC -var NML_FILE -num 1
custom_postgui.hal:24: setp requires 2 arguments, 3 given
15714
PID TTY STAT TIME COMMAND
15770
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

I'm posting the 3 files that could be related to this error; my ini, hal, and custom postgui hal. It would probably save you time to see the whole picture instead of just seeing the parts that I think are relevant. I'm just trying to get it to load so that I can learn about the mux tool and get my gear change working. Thanks a lot for breaking it down for me.

Mr. Technical
Attachments:

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

More
17 Oct 2014 00:29 #52141 by andypugh

custom_postgui.hal:24: setp requires 2 arguments, 3 given


The problem is that setp needs 2 arguments, and you have given it three.

So, I assume that you didn't read as far as where I said "there is no signal name in a setp either"

What happens if you just copy and paste from www.linuxcnc.org/index.php/french/forum/...cconf?start=10#51927 ?

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

More
17 Oct 2014 00:39 #52143 by andypugh
Ooops! I just realised that this is all my fault....

Looking at the source-code, scalemax, minlim and maxlim are _parameters_.

This is why they don't show up in the pin list, and why you can't make them part of a net.

I seem to have led you down completely the wrong track..

The actual way to do this is slightly different. You need to set the scalemax / minlim / maxlim to either the highest or lowest speed (your choice) then use the mux component to set the factor of a "scale" component that modifies the spindle-speed-command before it is sent to the analog output.

So, in high gear scale = 1 and 2200 = 10V
in low gear scale = 3.3333, command = 330, scale output = 2200, command voltage = 10V

www.linuxcnc.org/docs/html/man/man9/scale.9.html

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

More
17 Oct 2014 02:41 - 17 Oct 2014 02:46 #52147 by Mr. Technical
Ok, that makes sense. I already have a scale loaded from the main hal ("loadrt scale names=scale.spindle" and then "addf scale.spindle servo-thread" ).
I'm having issues with syntax (I think) adding another iteration of scale. Can you show me the exact text that I need to enter to get the scale.gears function loaded together with that? At this point, it's all starting to run together and drip out my ears. :)

Mr. Technical
BTW, high gear is 2660 spindle RPM max speed, mid gear is 1330RPM max speed, and low gear is 660rpm max speed.
High gear has a min speed of 1330, mid gear has a min speed of 660, and low gear has a min speed of say 50 rpm.
Last edit: 17 Oct 2014 02:46 by Mr. Technical. Reason: Additional info

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

More
17 Oct 2014 03:25 #52148 by andypugh
Try this HAL file, and remove the spindle stuff from custom-postgui
Attachments:
The following user(s) said Thank You: Mr. Technical

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

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