@jmi
Actually problem was with default terminal of Kubuntu which disaplayed only 8 lines and previous lines got depleted.
I used another terminal Xterm and the cat command worked.
Thanks
opencn ~ # cat micro5/micro5.hal
Micro5 HAL file
The threads period is in [us], contrary to the one defined for the
Ethercat master in its xml, where it is in [ns]
– load components –
load lcec cfg=micro5/micro5_ec_topology.xml -d
load ocno axes=zbxyc # Order of axis to handle clearing - temporary solution
load feedopt --axes=xyzbc
load plc cfg=micro5
load plc cfg=spindle
load simple_pg joint_nr=5
load mux name=position type=float vector_nr=2 vector_size=5
load kinematic type=xyzbc params=micro5/m5_kin_param.txt
– Signal creation –
Inactive of operation
net set-mode-inactive-X ocno.axisX.set-mode-inactive => lcec.0.TSDXB.set-mode-inactive-0
net set-mode-inactive-Y ocno.axisY.set-mode-inactive => lcec.0.TSDYC.set-mode-inactive-0
net set-mode-inactive-Z ocno.axisZ.set-mode-inactive => lcec.0.TSDZS.set-mode-inactive-0
net set-mode-inactive-B ocno.axisB.set-mode-inactive => lcec.0.TSDXB.set-mode-inactive-1
net set-mode-inactive-C ocno.axisC.set-mode-inactive => lcec.0.TSDYC.set-mode-inactive-1
net in-mode-inactive-X ocno.axisX.in-mode-inactive <= lcec.0.TSDXB.in-mode-inactive-0
net in-mode-inactive-Y ocno.axisY.in-mode-inactive <= lcec.0.TSDYC.in-mode-inactive-0
net in-mode-inactive-Z ocno.axisZ.in-mode-inactive <= lcec.0.TSDZS.in-mode-inactive-0
net in-mode-inactive-B ocno.axisB.in-mode-inactive <= lcec.0.TSDXB.in-mode-inactive-1
net in-mode-inactive-C ocno.axisC.in-mode-inactive <= lcec.0.TSDYC.in-mode-inactive-1
Spindle
net spindle-target-velocity plc.spindle.target-velocity => lcec.0.TSDZS.target-velocity-1
net spindle-current-velocity plc.spindle.current-velocity <= lcec.0.TSDZS.current-velocity-1
net spindle-set-mode-csv plc.spindle.set-mode-csv => lcec.0.TSDZS.set-mode-csv-1
net spindle-set-mode-inactive plc.spindle.set-mode-inactive => lcec.0.TSDZS.set-mode-inactive-1
net spindle-in-mode-csv plc.spindle.in-mode-csv <= lcec.0.TSDZS.in-mode-csv-1
net spindle-in-mode-inactive plc.spindle.in-mode-inactive <= lcec.0.TSDZS.in-mode-inactive-1
Spindle parameter
setp plc.spindle.acceleration 5000 # Debug mode !
#setp plc.spindle.min-velocity 8000 # TO BE SET ONECE TEST IS DONE
setp plc.spindle.max-velocity 60000
#spindle to be linked in real machine
net spindle-cmd-target-velocity plc.spindle.cmd-target-velocity <= ocno.spindle.speed
net spindle-cmd-rotate-spindle plc.spindle.cmd-rotate-spindle <= ocno.spindle.enable
Homing of operation
net set-hm-csp-X ocno.axisX.set-mode-homing => lcec.0.TSDXB.set-mode-hm-0
net set-hm-csp-Y ocno.axisY.set-mode-homing => lcec.0.TSDYC.set-mode-hm-0
net set-hm-csp-Z ocno.axisZ.set-mode-homing => lcec.0.TSDZS.set-mode-hm-0
net set-hm-csp-B ocno.axisB.set-mode-homing => lcec.0.TSDXB.set-mode-hm-1
net set-hm-csp-C ocno.axisC.set-mode-homing => lcec.0.TSDYC.set-mode-hm-1
net in-hm-csp-X ocno.axisX.in-mode-homing <= lcec.0.TSDXB.in-mode-hm-0
net in-hm-csp-Y ocno.axisY.in-mode-homing <= lcec.0.TSDYC.in-mode-hm-0
net in-hm-csp-Z ocno.axisZ.in-mode-homing <= lcec.0.TSDZS.in-mode-hm-0
net in-hm-csp-B ocno.axisB.in-mode-homing <= lcec.0.TSDXB.in-mode-hm-1
net in-hm-csp-C ocno.axisC.in-mode-homing <= lcec.0.TSDYC.in-mode-hm-1
CSP of operation
net set-mode-csp-X ocno.axisX.set-mode-csp => lcec.0.TSDXB.set-mode-csp-0
net set-mode-csp-Y ocno.axisY.set-mode-csp => lcec.0.TSDYC.set-mode-csp-0
net set-mode-csp-Z ocno.axisZ.set-mode-csp => lcec.0.TSDZS.set-mode-csp-0
net set-mode-csp-B ocno.axisB.set-mode-csp => lcec.0.TSDXB.set-mode-csp-1
net set-mode-csp-C ocno.axisC.set-mode-csp => lcec.0.TSDYC.set-mode-csp-1
net in-mode-csp-X ocno.axisX.in-mode-csp <= lcec.0.TSDXB.in-mode-csp-0
net in-mode-csp-Y ocno.axisY.in-mode-csp <= lcec.0.TSDYC.in-mode-csp-0
net in-mode-csp-Z ocno.axisZ.in-mode-csp <= lcec.0.TSDZS.in-mode-csp-0
net in-mode-csp-B ocno.axisB.in-mode-csp <= lcec.0.TSDXB.in-mode-csp-1
net in-mode-csp-C ocno.axisC.in-mode-csp <= lcec.0.TSDYC.in-mode-csp-1
Data Path
net data-selector mux.position.selector <= ocno.datapath-sel
net cmd-pos{XYZBC} ocno.axis{XYZBC}.target-pos => simple_pg.joint{01234}.cmd-pos
net cmd-pos{XYZBC} ocno.axis{XYZBC}.target-pos => mux.position.vector0.input{01234}
net pg-data{XYZBC} mux.position.vector1.input{01234} <= simple_pg.joint{01234}.target-position
net target-position-x mux.position.output0 => lcec.0.TSDXB.target-position-0
net target-position-y mux.position.output1 => lcec.0.TSDYC.target-position-0
net target-position-z mux.position.output2 => lcec.0.TSDZS.target-position-0
net target-position-b mux.position.output3 => lcec.0.TSDXB.target-position-1
net target-position-c mux.position.output4 => lcec.0.TSDYC.target-position-1
Homing
net start-hm-X ocno.homing.axisX.start => lcec.0.TSDXB.do-homing-0
net start-hm-Y ocno.homing.axisY.start => lcec.0.TSDYC.do-homing-0
net start-hm-Z ocno.homing.axisZ.start => lcec.0.TSDZS.do-homing-0
net start-hm-B ocno.homing.axisB.start => lcec.0.TSDXB.do-homing-1
net start-hm-C ocno.homing.axisC.start => lcec.0.TSDYC.do-homing-1
net stop-hm-X ocno.homing.axisX.stop => lcec.0.TSDXB.do-stop-homing-0
net stop-hm-Y ocno.homing.axisY.stop => lcec.0.TSDYC.do-stop-homing-0
net stop-hm-Z ocno.homing.axisZ.stop => lcec.0.TSDZS.do-stop-homing-0
net stop-hm-B ocno.homing.axisB.stop => lcec.0.TSDXB.do-stop-homing-1
net stop-hm-C ocno.homing.axisC.stop => lcec.0.TSDYC.do-stop-homing-1
net homed-X ocno.homing.axisX.homed <= lcec.0.TSDXB.homed-0
net homed-Y ocno.homing.axisY.homed <= lcec.0.TSDYC.homed-0
net homed-Z ocno.homing.axisZ.homed <= lcec.0.TSDZS.homed-0
net homed-B ocno.homing.axisB.homed <= lcec.0.TSDXB.homed-1
net homed-C ocno.homing.axisC.homed <= lcec.0.TSDYC.homed-1
JOG
net jog-enable ocno.jog.enable => simple_pg.enable
#net pg-target-pos{XYZBC} ocno.axis{XYZBC}.target-pos => simple_pg.joint{01234}.cmd-pos
net current-pos-X lcec.0.TSDXB.current-position-0 => simple_pg.joint0.current-position
net current-pos-Y lcec.0.TSDYC.current-position-0 => simple_pg.joint1.current-position
net current-pos-Z lcec.0.TSDZS.current-position-0 => simple_pg.joint2.current-position
net current-pos-B lcec.0.TSDXB.current-position-1 => simple_pg.joint3.current-position
net current-pos-C lcec.0.TSDYC.current-position-1 => simple_pg.joint4.current-position
net jog-running-{XYZBC} ocno.jog.axis{XYZBC}.is_running <= simple_pg.joint{01234}.is_running
OCNO - current position
net current-pos-{XYZBC} ocno.axis{XYZBC}.current-joint-pos
OCNO machining
net spindle-current-velocity ocno.spindle.current-speed lcec.0.TSDZS.current-velocity-1
Fault
net in-fault-X ocno.axisX.in-fault
net in-fault-Y ocno.axisY.in-fault
net in-fault-Z ocno.axisZ.in-fault
net in-fault-B ocno.axisB.in-fault
net in-fault-C ocno.axisC.in-fault
ocno - fault reset
net fault-reset-X ocno.axisX.fault-reset => lcec.0.TSDXB.fault-reset-0
net fault-reset-Y ocno.axisY.fault-reset => lcec.0.TSDYC.fault-reset-0
net fault-reset-Z ocno.axisZ.fault-reset => lcec.0.TSDZS.fault-reset-0
net fault-reset-B ocno.axisB.fault-reset => lcec.0.TSDXB.fault-reset-1
net fault-reset-C ocno.axisC.fault-reset => lcec.0.TSDYC.fault-reset-1
Quick-Stop
net quick-stop-X ocno.axisX.quick-stop => lcec.0.TSDXB.quick-stop-0
net quick-stop-Y ocno.axisY.quick-stop => lcec.0.TSDYC.quick-stop-0
net quick-stop-Z ocno.axisZ.quick-stop => lcec.0.TSDZS.quick-stop-0
net quick-stop-B ocno.axisB.quick-stop => lcec.0.TSDXB.quick-stop-1
net quick-stop-C ocno.axisC.quick-stop => lcec.0.TSDYC.quick-stop-1
Simple PG
always in ‘absolute’ position - relative position handled by ‘ocno’)
setp simple_pg.joint0.relative-pos 0
setp simple_pg.joint1.relative-pos 0
setp simple_pg.joint2.relative-pos 0
setp simple_pg.joint3.relative-pos 0
setp simple_pg.joint4.relative-pos 0
PLC safety and functionality of M5
net in-fault-X plc.micro5.is_x_in_fault <= lcec.0.TSDXB.in-fault-0
net in-fault-Y plc.micro5.is_y_in_fault <= lcec.0.TSDYC.in-fault-0
net in-fault-Z plc.micro5.is_z_in_fault <= lcec.0.TSDZS.in-fault-0
net in-fault-S plc.micro5.is_spindle_in_fault <= lcec.0.TSDZS.in-fault-1
net in-fault-B plc.micro5.is_b_in_fault <= lcec.0.TSDXB.in-fault-1
net in-fault-C plc.micro5.is_c_in_fault <= lcec.0.TSDYC.in-fault-1
net m5-EStop plc.micro5.is_EStop_pushed <= lcec.0.EL1809.din-4-not
net m5-release-break-z plc.micro5.release_break_z => lcec.0.CTEU.out0.bit-0
net is-enabled-2 plc.micro5.is_z_enabled <= lcec.0.TSDZS.enabled-0
net is-enabled-3 plc.micro5.is_spindle_enabled <= lcec.0.TSDZS.enabled-1
net is-enabled-4 plc.micro5.is_b_enabled <= lcec.0.TSDXB.enabled-1
net is-enabled-5 plc.micro5.is_c_enabled <= lcec.0.TSDYC.enabled-1
net m5-sealing plc.micro5.b_c_s_axis_sealing => lcec.0.CTEU.out0.bit-1
net m5-spindle_cooling plc.micro5.spindle_cooling => lcec.0.CTEU.out0.bit-6
net set-mode-inactive-3 plc.micro5.spindle_set_mode_inactive => lcec.0.TSDZS.set-mode-inactive-1
net set-mode-csv-3 plc.micro5.spindle_set_mode_csv => lcec.0.TSDZS.set-mode-csv-1
net m5-pull-0 plc.micro5.spindle_pulling_pin0 <= lcec.0.EL1809.din-11
net m5-pull-1 plc.micro5.spindle_pulling_pin1 <= lcec.0.EL1809.din-12
net m5-free-tool plc.micro5.free_milling_tool => lcec.0.CTEU.out0.bit-4
net m5-cone-clean plc.micro5.cone_cleaning => lcec.0.CTEU.out0.bit-5
net m5-free-pal plc.micro5.free_palette => lcec.0.CTEU.out0.bit-2
net m5-blow-pal plc.micro5.blowing_palette => lcec.0.CTEU.out0.bit-3
net spindle-can-turn plc.micro5.spindle_can_turn => ocno.spindle.can-turn
net spindle-temperature plc.micro5.spindle_temperature <= lcec.0.EL3202.chan1.temperature
net m5-is-milling plc.micro5.is_milling <= ocno.machining.running
Feedopt
net machining-finished feedopt.finished => ocno.machining.finished
net machining-underrun feedopt.sample.underrun => ocno.machining.underrun
net machining-ready feedopt.ready => ocno.machining.operation-ready
net machining-read-one-samples feedopt.read.single <= ocno.machining.get-one-sample
net machining-read-samples feedopt.read.start <= ocno.machining.read-samples
net machining-cmd-pos-{XYZBC} feedopt.axis{XYZBC}.sample => ocno.machining.axis{XYZBC}.cmd-pos
net feedopt-spindle-target-speed feedopt.spindle-target-speed => ocno.machining.target-spindle-speed
net feedopt-resampling-pause feedopt.resampling.pause => ocno.machining.resampling-pause
#to be linked
#net m5-cmd-free-tool plc.micro5.cmd_free_tool <=
#net m5-cmd_free_pal plc.micro5.cmd_free_palette <=
#net m5-cmd-enable-spindle plc.micro5.cmd_enable_spindle <=
#net m5-stop-operation plc.micro5.stop_operation =>
– Parameters config --#
lcec - modulo mode
setp lcec.0.TSDYC.modulo-1 360
– Micro5 specific behavior –
Machine position limits
setp ocno.axisX.limit-min -39
setp ocno.axisX.limit-max 39
setp ocno.axisY.limit-min -28
setp ocno.axisY.limit-max 28
setp ocno.axisZ.limit-min -50
setp ocno.axisZ.limit-max 0
setp ocno.axisB.limit-min -102 # 10 recommended from manufaccturer / (24 degree mesured143degree mesured in full range, we still use manufacturer spec
setp ocno.axisB.limit-max 15
setp ocno.axisC.limit-min 0
setp ocno.axisC.limit-max 0
– Export functions –
addf ocno.func lcec_thread.0
addf feedopt.update lcec_thread.0
addf plc.micro5 lcec_thread.0
addf plc.spindle lcec_thread.0
addf simple_pg.func lcec_thread.0
addf mux.position_func lcec_thread.0
– Debug mode –
in debug mode set some default values !
setp lcec.0.EL1809.debug_din-11 1
setp lcec.0.EL1809.debug_din-12 1
– Sampler –
load sampler depth=1000 cfg=fffffffffffffffub
net target-position-x sampler.0.pin.0
net target-position-y sampler.0.pin.1
net target-position-z sampler.0.pin.2
net target-position-b sampler.0.pin.3
net target-position-c sampler.0.pin.4
net current-pos-X sampler.0.pin.5
net current-pos-Y sampler.0.pin.6
net current-pos-Z sampler.0.pin.7
net current-pos-B sampler.0.pin.8
net current-pos-C sampler.0.pin.9
#sampler logging of error position
net pos-error-0 lcec.0.TSDXB.position-error-0 => sampler.0.pin.10
net pos-error-1 lcec.0.TSDYC.position-error-0 => sampler.0.pin.11
net pos-error-2 lcec.0.TSDZS.position-error-0 => sampler.0.pin.12
net pos-error-3 lcec.0.TSDXB.position-error-1 => sampler.0.pin.13
net pos-error-4 lcec.0.TSDYC.position-error-1 => sampler.0.pin.14
net data-selector sampler.0.pin.15
net machining-finished sampler.0.pin.16
addf sampler.0 lcec_thread.0
– Start operations –
start