Control Panel setup
11 Apr 2014 09:31 - 11 Apr 2014 09:32 #45834
by Duc
Control Panel setup was created by Duc
Finally ready to wire up the control panel for my Retrofit Bridgeport Boss5 mill. I have purchased a mesa 7i84 card to mount behind the panel to save on the amount of wiring that needs to be run.
Panel
I would like to get all the rotary switches working on the panel.
Searching as lead me to Lut5 but the details seem a little fuzzy about how to actually use the code properly.
www.linuxcnc.org/docs/2.4/html/man/man9/lut5.9.html
The largest truth table uses 5 bits.
Any suggestions on how to proceed?
Panel
I would like to get all the rotary switches working on the panel.
Searching as lead me to Lut5 but the details seem a little fuzzy about how to actually use the code properly.
www.linuxcnc.org/docs/2.4/html/man/man9/lut5.9.html
The largest truth table uses 5 bits.
Any suggestions on how to proceed?
Last edit: 11 Apr 2014 09:32 by Duc.
Please Log in or Create an account to join the conversation.
11 Apr 2014 10:09 #45835
by jmelson
Replied by jmelson on topic Control Panel setup
You might look at my setup for jog axis selection for a simple pendant.
pico-systems.com/pendant.html
I have links to the hal code that decodes this as well as a pdf drawing of
the switch wiring. I made a diode matrix encoder so a single pole
switch could do the decoding. It takes a 5-position switch and decodes
that to 3 digital inputs, just to save on digital inputs. I can jog the
axes, or change the feedrate or spindle overrides with the
MPG encoder. So, I don't need a 21-position switch for feedrate
override, it is done with the MPG.
But, if you want to do it that way, have a look at how the 2
digital inputs are used to select 3 jog rates for axis jogging
in the hal file.
Jon
pico-systems.com/pendant.html
I have links to the hal code that decodes this as well as a pdf drawing of
the switch wiring. I made a diode matrix encoder so a single pole
switch could do the decoding. It takes a 5-position switch and decodes
that to 3 digital inputs, just to save on digital inputs. I can jog the
axes, or change the feedrate or spindle overrides with the
MPG encoder. So, I don't need a 21-position switch for feedrate
override, it is done with the MPG.
But, if you want to do it that way, have a look at how the 2
digital inputs are used to select 3 jog rates for axis jogging
in the hal file.
Jon
Please Log in or Create an account to join the conversation.
13 Apr 2014 00:45 - 13 Apr 2014 00:47 #45890
by Duc
Replied by Duc on topic Control Panel setup
Dont really understand how to use the mux option but weighted_sum function is clear. The Mesa 7i84 board will not be arriving till wed but trying to get some of the coding done now.
From what I've researched I need to use the following loadrt.
loadrt weighted_sum wsum_sizes=5,5,3,9,3,2,3
In the following order for the .hal file
Feedrate = 5 bits
Feedpercentage = 5 bits
MPG selector = 3 bits
Function mode = 9 bits
Step mode = 3 bits
Rapid percentage = 2 bits
RPM percentage = 3 bits
Unsure how actually use the info inserted into the .hal for controlling the functions but one step at a time.
From what I've researched I need to use the following loadrt.
loadrt weighted_sum wsum_sizes=5,5,3,9,3,2,3
In the following order for the .hal file
Feedrate = 5 bits
Feedpercentage = 5 bits
MPG selector = 3 bits
Function mode = 9 bits
Step mode = 3 bits
Rapid percentage = 2 bits
RPM percentage = 3 bits
#******************************
# Control Panel
#******************************
##Feedrate Selector
net Feedrate0 hm2######## => wsum.0.bit.0.in
net Feedrate1 hm2######## => wsum.0.bit.1.in
net Feedrate2 hm2######## => wsum.0.bit.2.in
net Feedrate3 hm2######## => wsum.0.bit.3.in
net Feedrate4 hm2######## => wsum.0.bit.4.in
net Feedrate wsum.0.sum => Feedrate21.0.sel
##Feedrate percentage
net Feedpercent0 hm2##### => wsum.1.bit.0.in
net Feedpercent1 hm2##### => wsum.1.bit.1.in
net Feedpercent2 hm2##### => wsum.1.bit.2.in
net Feedpercent3 hm2##### => wsum.1.bit.3.in
net Feedpercent4 hm2##### => wsum.1.bit.4.in
net Feedpercent wsum.1.sum => Feedpercent20.0.sel
##MPG selector
net SelectorMPG0 hm2##### => wsum.2.bit.0.in
net SelectorMPG1 hm2##### => wsum.2.bit.1.in
net SelectorMPG2 hm2##### => wsum.2.bit.2.in
net SelectorMPG wsum.2.sum => SelectorMPG.0.sel
##Functionmode
net Functionmode0 hm2##### => wsum.3.bit.0.in
net Functionmode1 hm2##### => wsum.3.bit.1.in
net Functionmode2 hm2##### => wsum.3.bit.2.in
net Functionmode3 hm2##### => wsum.3.bit.3.in
net Functionmode4 hm2##### => wsum.3.bit.4.in
net Functionmode5 hm2##### => wsum.3.bit.5.in
net Functionmode6 hm2##### => wsum.3.bit.6.in
net Functionmode7 hm2##### => wsum.3.bit.7.in
net Functionmode8 hm2##### => wsum.3.bit.8.in
net Functionmode wsum.2.sum => Functionmode.0.sel
##Stepselector
net Stepselector0 hm2##### => wsum.4.bit.0.in
net Stepselector1 hm2##### => wsum.4.bit.1.in
net Stepselector2 hm2##### => wsum.4.bit.2.in
net Stepselector wsum.3.sum => Stepselector.0.sel
##Rapidpercent
net Rapidpercent0 hm2##### => wsum.5.bit.0.in
net Rapidpercent1 hm2##### => wsum.5.bit.1.in
net Rapidpercent wsum.5.sum => Rapidpercent.0.sel
##RPMpercent
net Rpmpercent0 hm2##### => wsum.6.bit.0.in
net Rpmpercent1 hm2##### => wsum.6.bit.1.in
net Rpmpercent2 hm2##### => wsum.6.bit.2.in
net Rpmpercent wsum.6.sum => Rpmpercent.0.sel
Unsure how actually use the info inserted into the .hal for controlling the functions but one step at a time.
Last edit: 13 Apr 2014 00:47 by Duc.
Please Log in or Create an account to join the conversation.
14 Apr 2014 06:49 #45926
by andypugh
For a 5-bit table you would need a mux32. There isn't one in the released version, but you could fake it with 4 x mux8 and and 1 x mux4. The mux8s would work on the lower-order bits and the mux4 would choose between them based on the higher-order bits.
If you can work with Master or wait for 2.6 then you will get "mux_generic" that would do it in a single step:
www.linuxcnc.org/docs/devel/html/man/man9/mux_generic.9.html
Replied by andypugh on topic Control Panel setup
I would like to get all the rotary switches working on the panel.
Searching as lead me to Lut5 but the details seem a little fuzzy about how to actually use the code properly.
www.linuxcnc.org/docs/2.4/html/man/man9/lut5.9.html
The largest truth table uses 5 bits.
For a 5-bit table you would need a mux32. There isn't one in the released version, but you could fake it with 4 x mux8 and and 1 x mux4. The mux8s would work on the lower-order bits and the mux4 would choose between them based on the higher-order bits.
If you can work with Master or wait for 2.6 then you will get "mux_generic" that would do it in a single step:
www.linuxcnc.org/docs/devel/html/man/man9/mux_generic.9.html
Please Log in or Create an account to join the conversation.
20 Apr 2014 03:54 - 20 Apr 2014 03:56 #46123
by Duc
Replied by Duc on topic Control Panel setup
I was able to under the mux a little better once I found a example page.
Now that I have the 7i84 and MPG working Ive run into a snag with the mux for the jog step incr. Most of the mux coding I pieced together by making a secondy profile in PNFCONF since the 7i84 doesnt show up.
The jog incr knob is controlled by 3 bits. I can see the bits toggling correctly in Hal config
# --- JOG-INCR-A ---
net jog-incr-a <= hm2_5i25.0.7i84.0.1.input-09
# --- JOG-INCR-B ---
net jog-incr-b <= hm2_5i25.0.7i84.0.1.input-10
# --- JOG-INCR-C ---
net jog-incr-c <= hm2_5i25.0.7i84.0.1.input-11
The code for the mux.
I can see jogincr.sel0 thru jogincr.sel2 toggling has a rotate the knob but I do not see jogincr.out changing off of .0001.
Only way I can get the jogincr.out to change is by editting in00 to a different value.
Now that I have the 7i84 and MPG working Ive run into a snag with the mux for the jog step incr. Most of the mux coding I pieced together by making a secondy profile in PNFCONF since the 7i84 doesnt show up.
The jog incr knob is controlled by 3 bits. I can see the bits toggling correctly in Hal config
# --- JOG-INCR-A ---
net jog-incr-a <= hm2_5i25.0.7i84.0.1.input-09
# --- JOG-INCR-B ---
net jog-incr-b <= hm2_5i25.0.7i84.0.1.input-10
# --- JOG-INCR-C ---
net jog-incr-c <= hm2_5i25.0.7i84.0.1.input-11
The code for the mux.
loadrt mux16 names=jogincr,foincr,mvoincr,soincr
##connect jog incr override increments
net jog-incr-a => jogincr.sel0
net jog-incr-b => jogincr.sel1
net jog-incr-c => jogincr.sel2
net selected-jog-incr <= jogincr.out-f
setp jogincr.debounce-time 0.200000
setp jogincr.use-graycode False
setp jogincr.suppress-no-input False
setp jogincr.in00 0.0001
setp jogincr.in01 0.001
setp jogincr.in02 .01
setp jogincr.in03 1
I can see jogincr.sel0 thru jogincr.sel2 toggling has a rotate the knob but I do not see jogincr.out changing off of .0001.
Only way I can get the jogincr.out to change is by editting in00 to a different value.
setp jogincr.in00 0.0001
Last edit: 20 Apr 2014 03:56 by Duc.
Please Log in or Create an account to join the conversation.
20 Apr 2014 04:45 #46124
by PCW
Replied by PCW on topic Control Panel setup
is mux16 addf-ed to the servo thread?
Please Log in or Create an account to join the conversation.
20 Apr 2014 05:11 - 20 Apr 2014 05:11 #46125
by Duc
Replied by Duc on topic Control Panel setup
get a error when I try to add it to the servo thread.
Complete Hal file
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.0
Machine configuration directory is '/home/shefron/linuxcnc/configs/Boss5'
Machine configuration file is 'Boss5.ini'
INIFILE=/home/shefron/linuxcnc/configs/Boss5/Boss5.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=5877
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
Boss5.hal:4: Warning: File contains DOS-style line endings.
HAL: ERROR: function 'mux16' not found
Boss5.hal:14: addf failed
5877
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components
Kernel message information:
[19379.758002] I-pipe: Domain RTAI registered.
[19379.758020] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[19379.758025] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[19379.758038] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[19379.758043] PIPELINE layers:
[19379.758049] f8685e20 9ac15d93 RTAI 200
[19379.758054] c085cb20 0 Linux 100
[19379.814925] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[19379.815197] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[19379.815208] RTAI[sched]: hard timer type/freq = APIC/6239309(Hz); default timing: periodic; linear timed lists.
[19379.815214] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1796780000 hz.
[19379.815219] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[19379.815403] RTAI[usi]: enabled.
[19380.000726] RTAI[math]: loaded.
[19380.172714] hm2: loading Mesa HostMot2 driver version 0.15
[19380.181467] hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7
[19380.181540] hm2_pci 0000:02:0c.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[19380.181548] hm2_pci: discovered 5i25 at 0000:02:0c.0
[19380.182147] hm2/hm2_5i25.0: Smart Serial Firmware Version 38
[19380.334970] hm2/hm2_5i25.0: 34 I/O Pins used:
[19380.334982] hm2/hm2_5i25.0: IO Pin 000 (P3-01): StepGen #0, pin Direction (Output)
[19380.334989] hm2/hm2_5i25.0: IO Pin 001 (P3-14): StepGen #0, pin Step (Output)
[19380.334995] hm2/hm2_5i25.0: IO Pin 002 (P3-02): StepGen #1, pin Direction (Output)
[19380.335002] hm2/hm2_5i25.0: IO Pin 003 (P3-15): StepGen #1, pin Step (Output)
[19380.335008] hm2/hm2_5i25.0: IO Pin 004 (P3-03): StepGen #2, pin Direction (Output)
[19380.335014] hm2/hm2_5i25.0: IO Pin 005 (P3-16): StepGen #2, pin Step (Output)
[19380.335021] hm2/hm2_5i25.0: IO Pin 006 (P3-04): StepGen #3, pin Direction (Output)
[19380.335027] hm2/hm2_5i25.0: IO Pin 007 (P3-17): StepGen #3, pin Step (Output)
[19380.335033] hm2/hm2_5i25.0: IO Pin 008 (P3-05): StepGen #4, pin Direction (Output)
[19380.335040] hm2/hm2_5i25.0: IO Pin 009 (P3-06): StepGen #4, pin Step (Output)
[19380.335047] hm2/hm2_5i25.0: IO Pin 010 (P3-07): Smart Serial Interface #0, pin TxData0 (Output)
[19380.335053] hm2/hm2_5i25.0: IO Pin 011 (P3-08): Smart Serial Interface #0, pin RxData0 (Input)
[19380.335060] hm2/hm2_5i25.0: IO Pin 012 (P3-09): Smart Serial Interface #0, pin TxData1 (Output)
[19380.335067] hm2/hm2_5i25.0: IO Pin 013 (P3-10): Smart Serial Interface #0, pin RxData1 (Input)
[19380.335074] hm2/hm2_5i25.0: IO Pin 014 (P3-11): Encoder #0, pin Index (Input)
[19380.335080] hm2/hm2_5i25.0: IO Pin 015 (P3-12): Encoder #0, pin B (Input)
[19380.335086] hm2/hm2_5i25.0: IO Pin 016 (P3-13): Encoder #0, pin A (Input)
[19380.335091] hm2/hm2_5i25.0: IO Pin 017 (P2-01): IOPort
[19380.335097] hm2/hm2_5i25.0: IO Pin 018 (P2-14): IOPort
[19380.335102] hm2/hm2_5i25.0: IO Pin 019 (P2-02): IOPort
[19380.335107] hm2/hm2_5i25.0: IO Pin 020 (P2-15): IOPort
[19380.335112] hm2/hm2_5i25.0: IO Pin 021 (P2-03): IOPort
[19380.335117] hm2/hm2_5i25.0: IO Pin 022 (P2-16): IOPort
[19380.335122] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
[19380.335128] hm2/hm2_5i25.0: IO Pin 024 (P2-17): IOPort
[19380.335133] hm2/hm2_5i25.0: IO Pin 025 (P2-05): IOPort
[19380.335138] hm2/hm2_5i25.0: IO Pin 026 (P2-06): IOPort
[19380.335143] hm2/hm2_5i25.0: IO Pin 027 (P2-07): IOPort
[19380.335148] hm2/hm2_5i25.0: IO Pin 028 (P2-08): IOPort
[19380.335153] hm2/hm2_5i25.0: IO Pin 029 (P2-09): IOPort
[19380.335158] hm2/hm2_5i25.0: IO Pin 030 (P2-10): IOPort
[19380.335163] hm2/hm2_5i25.0: IO Pin 031 (P2-11): IOPort
[19380.335169] hm2/hm2_5i25.0: IO Pin 032 (P2-12): IOPort
[19380.335174] hm2/hm2_5i25.0: IO Pin 033 (P2-13): IOPort
[19380.335339] hm2/hm2_5i25.0: registered
[19380.335345] hm2_5i25.0: initialized AnyIO board at 0000:02:0c.0
[19381.078011] hm2_5i25.0: dropping AnyIO board at 0000:02:0c.0
[19381.078027] hm2/hm2_5i25.0: unregistered
[19381.078075] hm2_pci 0000:02:0c.0: PCI INT A disabled
[19381.080192] hm2_pci: driver unloaded
[19381.088460] hm2: unloading
[19381.207804] RTAI[math]: unloaded.
[19381.347265] SCHED releases registered named ALIEN RTGLBH
[19381.361718] RTAI[malloc]: unloaded.
[19381.460034] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[19381.467569] I-pipe: Domain RTAI unregistered.
[19381.467589] RTAI[hal]: unmounted.
Complete Hal file
# Generated by PNCconf at Sun Jan 6 10:34:22 2002
# If you make changes to this file, they will be
# overwritten when you run PNCconf again
loadrt abs count=1
loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hostmot2
loadrt hm2_pci config=" num_encoders=1 num_pwmgens=0 num_3pwmgens=0 num_stepgens=5 sserial_port_0=0200 "
setp hm2_5i25.0.watchdog.timeout_ns 10000000
loadrt mux16 names=jogincr,foincr,mvoincr,soincr
loadrt ilowpass
addf mux16 servo-thread
addf ilowpass.0 servo-thread
addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf jogincr servo-thread
addf foincr servo-thread
addf mvoincr servo-thread
addf soincr servo-thread
addf hm2_5i25.0.write servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
addf abs.0 servo-thread
# external output signals
# external input signals
# ---COOLANT CONROL ---
net coolant-flood hm2_5i25.0.7i76.0.0.output-01
# ---LUBRICATION SYSTEM ---
# --- SPINDLE-BRAKE ---
net spindle-brake hm2_5i25.0.7i76.0.0.output-00
# --- BOTH-HOME-X ---
net both-home-x <= hm2_5i25.0.7i76.0.0.input-00
# --- BOTH-HOME-Y ---
net both-home-y <= hm2_5i25.0.7i76.0.0.input-01
# --- MAX-HOME-Z ---
net max-home-z <= hm2_5i25.0.7i76.0.0.input-03
# --- MIN-Z ---
net min-z <= hm2_5i25.0.7i76.0.0.input-04
# --- JOINT-SELECT-a-X ---
net joint-select-a <= hm2_5i25.0.7i84.0.1.input-00
# --- JOINT-SELECT-b-Y ---
net joint-select-b <= hm2_5i25.0.7i84.0.1.input-01
# --- JOINT-SELECT-c-Z ---
net joint-select-c <= hm2_5i25.0.7i84.0.1.input-02
# --- JOINT-SELECT-d-A ---
net joint-select-d <= hm2_5i25.0.7i84.0.1.input-03
# --- JOG-INCR-A ---
net jog-incr-a <= hm2_5i25.0.7i84.0.1.input-09
# --- JOG-INCR-B ---
net jog-incr-b <= hm2_5i25.0.7i84.0.1.input-10
# --- JOG-INCR-C ---
net jog-incr-c <= hm2_5i25.0.7i84.0.1.input-11
# --- Feedrate overide - FO-INCR-A ---
net fo-incr-a <= hm2_5i25.0.7i84.0.1.input-04
# --- FO-INCR-B ---
net fo-incr-b <= hm2_5i25.0.7i84.0.1.input-05
# --- FO-INCR-C ---
net fo-incr-c <= hm2_5i25.0.7i84.0.1.input-06
# --- FO-INCR-D ---
net fo-incr-d <= hm2_5i25.0.7i84.0.1.input-07
# --- Spindle override - SO-INCR-A ---
net so-incr-a <= hm2_5i25.0.7i84.0.1.input-29
# --- SO-INCR-B ---
net so-incr-b <= hm2_5i25.0.7i84.0.1.input-30
# --- SO-INCR-C ---
net so-incr-c <= hm2_5i25.0.7i84.0.1.input-31
# --- Max velocity override - MVO-INCR-A ---
net mvo-incr-a <= hm2_5i25.0.7i76.0.0.input-28
# --- MVO-INCR-B ---
net mvo-incr-b <= hm2_5i25.0.7i76.0.0.input-29
# --- MVO-INCR-C ---
net mvo-incr-c <= hm2_5i25.0.7i76.0.0.input-30
# --- MVO-INCR-D ---
net mvo-incr-d <= hm2_5i25.0.7i76.0.0.input-31
#*******************
# AXIS X
#*******************
# Step Gen signals/setup
setp hm2_5i25.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
setp hm2_5i25.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
setp hm2_5i25.0.stepgen.00.steplen [AXIS_0]STEPLEN
setp hm2_5i25.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
setp hm2_5i25.0.stepgen.00.position-scale [AXIS_0]STEP_SCALE
setp hm2_5i25.0.stepgen.00.step_type 0
setp hm2_5i25.0.stepgen.00.control-type 0
setp hm2_5i25.0.stepgen.00.maxaccel 5.0
setp hm2_5i25.0.stepgen.00.maxvel 2.1
net x-pos-fb axis.0.motor-pos-fb <= hm2_5i25.0.stepgen.00.position-fb
net x-pos-cmd axis.0.motor-pos-cmd => hm2_5i25.0.stepgen.00.position-cmd
net x-enable axis.0.amp-enable-out => hm2_5i25.0.stepgen.00.enable
# ---setup home / limit switch signals---
net both-home-x => axis.0.home-sw-in
net both-home-x => axis.0.neg-lim-sw-in
net both-home-x => axis.0.pos-lim-sw-in
#*******************
# AXIS Y
#*******************
# Step Gen signals/setup
setp hm2_5i25.0.stepgen.01.dirsetup [AXIS_1]DIRSETUP
setp hm2_5i25.0.stepgen.01.dirhold [AXIS_1]DIRHOLD
setp hm2_5i25.0.stepgen.01.steplen [AXIS_1]STEPLEN
setp hm2_5i25.0.stepgen.01.stepspace [AXIS_1]STEPSPACE
setp hm2_5i25.0.stepgen.01.position-scale [AXIS_1]STEP_SCALE
setp hm2_5i25.0.stepgen.01.step_type 0
setp hm2_5i25.0.stepgen.01.control-type 0
setp hm2_5i25.0.stepgen.01.maxaccel 2.5
setp hm2_5i25.0.stepgen.01.maxvel 2.1
net y-pos-fb axis.1.motor-pos-fb <= hm2_5i25.0.stepgen.01.position-fb
net y-pos-cmd axis.1.motor-pos-cmd => hm2_5i25.0.stepgen.01.position-cmd
net y-enable axis.1.amp-enable-out => hm2_5i25.0.stepgen.01.enable
# ---setup home / limit switch signals---
net both-home-y => axis.1.home-sw-in
net both-home-y => axis.1.neg-lim-sw-in
net both-home-y => axis.1.pos-lim-sw-in
#*******************
# AXIS Z
#*******************
# Step Gen signals/setup
setp hm2_5i25.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
setp hm2_5i25.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
setp hm2_5i25.0.stepgen.02.steplen [AXIS_2]STEPLEN
setp hm2_5i25.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
setp hm2_5i25.0.stepgen.02.position-scale [AXIS_2]STEP_SCALE
setp hm2_5i25.0.stepgen.02.step_type 0
setp hm2_5i25.0.stepgen.02.control-type 0
setp hm2_5i25.0.stepgen.02.maxaccel 2.5
setp hm2_5i25.0.stepgen.02.maxvel 2.1
net z-pos-fb axis.2.motor-pos-fb <= hm2_5i25.0.stepgen.02.position-fb
net z-pos-cmd axis.2.motor-pos-cmd => hm2_5i25.0.stepgen.02.position-cmd
net z-enable axis.2.amp-enable-out => hm2_5i25.0.stepgen.02.enable
# ---setup home / limit switch signals---
net max-home-z => axis.2.home-sw-in
net min-z => axis.2.neg-lim-sw-in
net max-home-z => axis.2.pos-lim-sw-in
#*******************
# SPINDLE S
#*******************
# ---digital potentionmeter output signals/setup---
setp hm2_5i25.0.7i76.0.0.spinout-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i76.0.0.spinout-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
setp hm2_5i25.0.7i76.0.0.spinout-scalemax [SPINDLE_9]OUTPUT_SCALE
net abs-vel-cmd abs.0.out => hm2_5i25.0.7i76.0.0.spinout
net spindle-enable => hm2_5i25.0.7i76.0.0.spinena
net spindle-cw => hm2_5i25.0.7i76.0.0.output-04
net spindle-ccw => hm2_5i25.0.7i76.0.0.output-05
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd abs.0.in <= motion.spindle-speed-out
net spindle-enable <= motion.spindle-on
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-revs => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-fb => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable
# ---Setup spindle at speed signals---
sets spindle-at-speed true
#******************************
# connect miscellaneous signals
#******************************
# ---HALUI signals---
net joint-select-a halui.joint.0.select
net x-is-homed halui.joint.0.is-homed
net jog-x-pos halui.jog.0.plus
net jog-x-neg halui.jog.0.minus
net jog-x-analog halui.jog.0.analog
net joint-select-b halui.joint.1.select
net y-is-homed halui.joint.1.is-homed
net jog-y-pos halui.jog.1.plus
net jog-y-neg halui.jog.1.minus
net jog-y-analog halui.jog.1.analog
net joint-select-c halui.joint.2.select
net z-is-homed halui.joint.2.is-homed
net jog-z-pos halui.jog.2.plus
net jog-z-neg halui.jog.2.minus
net jog-z-analog halui.jog.2.analog
net jog-selected-pos halui.jog.selected.plus
net jog-selected-neg halui.jog.selected.minus
net spindle-manual-cw halui.spindle.forward
net spindle-manual-ccw halui.spindle.reverse
net spindle-manual-stop halui.spindle.stop
net machine-is-on halui.machine.is-on
net jog-speed halui.jog-speed
net MDI-mode halui.mode.is-mdi
# ---coolant signals---
net coolant-mist <= iocontrol.0.coolant-mist
net coolant-flood <= iocontrol.0.coolant-flood
# ---probe signal---
net probe-in => motion.probe-input
# ---jog button signals---
sets jog-speed 1.000000
## MPG stuff##########
# ---jogwheel signals to mesa encoder - shared MPG---
net joint-selected-count <= hm2_5i25.0.7i84.0.1.enc0
setp hm2_5i25.0.encoder.00.filter true
setp hm2_5i25.0.encoder.00.counter-mode true
# ---mpg signals---
# for axis x MPG
setp axis.0.jog-vel-mode 0
net selected-jog-incr => axis.0.jog-scale
net joint-select-a => axis.0.jog-enable
net joint-selected-count => axis.0.jog-counts
# for axis y MPG
setp axis.1.jog-vel-mode 0
net selected-jog-incr => axis.1.jog-scale
net joint-select-b => axis.1.jog-enable
net joint-selected-count => axis.1.jog-counts
# for axis z MPG
setp axis.2.jog-vel-mode 0
net selected-jog-incr => axis.2.jog-scale
net joint-select-c => axis.2.jog-enable
net joint-selected-count => axis.2.jog-counts
##connect jog incr override increments
net jog-incr-a => jogincr.sel0
net jog-incr-b => jogincr.sel1
net jog-incr-c => jogincr.sel2
net selected-jog-incr <= jogincr.out-f
setp jogincr.debounce-time 0.200000
setp jogincr.use-graycode False
setp jogincr.suppress-no-input False
setp jogincr.in00 0.0001
setp jogincr.in01 0.001
setp jogincr.in02 .01
setp jogincr.in03 1
# connect feed overide increments - switches
setp halui.feed-override.count-enable true
setp halui.feed-override.direct-value true
setp halui.feed-override.scale .01
net feedoverride-incr => halui.feed-override.counts
net fo-incr-a => foincr.sel0
net fo-incr-b => foincr.sel1
net fo-incr-c => foincr.sel2
net fo-incr-d => foincr.sel3
net feedoverride-incr <= foincr.out-s
setp foincr.debounce-time 0.200000
setp foincr.use-graycode False
setp foincr.suppress-no-input False
setp foincr.in00 0.000000
setp foincr.in01 10.000000
setp foincr.in02 20.000000
setp foincr.in03 30.000000
setp foincr.in04 40.000000
setp foincr.in05 50.000000
setp foincr.in06 60.000000
setp foincr.in07 70.000000
setp foincr.in08 80.000000
setp foincr.in09 90.000000
setp foincr.in10 100.000000
setp foincr.in11 110.000000
setp foincr.in12 120.000000
setp foincr.in13 130.000000
setp foincr.in14 140.000000
setp foincr.in15 150.000000
# connect max velocity overide increments - switches
setp halui.max-velocity.count-enable true
setp halui.max-velocity.direct-value true
setp halui.max-velocity.scale 0.016670
net max-vel-override-incr => halui.max-velocity.counts
net mvo-incr-a => mvoincr.sel0
net mvo-incr-b => mvoincr.sel1
net mvo-incr-c => mvoincr.sel2
net mvo-incr-d => mvoincr.sel3
net max-vel-override-incr <= mvoincr.out-s
setp mvoincr.debounce-time 0.200000
setp mvoincr.use-graycode False
setp mvoincr.suppress-no-input False
setp mvoincr.in00 0.000000
setp mvoincr.in01 5.000000
setp mvoincr.in02 10.000000
setp mvoincr.in03 25.000000
setp mvoincr.in04 50.000000
setp mvoincr.in05 75.000000
setp mvoincr.in06 90.000000
setp mvoincr.in07 100.000000
setp mvoincr.in08 100.000000
setp mvoincr.in09 100.000000
setp mvoincr.in10 100.000000
setp mvoincr.in11 100.000000
setp mvoincr.in12 100.000000
setp mvoincr.in13 100.000000
setp mvoincr.in14 100.000000
setp mvoincr.in15 100.000000
# connect spindle overide increments
setp halui.spindle-override.count-enable true
setp halui.spindle-override.direct-value true
setp halui.spindle-override.scale .01
net spindleoverride-incr => halui.spindle-override.counts
net so-incr-a => soincr.sel0
net so-incr-b => soincr.sel1
net so-incr-c => soincr.sel2
net spindleoverride-incr <= soincr.out-s
setp soincr.debounce-time 0.200000
setp soincr.use-graycode False
setp soincr.suppress-no-input False
setp soincr.in00 50.000000
setp soincr.in01 60.000000
setp soincr.in02 70.000000
setp soincr.in03 80.000000
setp soincr.in04 90.000000
setp soincr.in05 100.000000
setp soincr.in06 110.000000
setp soincr.in07 120.000000
# ---motion control signals---
net in-position <= motion.in-position
net machine-is-enabled <= motion.motion-enabled
# ---digital in / out signals---
# ---estop signals---
net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in
# ---manual tool change signals---
loadusr -W hal_manualtoolchange
net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Last edit: 20 Apr 2014 05:11 by Duc.
Please Log in or Create an account to join the conversation.
20 Apr 2014 08:13 - 20 Apr 2014 08:16 #46126
by PCW
Replied by PCW on topic Control Panel setup
The mux16 manual says the function it exports is mux16.N
so you probably need:
addf mux16.0 servothread
addf mux16.1 servothread
addf mux16.2 servothread
addf mux16.3 servothread
or some such
I have not used named component invocation so AFAIK it could be:
addf mux16.jogincr servothread
addf mux16.foincr servothread
addf mux16.mvoincr servothread
addf mux16.soincr servothread
EDIT Nevermind, I see its done this way:
addf jogincr servo-thread
addf foincr servo-thread
addf mvoincr servo-thread
addf soincr servo-thread
so that should be sufficient, no other addf's needed
so you probably need:
addf mux16.0 servothread
addf mux16.1 servothread
addf mux16.2 servothread
addf mux16.3 servothread
or some such
I have not used named component invocation so AFAIK it could be:
addf mux16.jogincr servothread
addf mux16.foincr servothread
addf mux16.mvoincr servothread
addf mux16.soincr servothread
EDIT Nevermind, I see its done this way:
addf jogincr servo-thread
addf foincr servo-thread
addf mvoincr servo-thread
addf soincr servo-thread
so that should be sufficient, no other addf's needed
Last edit: 20 Apr 2014 08:16 by PCW.
Please Log in or Create an account to join the conversation.
20 Apr 2014 08:35 - 20 Apr 2014 08:43 #46127
by Duc
Not sure whats going on since last ones are already in the hal file. Ill have to do some more experimenting in the morning and maybe find a example hal that works.
Here is Jmelson hal file from his link
Tried to do a code of addf mux16.0 servo-thread and addf mux16.jogincr servo-thread but they both failed. I know its something simple that I've left out.
Replied by Duc on topic Control Panel setup
The mux16 manual says the function it exports is mux16.N
so you probably need:
addf mux16.0 servothread
addf mux16.1 servothread
addf mux16.2 servothread
addf mux16.3 servothread
or some such
I have not used named component invocation so AFAIK it could be:
addf mux16.jogincr servothread
addf mux16.foincr servothread
addf mux16.mvoincr servothread
addf mux16.soincr servothread
EDIT Nevermind, I see its done this way:
addf jogincr servo-thread
addf foincr servo-thread
addf mvoincr servo-thread
addf soincr servo-thread
so that should be sufficient, no other addf's needed
Not sure whats going on since last ones are already in the hal file. Ill have to do some more experimenting in the morning and maybe find a example hal that works.
Here is Jmelson hal file from his link
# pendant with multiplexed axis selector
loadrt mux4 count=1
loadrt weighted_sum wsum_sizes=3
loadrt select8 count=1
loadrt ilowpass
loadrt toggle
setp ilowpass.0.scale 100
setp ilowpass.0.gain .01
addf mux4.0 servo-thread
addf process_wsums servo-thread
addf select8.0 servo-thread
addf ilowpass.0 servo-thread
addf toggle.0 servo-thread
net selector0 ppmc.0.din.12.in-not => wsum.0.bit.0.in
net selector1 ppmc.0.din.13.in-not => wsum.0.bit.1.in
net selector2 ppmc.0.din.14.in-not => wsum.0.bit.2.in
net selection wsum.0.sum => select8.0.sel
net jog-x select8.0.out1 => axis.0.jog-enable
net jog-y select8.0.out2 => axis.1.jog-enable
net jog-z select8.0.out3 => axis.2.jog-enable
net jog-a select8.0.out4 => axis.3.jog-enable
net setfeed select8.0.out5 => halui.feed-override.count-enable
net setspin select8.0.out6 => halui.spindle-override.count-enable
net x10 ppmc.0.din.03.in-not => mux4.0.sel0
net x100 ppmc.0.din.07.in-not => mux4.0.sel1
setp mux4.0.in0 .00000025
setp mux4.0.in1 .0000025
setp mux4.0.in2 .000025
setp mux4.0.in3 0
Tried to do a code of addf mux16.0 servo-thread and addf mux16.jogincr servo-thread but they both failed. I know its something simple that I've left out.
Last edit: 20 Apr 2014 08:43 by Duc.
Please Log in or Create an account to join the conversation.
20 Apr 2014 18:22 - 20 Apr 2014 18:25 #46131
by BigJohnT
Replied by BigJohnT on topic Control Panel setup
Here is a hint, comment out the addf then run your config and if your using Axis open the Show Hal Configuration window to see the pin names. If your not running Axis you can open a terminal and say halcmd show pin and that will give you a list of all your pins. Also in the terminal window you can see the functions you created with loadrt and loadusr by saying halcmd show function. These will be the names you need to use with addf.
When you use the name option like:
loadrt mux16 names=jogincr,foincr,mvoincr,soincr
the pin name will be jogincr,foincr,mvoincr,soincr
so the addf line will be
addf jogincr servo-thread
JT
When you use the name option like:
loadrt mux16 names=jogincr,foincr,mvoincr,soincr
the pin name will be jogincr,foincr,mvoincr,soincr
so the addf line will be
addf jogincr servo-thread
JT
Last edit: 20 Apr 2014 18:25 by BigJohnT.
Please Log in or Create an account to join the conversation.
Time to create page: 0.244 seconds