Spindle scaling factor

More
17 Jan 2013 21:55 #28771 by Diederik
I have now tried the following in my .hal file, but still does not work:
loadrt mux8 count=1
addf mux8.0 servo-thread
net gearbox1 mux8.0.sel0
net gearbox2 mux8.0.sel1
net gearbox3 mux8.0.sel2

setp hm2_5i25.0.7i77.0.1.analogout2-scalemax mux8.0.out

setp mux8.0.in1 400
setp mux8.0.in2 800
setp mux8.0.in4 1600

net gearbox1 hm2_5i25.0.7i77.0.0.input-07-not

net gearbox2 hm2_5i25.0.7i77.0.0.input-14-not

net gearbox3 hm2_5i25.0.7i77.0.0.input-15-not


then I get the following error:

rivol-gun-drill.hal:419: value 'mux8.0.out' invalid for float

please. can someone help me? basically: when pin 07 then output scale must be 400, when pin 14 true, then output scale must be 800, and when pin 1600 is true, then output must be 1600

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

More
17 Jan 2013 22:11 #28775 by Diederik
Replied by Diederik on topic Spindle scaling factor
sorry. here's the files.

I tried analogout 2 = 400 and 400.0
analogout2 is float in, and mux8.0.out is float out

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

More
17 Jan 2013 22:17 #28777 by BigJohnT
Replied by BigJohnT on topic Spindle scaling factor
What was the error?

For some reason your files are not attaching, do you have dashes or something in the name?

John

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

More
17 Jan 2013 22:27 #28778 by Diederik
Replied by Diederik on topic Spindle scaling factor
Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/realtime-2.6.32-122-rtai/modules/linuxcnc
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/share/linuxcnc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.5
LINUXCNC - 2.5.1
Machine configuration directory is '/home/ptd002/linuxcnc/configs/Mazak M4'
Machine configuration file is 'rivol-gun-drill.ini'
INIFILE=/home/ptd002/linuxcnc/configs/Mazak M4/rivol-gun-drill.ini
PARAMETER_FILE=linuxcnc.var
TASK=milltask
HALUI=halui
DISPLAY=axis
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Shutting down and cleaning up LinuxCNC...
Running HAL shutdown script
Killing task linuxcncsvr, PID=5023
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Cleanup done

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
rivol-gun-drill.hal:419: value 'mux8.0.out' invalid for float
rivol-gun-drill.hal:419: setp failed
5023
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

