How to start configuration 5i25->7i77+7i77->7i64
29 Dec 2014 03:52 - 29 Dec 2014 03:59 #54344
by machete
How to start configuration 5i25->7i77+7i77->7i64 was created by machete
Hello!
I'm trying to start configuring set of Mesa cards for this retrofiting:
linuxcnc.org/hardy/hardy/emc2/emc2/index...ve-tool?limitstart=0
Now on my table:
5i25 (with two smart-serial ports)
=>7i77 (5 encoders + 5 axis + 1 spindle out + inputs and outputs) => 7i64 (inputs and outputs)
=>7i77 (1 spindle out + inputs and outputs)
Then i'm starting LinuxCNC i can't see any IO hal pins like hm2_5i25.0.7i77.0.0.input-00 for one 7i77-car and hm2_5i25.0.7i77.1.0.input-00 for another.
And also how can i set up 7i64 on RS-422 to see it's IO pins in HAL??
Here is my HAL-file (just for start) and dmesg out - what am i doing wrong?
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=5 num_pwmgens=7 sserial_port_0=00000 "
setp hm2_5i25.0.watchdog.timeout_ns 10000000
loadrt hal_parport cfg="0x0278 in"
loadrt pid names=pid.x,pid.z,pid.s,pid.0,pid.1,pid.2,pid.3,pid.4
loadrt abs names=abs.spindle
loadrt lowpass names=lowpass.spindle
loadrt scale names=scale.spindle
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 numBits=50 numWords=50
loadrt mux16 names=jogincr
addf parport.0.read servo-thread
addf parport.0.write servo-thread
addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread
addf pid.3.do-pid-calcs servo-thread
addf pid.4.do-pid-calcs servo-thread
addf classicladder.0.refresh servo-thread
addf jogincr servo-thread
addf abs.spindle servo-thread
addf scale.spindle servo-thread
addf lowpass.spindle servo-thread
addf hm2_5i25.0.write servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
# external output signals
# external input signals
# --- BOTH-X ---
#net both-x <= hm2_5i25.0.7i77.0.0.input-00
# --- BOTH-Z ---
#net both-z <= hm2_5i25.0.7i77.0.0.input-01
# --- BOTH-Y ---
#net both-y <= hm2_5i25.0.7i77.0.0.input-02
# --- BOTH-A ---
#net both-a <= hm2_5i25.0.7i77.0.0.input-03
# --- HOME-X ---
#net home-x <= hm2_5i25.0.7i77.0.0.input-04
# --- HOME-Z ---
#net home-z <= hm2_5i25.0.7i77.0.0.input-05
# --- HOME-Y ---
#net home-y <= hm2_5i25.0.7i77.0.0.input-06
# --- HOME-A ---
#net home-a <= hm2_5i25.0.7i77.0.0.input-07
# --- ESTOP-EXT ---
#net estop-ext <= hm2_5i25.0.7i77.0.0.input-08
# --- SPINDLE-AT-SPEED ---
#net spindle-at-speed <= hm2_5i25.0.7i77.0.0.input-09
# --- CYCLE-START ---
#net cycle-start <= parport.0.pin-02-in
# --- ABORT ---
#net abort <= parport.0.pin-03-in
# --- JOG-SELECTED-POS ---
#net jog-selected-pos <= parport.0.pin-04-in
# --- JOG-SELECTED-NEG ---
#net jog-selected-neg <= parport.0.pin-05-in
# --- JOG-INCR-A ---
#net jog-incr-a <= parport.0.pin-06-in
# --- JOG-INCR-B ---
#net jog-incr-b <= parport.0.pin-07-in
# --- JOG-INCR-C ---
#net jog-incr-c <= parport.0.pin-08-in
# --- JOG-INCR-C ---
#net jog-incr-c <= parport.0.pin-09-in
# --- JOG-INCR-D ---
#net jog-incr-d <= parport.0.pin-10-in
# --- JOINT-SELECT-A ---
#net joint-select-a <= parport.0.pin-11-in
# --- JOINT-SELECT-B ---
#net joint-select-b <= parport.0.pin-12-in
# --- JOINT-SELECT-C ---
#net joint-select-c <= parport.0.pin-13-in
# --- JOINT-SELECT-D ---
#net joint-select-d <= parport.0.pin-15-in
#*******************
# AXIS X
#*******************
setp pid.x.Pgain [AXIS_0]P
setp pid.x.Igain [AXIS_0]I
setp pid.x.Dgain [AXIS_0]D
setp pid.x.bias [AXIS_0]BIAS
setp pid.x.FF0 [AXIS_0]FF0
setp pid.x.FF1 [AXIS_0]FF1
setp pid.x.FF2 [AXIS_0]FF2
setp pid.x.deadband [AXIS_0]DEADBAND
setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-output => pid.x.output
net x-pos-cmd => pid.x.command
net x-vel-fb => pid.x.feedback-deriv
net x-pos-fb => pid.x.feedback
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.4.analogout1-scalemax [AXIS_0]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.4.analogout1-minlim [AXIS_0]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.4.analogout1-maxlim [AXIS_0]OUTPUT_MAX_LIMIT
net x-output => hm2_5i25.0.7i77.0.4.analogout1
net x-pos-cmd axis.0.motor-pos-cmd
net x-enable axis.0.amp-enable-out
# enable _all_ sserial pwmgens
net x-enable hm2_5i25.0.7i77.0.4.analogena
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.00.counter-mode 0
setp hm2_5i25.0.encoder.00.filter 1
setp hm2_5i25.0.encoder.00.index-invert 0
setp hm2_5i25.0.encoder.00.index-mask 0
setp hm2_5i25.0.encoder.00.index-mask-invert 0
setp hm2_5i25.0.encoder.00.scale [AXIS_0]ENCODER_SCALE
net x-pos-fb <= hm2_5i25.0.encoder.00.position
net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
net x-pos-fb => axis.0.motor-pos-fb
net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts
# ---setup home / limit switch signals---
net home-x => axis.0.home-sw-in
net both-x => axis.0.neg-lim-sw-in
net both-x => axis.0.pos-lim-sw-in
#*******************
# AXIS Z
#*******************
setp pid.z.Pgain [AXIS_2]P
setp pid.z.Igain [AXIS_2]I
setp pid.z.Dgain [AXIS_2]D
setp pid.z.bias [AXIS_2]BIAS
setp pid.z.FF0 [AXIS_2]FF0
setp pid.z.FF1 [AXIS_2]FF1
setp pid.z.FF2 [AXIS_2]FF2
setp pid.z.deadband [AXIS_2]DEADBAND
setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
net z-index-enable <=> pid.z.index-enable
net z-enable => pid.z.enable
net z-output => pid.z.output
net z-pos-cmd => pid.z.command
net z-vel-fb => pid.z.feedback-deriv
net z-pos-fb => pid.z.feedback
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.4.analogout2-scalemax [AXIS_2]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.4.analogout2-minlim [AXIS_2]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.4.analogout2-maxlim [AXIS_2]OUTPUT_MAX_LIMIT
net z-output => hm2_5i25.0.7i77.0.4.analogout2
net z-pos-cmd axis.2.motor-pos-cmd
net z-enable axis.2.amp-enable-out
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.01.counter-mode 0
setp hm2_5i25.0.encoder.01.filter 1
setp hm2_5i25.0.encoder.01.index-invert 0
setp hm2_5i25.0.encoder.01.index-mask 0
setp hm2_5i25.0.encoder.01.index-mask-invert 0
setp hm2_5i25.0.encoder.01.scale [AXIS_2]ENCODER_SCALE
net z-pos-fb <= hm2_5i25.0.encoder.01.position
net z-vel-fb <= hm2_5i25.0.encoder.01.velocity
net z-pos-fb => axis.2.motor-pos-fb
net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.01.index-enable
net z-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
# ---setup home / limit switch signals---
net home-z => axis.2.home-sw-in
net both-z => axis.2.neg-lim-sw-in
net both-z => axis.2.pos-lim-sw-in
#*******************
# SPINDLE S
#*******************
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.4.analogout0-scalemax [SPINDLE_9]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.4.analogout0-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.4.analogout0-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
net spindle-vel-cmd => hm2_5i25.0.7i77.0.4.analogout0
net machine-is-enabled => hm2_5i25.0.7i77.0.4.spinena
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.04.counter-mode 0
setp hm2_5i25.0.encoder.04.filter 1
setp hm2_5i25.0.encoder.04.index-invert 0
setp hm2_5i25.0.encoder.04.index-mask 0
setp hm2_5i25.0.encoder.04.index-mask-invert 0
setp hm2_5i25.0.encoder.04.scale [SPINDLE_9]ENCODER_SCALE
net spindle-revs <= hm2_5i25.0.encoder.04.position
net spindle-vel-fb <= hm2_5i25.0.encoder.04.velocity
net spindle-index-enable <=> hm2_5i25.0.encoder.04.index-enable
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-vel-cmd <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-on <= 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
# Use ACTUAL spindle velocity from spindle encoder
# spindle-velocity bounces around so we filter it with lowpass
# spindle-velocity is signed so we use absolute component to remove sign
# ACTUAL velocity is in RPS not RPM so we scale it.
setp scale.spindle.gain 60
setp lowpass.spindle.gain 1.000000
net spindle-vel-fb => lowpass.spindle.in
net spindle-fb-filtered-rps lowpass.spindle.out => abs.spindle.in
net spindle-fb-filtered-abs-rps abs.spindle.out => scale.spindle.in
net spindle-fb-filtered-abs-rpm scale.spindle.out
#******************************
# 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-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
# ---jogwheel signals to mesa encoder - shared MPG---
#net joint-selected-count <= hm2_5i25.0.encoder.05.count
# ---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 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 selectable mpg jog increments
net jog-incr-a => jogincr.sel0
net jog-incr-b => jogincr.sel1
net jog-incr-c => jogincr.sel2
net jog-incr-d => jogincr.sel3
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.000000
setp jogincr.in01 0.001000
setp jogincr.in02 0.010000
setp jogincr.in03 0.001000
setp jogincr.in04 0.100000
setp jogincr.in05 0.010000
setp jogincr.in06 0.050000
setp jogincr.in07 0.100000
setp jogincr.in08 1.000000
setp jogincr.in09 0.000000
setp jogincr.in10 0.000000
setp jogincr.in11 0.000000
setp jogincr.in12 0.000000
setp jogincr.in13 0.000000
setp jogincr.in14 0.000000
setp jogincr.in15 0.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
# ****Установки для программы внешнего АВОСТ -START ****
net estop-out => classicladder.0.in-00
net estop-ext => classicladder.0.in-01
net estop-strobe classicladder.0.in-02 <= iocontrol.0.user-request-enable
net estop-outcl classicladder.0.out-00 => iocontrol.0.emc-enable-in
# ****Установки для программы внешнего АВОСТ -END ****
# ---toolchange signals for custom tool changer---
net tool-number <= iocontrol.0.tool-prep-number
net tool-change-request <= iocontrol.0.tool-change
net tool-change-confirmed => iocontrol.0.tool-changed
net tool-prepare-request <= iocontrol.0.tool-prepare
net tool-prepare-confirmed => iocontrol.0.tool-prepared
# Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI
loadusr classicladder --nogui custom.clp
==================
[12502.990047] I-pipe: head domain RTAI registered.
[12502.990061] RTAI[hal]: compiled with gcc version 4.7.2 (Debian 4.7.2-5) .
[12502.990226] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[12502.990236] SYSINFO: CPUs 4, LINUX APIC IRQ 2312, TIM_FREQ 12499498, CLK_FREQ 1800019000, CPU_FREQ 1800019000
[12502.990245] RTAI_APIC_TIMER_IPI: RTAI DEFINED 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
[12502.990254] TIMER NAME: lapic; VARIOUSLY FOUND APIC FREQs: 12499498, 12499498, 12349000
[12503.005194] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[12503.005319] , <uses LINUX SYSCALLs>, kstacks pool size = 524288 bytes.
[12503.005331] RTAI[sched]: hard timer type/freq = APIC/12499498(Hz); default timing: oneshot; linear timed lists.
[12503.005340] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1800019000 hz.
[12503.005346] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
[12503.021430] RTAI[math]: loaded.
[12503.220337] hm2: loading Mesa HostMot2 driver version 0.15
[12503.224544] hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7
[12503.224630] hm2_pci: discovered 5i25 at 0000:05:00.0
[12503.226691] hm2/hm2_5i25.0: Smart Serial Firmware Version 38
[12503.283982] Board hm2_5i25.0.7i77.0.1 Hardware Mode 0 = standard
[12503.287294] Board hm2_5i25.0.7i77.0.1 Software Mode 0 = analogout_enables
[12503.393028] Board hm2_5i25.0.7i77.0.4 Hardware Mode 0 = standard
[12503.396470] Board hm2_5i25.0.7i77.0.4 Software Mode 0 = analogout_enables
[12503.547741] hm2/hm2_5i25.0: 34 I/O Pins used:
[12503.547751] hm2/hm2_5i25.0: IO Pin 000 (P3-01): IOPort
[12503.547758] hm2/hm2_5i25.0: IO Pin 001 (P3-14): IOPort
[12503.547764] hm2/hm2_5i25.0: IO Pin 002 (P3-02): IOPort
[12503.547772] hm2/hm2_5i25.0: IO Pin 003 (P3-15): Smart Serial Interface #0, pin TxData1 (Output)
[12503.547781] hm2/hm2_5i25.0: IO Pin 004 (P3-03): Smart Serial Interface #0, pin RxData1 (Input)
[12503.547788] hm2/hm2_5i25.0: IO Pin 005 (P3-16): IOPort
[12503.547794] hm2/hm2_5i25.0: IO Pin 006 (P3-04): IOPort
[12503.547801] hm2/hm2_5i25.0: IO Pin 007 (P3-17): Muxed Encoder Select #0, pin Mux Select 0 (Output)
[12503.547809] hm2/hm2_5i25.0: IO Pin 008 (P3-05): Muxed Encoder #0, pin Muxed A (Input)
[12503.547817] hm2/hm2_5i25.0: IO Pin 009 (P3-06): Muxed Encoder #0, pin Muxed B (Input)
[12503.547825] hm2/hm2_5i25.0: IO Pin 010 (P3-07): Muxed Encoder #0, pin Muxed Index (Input)
[12503.547832] hm2/hm2_5i25.0: IO Pin 011 (P3-08): Muxed Encoder #1, pin Muxed A (Input)
[12503.547840] hm2/hm2_5i25.0: IO Pin 012 (P3-09): Muxed Encoder #1, pin Muxed B (Input)
[12503.547848] hm2/hm2_5i25.0: IO Pin 013 (P3-10): Muxed Encoder #1, pin Muxed Index (Input)
[12503.547855] hm2/hm2_5i25.0: IO Pin 014 (P3-11): Muxed Encoder #2, pin Muxed A (Input)
[12503.547863] hm2/hm2_5i25.0: IO Pin 015 (P3-12): Muxed Encoder #2, pin Muxed B (Input)
[12503.547871] hm2/hm2_5i25.0: IO Pin 016 (P3-13): Muxed Encoder #2, pin Muxed Index (Input)
[12503.547878] hm2/hm2_5i25.0: IO Pin 017 (P2-01): IOPort
[12503.547884] hm2/hm2_5i25.0: IO Pin 018 (P2-14): IOPort
[12503.547890] hm2/hm2_5i25.0: IO Pin 019 (P2-02): IOPort
[12503.547897] hm2/hm2_5i25.0: IO Pin 020 (P2-15): Smart Serial Interface #0, pin TxData4 (Output)
[12503.547905] hm2/hm2_5i25.0: IO Pin 021 (P2-03): Smart Serial Interface #0, pin RxData4 (Input)
[12503.547912] hm2/hm2_5i25.0: IO Pin 022 (P2-16): IOPort
[12503.547918] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
[12503.547925] hm2/hm2_5i25.0: IO Pin 024 (P2-17): IOPort
[12503.547931] hm2/hm2_5i25.0: IO Pin 025 (P2-05): IOPort
[12503.547937] hm2/hm2_5i25.0: IO Pin 026 (P2-06): IOPort
[12503.547943] hm2/hm2_5i25.0: IO Pin 027 (P2-07): IOPort
[12503.547949] hm2/hm2_5i25.0: IO Pin 028 (P2-08): IOPort
[12503.547955] hm2/hm2_5i25.0: IO Pin 029 (P2-09): IOPort
[12503.547961] hm2/hm2_5i25.0: IO Pin 030 (P2-10): IOPort
[12503.547968] hm2/hm2_5i25.0: IO Pin 031 (P2-11): IOPort
[12503.547974] hm2/hm2_5i25.0: IO Pin 032 (P2-12): IOPort
[12503.547980] hm2/hm2_5i25.0: IO Pin 033 (P2-13): IOPort
[12503.548186] hm2/hm2_5i25.0: registered
[12503.548195] hm2_5i25.0: initialized AnyIO board at 0000:05:00.0
[12503.553049] config string '0x0278 in'
[12503.579740] creating ladder-state...
I'm trying to start configuring set of Mesa cards for this retrofiting:
linuxcnc.org/hardy/hardy/emc2/emc2/index...ve-tool?limitstart=0
Now on my table:
5i25 (with two smart-serial ports)
=>7i77 (5 encoders + 5 axis + 1 spindle out + inputs and outputs) => 7i64 (inputs and outputs)
=>7i77 (1 spindle out + inputs and outputs)
Then i'm starting LinuxCNC i can't see any IO hal pins like hm2_5i25.0.7i77.0.0.input-00 for one 7i77-car and hm2_5i25.0.7i77.1.0.input-00 for another.
And also how can i set up 7i64 on RS-422 to see it's IO pins in HAL??
Here is my HAL-file (just for start) and dmesg out - what am i doing wrong?
Warning: Spoiler!
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=5 num_pwmgens=7 sserial_port_0=00000 "
setp hm2_5i25.0.watchdog.timeout_ns 10000000
loadrt hal_parport cfg="0x0278 in"
loadrt pid names=pid.x,pid.z,pid.s,pid.0,pid.1,pid.2,pid.3,pid.4
loadrt abs names=abs.spindle
loadrt lowpass names=lowpass.spindle
loadrt scale names=scale.spindle
loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 numBits=50 numWords=50
loadrt mux16 names=jogincr
addf parport.0.read servo-thread
addf parport.0.write servo-thread
addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf pid.0.do-pid-calcs servo-thread
addf pid.1.do-pid-calcs servo-thread
addf pid.2.do-pid-calcs servo-thread
addf pid.3.do-pid-calcs servo-thread
addf pid.4.do-pid-calcs servo-thread
addf classicladder.0.refresh servo-thread
addf jogincr servo-thread
addf abs.spindle servo-thread
addf scale.spindle servo-thread
addf lowpass.spindle servo-thread
addf hm2_5i25.0.write servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
# external output signals
# external input signals
# --- BOTH-X ---
#net both-x <= hm2_5i25.0.7i77.0.0.input-00
# --- BOTH-Z ---
#net both-z <= hm2_5i25.0.7i77.0.0.input-01
# --- BOTH-Y ---
#net both-y <= hm2_5i25.0.7i77.0.0.input-02
# --- BOTH-A ---
#net both-a <= hm2_5i25.0.7i77.0.0.input-03
# --- HOME-X ---
#net home-x <= hm2_5i25.0.7i77.0.0.input-04
# --- HOME-Z ---
#net home-z <= hm2_5i25.0.7i77.0.0.input-05
# --- HOME-Y ---
#net home-y <= hm2_5i25.0.7i77.0.0.input-06
# --- HOME-A ---
#net home-a <= hm2_5i25.0.7i77.0.0.input-07
# --- ESTOP-EXT ---
#net estop-ext <= hm2_5i25.0.7i77.0.0.input-08
# --- SPINDLE-AT-SPEED ---
#net spindle-at-speed <= hm2_5i25.0.7i77.0.0.input-09
# --- CYCLE-START ---
#net cycle-start <= parport.0.pin-02-in
# --- ABORT ---
#net abort <= parport.0.pin-03-in
# --- JOG-SELECTED-POS ---
#net jog-selected-pos <= parport.0.pin-04-in
# --- JOG-SELECTED-NEG ---
#net jog-selected-neg <= parport.0.pin-05-in
# --- JOG-INCR-A ---
#net jog-incr-a <= parport.0.pin-06-in
# --- JOG-INCR-B ---
#net jog-incr-b <= parport.0.pin-07-in
# --- JOG-INCR-C ---
#net jog-incr-c <= parport.0.pin-08-in
# --- JOG-INCR-C ---
#net jog-incr-c <= parport.0.pin-09-in
# --- JOG-INCR-D ---
#net jog-incr-d <= parport.0.pin-10-in
# --- JOINT-SELECT-A ---
#net joint-select-a <= parport.0.pin-11-in
# --- JOINT-SELECT-B ---
#net joint-select-b <= parport.0.pin-12-in
# --- JOINT-SELECT-C ---
#net joint-select-c <= parport.0.pin-13-in
# --- JOINT-SELECT-D ---
#net joint-select-d <= parport.0.pin-15-in
#*******************
# AXIS X
#*******************
setp pid.x.Pgain [AXIS_0]P
setp pid.x.Igain [AXIS_0]I
setp pid.x.Dgain [AXIS_0]D
setp pid.x.bias [AXIS_0]BIAS
setp pid.x.FF0 [AXIS_0]FF0
setp pid.x.FF1 [AXIS_0]FF1
setp pid.x.FF2 [AXIS_0]FF2
setp pid.x.deadband [AXIS_0]DEADBAND
setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-output => pid.x.output
net x-pos-cmd => pid.x.command
net x-vel-fb => pid.x.feedback-deriv
net x-pos-fb => pid.x.feedback
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.4.analogout1-scalemax [AXIS_0]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.4.analogout1-minlim [AXIS_0]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.4.analogout1-maxlim [AXIS_0]OUTPUT_MAX_LIMIT
net x-output => hm2_5i25.0.7i77.0.4.analogout1
net x-pos-cmd axis.0.motor-pos-cmd
net x-enable axis.0.amp-enable-out
# enable _all_ sserial pwmgens
net x-enable hm2_5i25.0.7i77.0.4.analogena
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.00.counter-mode 0
setp hm2_5i25.0.encoder.00.filter 1
setp hm2_5i25.0.encoder.00.index-invert 0
setp hm2_5i25.0.encoder.00.index-mask 0
setp hm2_5i25.0.encoder.00.index-mask-invert 0
setp hm2_5i25.0.encoder.00.scale [AXIS_0]ENCODER_SCALE
net x-pos-fb <= hm2_5i25.0.encoder.00.position
net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
net x-pos-fb => axis.0.motor-pos-fb
net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts
# ---setup home / limit switch signals---
net home-x => axis.0.home-sw-in
net both-x => axis.0.neg-lim-sw-in
net both-x => axis.0.pos-lim-sw-in
#*******************
# AXIS Z
#*******************
setp pid.z.Pgain [AXIS_2]P
setp pid.z.Igain [AXIS_2]I
setp pid.z.Dgain [AXIS_2]D
setp pid.z.bias [AXIS_2]BIAS
setp pid.z.FF0 [AXIS_2]FF0
setp pid.z.FF1 [AXIS_2]FF1
setp pid.z.FF2 [AXIS_2]FF2
setp pid.z.deadband [AXIS_2]DEADBAND
setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
net z-index-enable <=> pid.z.index-enable
net z-enable => pid.z.enable
net z-output => pid.z.output
net z-pos-cmd => pid.z.command
net z-vel-fb => pid.z.feedback-deriv
net z-pos-fb => pid.z.feedback
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.4.analogout2-scalemax [AXIS_2]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.4.analogout2-minlim [AXIS_2]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.4.analogout2-maxlim [AXIS_2]OUTPUT_MAX_LIMIT
net z-output => hm2_5i25.0.7i77.0.4.analogout2
net z-pos-cmd axis.2.motor-pos-cmd
net z-enable axis.2.amp-enable-out
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.01.counter-mode 0
setp hm2_5i25.0.encoder.01.filter 1
setp hm2_5i25.0.encoder.01.index-invert 0
setp hm2_5i25.0.encoder.01.index-mask 0
setp hm2_5i25.0.encoder.01.index-mask-invert 0
setp hm2_5i25.0.encoder.01.scale [AXIS_2]ENCODER_SCALE
net z-pos-fb <= hm2_5i25.0.encoder.01.position
net z-vel-fb <= hm2_5i25.0.encoder.01.velocity
net z-pos-fb => axis.2.motor-pos-fb
net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.01.index-enable
net z-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
# ---setup home / limit switch signals---
net home-z => axis.2.home-sw-in
net both-z => axis.2.neg-lim-sw-in
net both-z => axis.2.pos-lim-sw-in
#*******************
# SPINDLE S
#*******************
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.4.analogout0-scalemax [SPINDLE_9]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.4.analogout0-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.4.analogout0-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
net spindle-vel-cmd => hm2_5i25.0.7i77.0.4.analogout0
net machine-is-enabled => hm2_5i25.0.7i77.0.4.spinena
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.04.counter-mode 0
setp hm2_5i25.0.encoder.04.filter 1
setp hm2_5i25.0.encoder.04.index-invert 0
setp hm2_5i25.0.encoder.04.index-mask 0
setp hm2_5i25.0.encoder.04.index-mask-invert 0
setp hm2_5i25.0.encoder.04.scale [SPINDLE_9]ENCODER_SCALE
net spindle-revs <= hm2_5i25.0.encoder.04.position
net spindle-vel-fb <= hm2_5i25.0.encoder.04.velocity
net spindle-index-enable <=> hm2_5i25.0.encoder.04.index-enable
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-vel-cmd <= motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-on <= 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
# Use ACTUAL spindle velocity from spindle encoder
# spindle-velocity bounces around so we filter it with lowpass
# spindle-velocity is signed so we use absolute component to remove sign
# ACTUAL velocity is in RPS not RPM so we scale it.
setp scale.spindle.gain 60
setp lowpass.spindle.gain 1.000000
net spindle-vel-fb => lowpass.spindle.in
net spindle-fb-filtered-rps lowpass.spindle.out => abs.spindle.in
net spindle-fb-filtered-abs-rps abs.spindle.out => scale.spindle.in
net spindle-fb-filtered-abs-rpm scale.spindle.out
#******************************
# 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-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
# ---jogwheel signals to mesa encoder - shared MPG---
#net joint-selected-count <= hm2_5i25.0.encoder.05.count
# ---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 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 selectable mpg jog increments
net jog-incr-a => jogincr.sel0
net jog-incr-b => jogincr.sel1
net jog-incr-c => jogincr.sel2
net jog-incr-d => jogincr.sel3
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.000000
setp jogincr.in01 0.001000
setp jogincr.in02 0.010000
setp jogincr.in03 0.001000
setp jogincr.in04 0.100000
setp jogincr.in05 0.010000
setp jogincr.in06 0.050000
setp jogincr.in07 0.100000
setp jogincr.in08 1.000000
setp jogincr.in09 0.000000
setp jogincr.in10 0.000000
setp jogincr.in11 0.000000
setp jogincr.in12 0.000000
setp jogincr.in13 0.000000
setp jogincr.in14 0.000000
setp jogincr.in15 0.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
# ****Установки для программы внешнего АВОСТ -START ****
net estop-out => classicladder.0.in-00
net estop-ext => classicladder.0.in-01
net estop-strobe classicladder.0.in-02 <= iocontrol.0.user-request-enable
net estop-outcl classicladder.0.out-00 => iocontrol.0.emc-enable-in
# ****Установки для программы внешнего АВОСТ -END ****
# ---toolchange signals for custom tool changer---
net tool-number <= iocontrol.0.tool-prep-number
net tool-change-request <= iocontrol.0.tool-change
net tool-change-confirmed => iocontrol.0.tool-changed
net tool-prepare-request <= iocontrol.0.tool-prepare
net tool-prepare-confirmed => iocontrol.0.tool-prepared
# Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI
loadusr classicladder --nogui custom.clp
==================
[12502.990047] I-pipe: head domain RTAI registered.
[12502.990061] RTAI[hal]: compiled with gcc version 4.7.2 (Debian 4.7.2-5) .
[12502.990226] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[12502.990236] SYSINFO: CPUs 4, LINUX APIC IRQ 2312, TIM_FREQ 12499498, CLK_FREQ 1800019000, CPU_FREQ 1800019000
[12502.990245] RTAI_APIC_TIMER_IPI: RTAI DEFINED 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
[12502.990254] TIMER NAME: lapic; VARIOUSLY FOUND APIC FREQs: 12499498, 12499498, 12349000
[12503.005194] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[12503.005319] , <uses LINUX SYSCALLs>, kstacks pool size = 524288 bytes.
[12503.005331] RTAI[sched]: hard timer type/freq = APIC/12499498(Hz); default timing: oneshot; linear timed lists.
[12503.005340] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 1800019000 hz.
[12503.005346] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
[12503.021430] RTAI[math]: loaded.
[12503.220337] hm2: loading Mesa HostMot2 driver version 0.15
[12503.224544] hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7
[12503.224630] hm2_pci: discovered 5i25 at 0000:05:00.0
[12503.226691] hm2/hm2_5i25.0: Smart Serial Firmware Version 38
[12503.283982] Board hm2_5i25.0.7i77.0.1 Hardware Mode 0 = standard
[12503.287294] Board hm2_5i25.0.7i77.0.1 Software Mode 0 = analogout_enables
[12503.393028] Board hm2_5i25.0.7i77.0.4 Hardware Mode 0 = standard
[12503.396470] Board hm2_5i25.0.7i77.0.4 Software Mode 0 = analogout_enables
[12503.547741] hm2/hm2_5i25.0: 34 I/O Pins used:
[12503.547751] hm2/hm2_5i25.0: IO Pin 000 (P3-01): IOPort
[12503.547758] hm2/hm2_5i25.0: IO Pin 001 (P3-14): IOPort
[12503.547764] hm2/hm2_5i25.0: IO Pin 002 (P3-02): IOPort
[12503.547772] hm2/hm2_5i25.0: IO Pin 003 (P3-15): Smart Serial Interface #0, pin TxData1 (Output)
[12503.547781] hm2/hm2_5i25.0: IO Pin 004 (P3-03): Smart Serial Interface #0, pin RxData1 (Input)
[12503.547788] hm2/hm2_5i25.0: IO Pin 005 (P3-16): IOPort
[12503.547794] hm2/hm2_5i25.0: IO Pin 006 (P3-04): IOPort
[12503.547801] hm2/hm2_5i25.0: IO Pin 007 (P3-17): Muxed Encoder Select #0, pin Mux Select 0 (Output)
[12503.547809] hm2/hm2_5i25.0: IO Pin 008 (P3-05): Muxed Encoder #0, pin Muxed A (Input)
[12503.547817] hm2/hm2_5i25.0: IO Pin 009 (P3-06): Muxed Encoder #0, pin Muxed B (Input)
[12503.547825] hm2/hm2_5i25.0: IO Pin 010 (P3-07): Muxed Encoder #0, pin Muxed Index (Input)
[12503.547832] hm2/hm2_5i25.0: IO Pin 011 (P3-08): Muxed Encoder #1, pin Muxed A (Input)
[12503.547840] hm2/hm2_5i25.0: IO Pin 012 (P3-09): Muxed Encoder #1, pin Muxed B (Input)
[12503.547848] hm2/hm2_5i25.0: IO Pin 013 (P3-10): Muxed Encoder #1, pin Muxed Index (Input)
[12503.547855] hm2/hm2_5i25.0: IO Pin 014 (P3-11): Muxed Encoder #2, pin Muxed A (Input)
[12503.547863] hm2/hm2_5i25.0: IO Pin 015 (P3-12): Muxed Encoder #2, pin Muxed B (Input)
[12503.547871] hm2/hm2_5i25.0: IO Pin 016 (P3-13): Muxed Encoder #2, pin Muxed Index (Input)
[12503.547878] hm2/hm2_5i25.0: IO Pin 017 (P2-01): IOPort
[12503.547884] hm2/hm2_5i25.0: IO Pin 018 (P2-14): IOPort
[12503.547890] hm2/hm2_5i25.0: IO Pin 019 (P2-02): IOPort
[12503.547897] hm2/hm2_5i25.0: IO Pin 020 (P2-15): Smart Serial Interface #0, pin TxData4 (Output)
[12503.547905] hm2/hm2_5i25.0: IO Pin 021 (P2-03): Smart Serial Interface #0, pin RxData4 (Input)
[12503.547912] hm2/hm2_5i25.0: IO Pin 022 (P2-16): IOPort
[12503.547918] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
[12503.547925] hm2/hm2_5i25.0: IO Pin 024 (P2-17): IOPort
[12503.547931] hm2/hm2_5i25.0: IO Pin 025 (P2-05): IOPort
[12503.547937] hm2/hm2_5i25.0: IO Pin 026 (P2-06): IOPort
[12503.547943] hm2/hm2_5i25.0: IO Pin 027 (P2-07): IOPort
[12503.547949] hm2/hm2_5i25.0: IO Pin 028 (P2-08): IOPort
[12503.547955] hm2/hm2_5i25.0: IO Pin 029 (P2-09): IOPort
[12503.547961] hm2/hm2_5i25.0: IO Pin 030 (P2-10): IOPort
[12503.547968] hm2/hm2_5i25.0: IO Pin 031 (P2-11): IOPort
[12503.547974] hm2/hm2_5i25.0: IO Pin 032 (P2-12): IOPort
[12503.547980] hm2/hm2_5i25.0: IO Pin 033 (P2-13): IOPort
[12503.548186] hm2/hm2_5i25.0: registered
[12503.548195] hm2_5i25.0: initialized AnyIO board at 0000:05:00.0
[12503.553049] config string '0x0278 in'
[12503.579740] creating ladder-state...
Last edit: 29 Dec 2014 03:59 by machete.
Please Log in or Create an account to join the conversation.
29 Dec 2014 04:03 #54346
by PCW
Replied by PCW on topic How to start configuration 5i25->7i77+7i77->7i64
For the digital I/O parts of the 7I77 I/O to work requires that field power be present when the interface is started
Therefore you must have the 12 or 24V field power connected to TB2 (Yellow LED CR3 should be on)
In your hal file you have "num_pwmgens=7" this should be removed as there are no pwmgens in 7I77 configs
Therefore you must have the 12 or 24V field power connected to TB2 (Yellow LED CR3 should be on)
In your hal file you have "num_pwmgens=7" this should be removed as there are no pwmgens in 7I77 configs
Please Log in or Create an account to join the conversation.
31 Dec 2014 03:41 #54433
by machete
It works:
1. 5i25 change two jumpers (W1-UP and W2-UP) to put supply +5V in cables to power up both 7i77
2. 7i77 (both) provide +12V to VFIELD tab TB2 (pin 1 and pin 8) - from external power source.
3. 7i64 make jumper W2-DOWN (W1-UP, W2-DOWN, W1-UP for exactly 2.5 MBAUD for SSerial),
and W9-DOWN (but i'm not sure it's necessary)
Thats right!
Thank you for help!
Replied by machete on topic How to start configuration 5i25->7i77+7i77->7i64
For the digital I/O parts of the 7I77 I/O to work requires that field power be present when the interface is started
Therefore you must have the 12 or 24V field power connected to TB2 (Yellow LED CR3 should be on)
It works:
1. 5i25 change two jumpers (W1-UP and W2-UP) to put supply +5V in cables to power up both 7i77
2. 7i77 (both) provide +12V to VFIELD tab TB2 (pin 1 and pin 8) - from external power source.
3. 7i64 make jumper W2-DOWN (W1-UP, W2-DOWN, W1-UP for exactly 2.5 MBAUD for SSerial),
and W9-DOWN (but i'm not sure it's necessary)
In your hal file you have "num_pwmgens=7" this should be removed as there are no pwmgens in 7I77 configs
Thats right!
Thank you for help!
Please Log in or Create an account to join the conversation.
Time to create page: 0.157 seconds