Kernel message information:
[18979.281047] I-pipe: Domain RTAI registered.
[18979.281059] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[18979.281064] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[18979.281128] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[18979.281132] PIPELINE layers:
[18979.281137] f82d9e20 9ac15d93 RTAI 200
[18979.281142] c085cb20 0 Linux 100
[18979.323444] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[18979.324007] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[18979.324019] RTAI[sched]: hard timer type/freq = APIC/8333588(Hz); default timing: periodic; linear timed lists.
[18979.324026] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1866907000 hz.
[18979.324031] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[18979.324145] RTAI[usi]: enabled.
[18979.403239] RTAI[math]: loaded.
[18979.525266] hm2: loading Mesa HostMot2 driver version 0.15
[18979.530064] hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7
[18979.530121] pci 0000:00:1e.0: can't derive routing for PCI INT A
[18979.530127] hm2_pci 0000:02:0d.0: PCI INT A: no GSI - using IRQ 10
[18979.530136] hm2_pci: discovered 5i25 at 0000:02:0d.0
[18979.532165] hm2/hm2_5i25.0: Smart Serial Firmware Version 33
[18979.661750] hm2/hm2_5i25.0: 34 I/O Pins used:
[18979.661759] hm2/hm2_5i25.0: IO Pin 000 (P3-01): IOPort
[18979.661765] hm2/hm2_5i25.0: IO Pin 001 (P3-14): IOPort
[18979.661771] hm2/hm2_5i25.0: IO Pin 002 (P3-02): IOPort
[18979.661778] hm2/hm2_5i25.0: IO Pin 003 (P3-15): Smart Serial Interface #0, pin TxData1 (Output)
[18979.661785] hm2/hm2_5i25.0: IO Pin 004 (P3-03): Smart Serial Interface #0, pin RxData1 (Input)
[18979.661793] hm2/hm2_5i25.0: IO Pin 005 (P3-16): Smart Serial Interface #0, pin TxData0 (Output)
[18979.661800] hm2/hm2_5i25.0: IO Pin 006 (P3-04): Smart Serial Interface #0, pin RxData0 (Input)
[18979.661807] hm2/hm2_5i25.0: IO Pin 007 (P3-17): Muxed Encoder Select #0, pin Mux Select 0 (Output)
[18979.661814] hm2/hm2_5i25.0: IO Pin 008 (P3-05): Muxed Encoder #0, pin Muxed A (Input)
[18979.661821] hm2/hm2_5i25.0: IO Pin 009 (P3-06): Muxed Encoder #0, pin Muxed B (Input)
[18979.661828] hm2/hm2_5i25.0: IO Pin 010 (P3-07): Muxed Encoder #0, pin Muxed Index (Input)
[18979.661835] hm2/hm2_5i25.0: IO Pin 011 (P3-08): Muxed Encoder #1, pin Muxed A (Input)
[18979.661842] hm2/hm2_5i25.0: IO Pin 012 (P3-09): Muxed Encoder #1, pin Muxed B (Input)
[18979.661849] hm2/hm2_5i25.0: IO Pin 013 (P3-10): Muxed Encoder #1, pin Muxed Index (Input)
[18979.661856] hm2/hm2_5i25.0: IO Pin 014 (P3-11): Muxed Encoder #2, pin Muxed A (Input)
[18979.661863] hm2/hm2_5i25.0: IO Pin 015 (P3-12): Muxed Encoder #2, pin Muxed B (Input)
[18979.661870] hm2/hm2_5i25.0: IO Pin 016 (P3-13): Muxed Encoder #2, pin Muxed Index (Input)
[18979.661876] hm2/hm2_5i25.0: IO Pin 017 (P2-01): IOPort
[18979.661882] hm2/hm2_5i25.0: IO Pin 018 (P2-14): IOPort
[18979.661887] hm2/hm2_5i25.0: IO Pin 019 (P2-02): IOPort
[18979.661893] hm2/hm2_5i25.0: IO Pin 020 (P2-15): IOPort
[18979.661898] hm2/hm2_5i25.0: IO Pin 021 (P2-03): IOPort
[18979.661903] hm2/hm2_5i25.0: IO Pin 022 (P2-16): IOPort
[18979.661908] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
[18979.661915] hm2/hm2_5i25.0: IO Pin 024 (P2-17): Muxed Encoder Select #3, pin Mux Select 0 (Output)
[18979.661921] hm2/hm2_5i25.0: IO Pin 025 (P2-05): IOPort
[18979.661927] hm2/hm2_5i25.0: IO Pin 026 (P2-06): IOPort
[18979.661932] hm2/hm2_5i25.0: IO Pin 027 (P2-07): IOPort
[18979.661937] hm2/hm2_5i25.0: IO Pin 028 (P2-08): IOPort
[18979.661945] hm2/hm2_5i25.0: IO Pin 029 (P2-09): IOPort
[18979.661951] hm2/hm2_5i25.0: IO Pin 030 (P2-10): IOPort
[18979.661956] hm2/hm2_5i25.0: IO Pin 031 (P2-11): IOPort
[18979.661961] hm2/hm2_5i25.0: IO Pin 032 (P2-12): IOPort
[18979.661967] hm2/hm2_5i25.0: IO Pin 033 (P2-13): IOPort
[18979.662127] hm2/hm2_5i25.0: registered
[18979.662132] hm2_5i25.0: initialized AnyIO board at 0000:02:0d.0
[18979.674953] config string '0 in'
[18979.708179] creating ladder-state
[18980.302109] hm2_5i25.0: dropping AnyIO board at 0000:02:0d.0
[18980.302121] hm2/hm2_5i25.0: unregistered
[18980.302157] pci 0000:00:1e.0: can't derive routing for PCI INT A
[18980.302211] hm2_pci: driver unloaded
[18980.306949] hm2: unloading
[18980.371584] RTAI[math]: unloaded.
[18980.395878] SCHED releases registered named ALIEN RTGLBH
[18980.428354] RTAI[malloc]: unloaded.
[18980.526749] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[18980.530928] I-pipe: Domain RTAI unregistered.
[18980.531007] RTAI[hal]: unmounted.

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

More
17 Jan 2013 23:30 - 17 Jan 2013 23:47 #28781 by PCW
Replied by PCW on topic Spindle scaling factor
what about

net spindle_scale hm2_5i25.0.7i77.0.1.analogout2-scalemax mux8.0.out

because AFAIK setp only works with numeric constants, not named signals like mux8.0.out
Last edit: 17 Jan 2013 23:47 by PCW.

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

More
17 Jan 2013 23:37 #28782 by BigJohnT
Replied by BigJohnT on topic Spindle scaling factor

rivol-gun-drill.hal:419: value 'mux8.0.out' invalid for float
rivol-gun-drill.hal:419: setp failed


This is the error AFAIKT.

Is your mux in values still integers?
setp mux8.0.in1 400
setp mux8.0.in2 800
setp mux8.0.in4 1600

Or have you changed them to floats?
setp mux8.0.in1 400.0
setp mux8.0.in2 800.0
setp mux8.0.in4 1600.0

John

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

More
18 Jan 2013 00:01 #28783 by Diederik
Replied by Diederik on topic Spindle scaling factor
I suspect what the problem might be.

hm2_5i25.0.7i77.0.1.analogout2-scalemax might be a parameter asignment (help me if I'm wrong)
so to setp hm2_5i25.0.7i77.0.1.analogout2-scalemax 400 works fine,
hm2_5i25.0.7i77.0.1.analogout2-scalemax (spindle_9)output-scale works because it is a constant,
hm2_5i25.0.7i77.0.1.analogout2-scalemax mux8.0.out will then not work because it is a float(it can vary while program runs)(help me if I'm wrong)
so: my conclusion: the way that the firmware is done, might not allow this.
but then again, when I look at hal-show, hm2_5i25.0.7i77.0.1.analogout2-scalemax is a float in, and Mux8.0.out is float out. I need to crack this tonight...
Peter: I think you might be able to help with this one?
I tried
net spindle_scale, then it comes with other errors. says pin "hm2_5i25.0.7i77.0.1.analogout2-scalemax" does not exist.

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

More
18 Jan 2013 00:06 - 18 Jan 2013 00:27 #28784 by PCW
Replied by PCW on topic Spindle scaling factor
Ahh yes the XXXXX.analogout2-scalemax are parameters, not pins so
cannot be changed dynamically (this is a driver choice, not related to firmware)

So you will probably have to use the scale component in series with the analog_out signal
to accomplish what you want.

Note that the scale component multiplies by the scale value instead of divides so the
mux input constants would be inverse's, for example

setp hm2_5i25.0.7i77.0.1.analogout2-scalemax 1600

setp mux8.0.in1 4
setp mux8.0.in2 2
setp mux8.0.in4 1

net sg scale.0.gain mux8.0.out
...
Last edit: 18 Jan 2013 00:27 by PCW.
The following user(s) said Thank You: Diederik

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

More
22 Jan 2013 17:23 #28946 by Diederik
Replied by Diederik on topic Spindle scaling factor
thank you for everyone's input. muchly appreciated

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

Time to create page: 0.221 seconds
Powered by Kunena Forum