{\rtf1\ansi\ansicpg1252\cocoartf2822 \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} {\*\expandedcolortbl;;} \margl1440\margr1440\vieww11520\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\fs24 \cf0 \ # This file was created with the Mesa Configuration Tool on Mar 08 2025 10:40:46\ # If you make changes to this file DO NOT run the configuration tool again!\ # This file will be replaced with a new file if you do!\ \ # kinematics\ loadrt [KINS](KINEMATICS)\ \ # motion controller\ loadrt [EMCMOT](EMCMOT) servo_period_nsec=[EMCMOT](SERVO_PERIOD) num_joints=[KINS](JOINTS)\ \ #boot for pico servo amplifier\ loadrt boot\ loadrt comp count=4\ \ # hostmot2 driver\ loadrt hostmot2\ loadrt [HM2](DRIVER) board_ip=[HM2](ADDRESS) config="num_encoders=4 num_pwmgens=5 sserial_port_0=00000000"\ \ # manual tool change#\ loadusr -W hal_manualtoolchange\ net tool-change hal_manualtoolchange.change <= iocontrol.0.tool-change\ net tool-changed hal_manualtoolchange.changed <= iocontrol.0.tool-changed => hm2_[MESA](BOARD).0.ssr.00.out-02\ net tool-prep-number hal_manualtoolchange.number <= iocontrol.0.tool-prep-number\ \ \ setp hm2_[MESA](BOARD).0.watchdog.timeout_ns 5000000\ \ loadrt pid names=pid.x,pid.y0,pid.y1,pid.z,pid.s\ \ # THREADS\ addf hm2_[MESA](BOARD).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.y0.do-pid-calcs servo-thread\ addf pid.y1.do-pid-calcs servo-thread\ addf pid.z.do-pid-calcs servo-thread\ addf pid.s.do-pid-calcs servo-thread\ \ addf hm2_[MESA](BOARD).0.write servo-thread\ \ \ #boot and comp for pico servo amp\ addf boot.0 servo-thread\ addf comp.0 servo-thread\ addf comp.1 servo-thread\ addf comp.2 servo-thread\ addf comp.3 servo-thread\ \ # amp enable\ net motion-enable hm2_[MESA](BOARD).0.ssr.00.out-00 <= motion.motion-enabled\ \ # Global PWM setup\ setp hm2_[MESA](BOARD).0.pwmgen.pwm_frequency 50000 # originally 75000\ \ # Board: 7i95t\ \ # Axis: X Joint: 0 Output: 0\ # PID Setup\ setp pid.x.Pgain [JOINT_0](P)\ setp pid.x.Igain [JOINT_0](I)\ setp pid.x.Dgain [JOINT_0](D)\ setp pid.x.bias [JOINT_0](BIAS)\ setp pid.x.FF0 [JOINT_0](FF0)\ setp pid.x.FF1 [JOINT_0](FF1)\ setp pid.x.FF2 [JOINT_0](FF2)\ setp pid.x.deadband [JOINT_0](DEADBAND)\ setp pid.x.maxoutput [JOINT_0](MAX_OUTPUT)\ setp pid.x.error-previous-target True\ \ # joint-0 enable chain\ net joint-0-index-enable <=> pid.x.index-enable\ net joint-0-index-enable <=> joint.0.index-enable\ net joint-0-index-enable <=> hm2_[MESA](BOARD).0.encoder.00.index-enable\ \ #net joint-0-enable <= joint.0.amp-enable-out\ #net joint-0-enable => pid.x.enable\ net joint-0-enable => hm2_[MESA](BOARD).0.pwmgen.00.enable boot.0.enable\ \ \ # PWM Generator setup\ setp hm2_[MESA](BOARD).0.pwmgen.00.output-type 1 #PWM pin0\ setp hm2_[MESA](BOARD).0.pwmgen.00.offset-mode 0 # offset mode so 50% = 0\ setp hm2_[MESA](BOARD).0.pwmgen.00.scale [JOINT_0]SCALE\ \ # ---Encoder feedback signals/setup---\ setp hm2_[MESA](BOARD).0.encoder.00.counter-mode 0\ setp hm2_[MESA](BOARD).0.encoder.00.filter 1\ setp hm2_[MESA](BOARD).0.encoder.00.index-invert 0\ setp hm2_[MESA](BOARD).0.encoder.00.index-mask 0\ setp hm2_[MESA](BOARD).0.encoder.00.index-mask-invert 0\ setp hm2_[MESA](BOARD).0.encoder.00.scale [JOINT_0]ENCODER_SCALE\ \ # position command and feedback\ net joint-0-pos-cmd <= joint.0.motor-pos-cmd\ net joint-0-pos-cmd => pid.x.command\ \ net joint-0-pos-fb <= hm2_[MESA](BOARD).0.encoder.00.position\ net joint-0-pos-fb => joint.0.motor-pos-fb\ net joint-0-pos-fb => pid.x.feedback\ \ # PID Output\ net pid-x-signal-in pid.x.output => boot.0.pid0\ net pid-x-signal-out <= boot.0.pout0\ net pid-x-signal-out => hm2_[MESA](BOARD).0.pwmgen.00.value\ \ # Axis: Y Joint: 1 Output: 1\ # PID Setup\ setp pid.y0.Pgain [JOINT_1](P)\ setp pid.y0.Igain [JOINT_1](I)\ setp pid.y0.Dgain [JOINT_1](D)\ setp pid.y0.bias [JOINT_1](BIAS)\ setp pid.y0.FF0 [JOINT_1](FF0)\ setp pid.y0.FF1 [JOINT_1](FF1)\ setp pid.y0.FF2 [JOINT_1](FF2)\ setp pid.y0.deadband [JOINT_1](DEADBAND)\ setp pid.y0.maxoutput [JOINT_1](MAX_OUTPUT)\ setp pid.y0.error-previous-target True\ \ # joint-0 enable chain\ net joint-1-index-enable <=> pid.y0.index-enable\ net joint-1-index-enable <=> joint.1.index-enable\ net joint-1-index-enable <=> hm2_[MESA](BOARD).0.encoder.01.index-enable\ \ #net joint-1-enable <= joint.1.amp-enable-out\ #net joint-1-enable => pid.y0.enable\ net joint-1-enable => hm2_[MESA](BOARD).0.pwmgen.01.enable\ \ \ # PWM Generator setup\ setp hm2_[MESA](BOARD).0.pwmgen.01.output-type 1 #PWM pin0\ setp hm2_[MESA](BOARD).0.pwmgen.01.offset-mode 0 # offset mode so 50% = 0\ setp hm2_[MESA](BOARD).0.pwmgen.01.scale [JOINT_1]SCALE\ \ # ---Encoder feedback signals/setup---\ setp hm2_[MESA](BOARD).0.encoder.01.counter-mode 0\ setp hm2_[MESA](BOARD).0.encoder.01.filter 1\ setp hm2_[MESA](BOARD).0.encoder.01.index-invert 0\ setp hm2_[MESA](BOARD).0.encoder.01.index-mask 0\ setp hm2_[MESA](BOARD).0.encoder.01.index-mask-invert 0\ setp hm2_[MESA](BOARD).0.encoder.01.scale [JOINT_1]ENCODER_SCALE\ \ # position command and feedback\ net joint-1-pos-cmd <= joint.1.motor-pos-cmd\ net joint-1-pos-cmd => pid.y0.command\ \ net joint-1-pos-fb <= hm2_[MESA](BOARD).0.encoder.01.position\ net joint-1-pos-fb => joint.1.motor-pos-fb\ net joint-1-pos-fb => pid.y0.feedback\ \ # PID Output\ net pid-y0-signal-in pid.y0.output => boot.0.pid1\ net pid-y0-signal-out <= boot.0.pout1\ net pid-y0-signal-out => hm2_[MESA](BOARD).0.pwmgen.01.value\ \ # Axis: Y Joint: 2 Output: 2\ # PID Setup\ setp pid.y1.Pgain [JOINT_2](P)\ setp pid.y1.Igain [JOINT_2](I)\ setp pid.y1.Dgain [JOINT_2](D)\ setp pid.y1.bias [JOINT_2](BIAS)\ setp pid.y1.FF0 [JOINT_2](FF0)\ setp pid.y1.FF1 [JOINT_2](FF1)\ setp pid.y1.FF2 [JOINT_2](FF2)\ setp pid.y1.deadband [JOINT_2](DEADBAND)\ setp pid.y1.maxoutput [JOINT_2](MAX_OUTPUT)\ setp pid.y1.error-previous-target True\ \ # joint-0 enable chain\ net joint-2-index-enable <=> pid.y1.index-enable\ net joint-2-index-enable <=> joint.2.index-enable\ net joint-2-index-enable <=> hm2_[MESA](BOARD).0.encoder.02.index-enable\ \ #net joint-2-enable <= joint.2.amp-enable-out\ #net joint-2-enable => pid.y1.enable\ net joint-2-enable => hm2_[MESA](BOARD).0.pwmgen.02.enable\ \ \ # PWM Generator setup\ setp hm2_[MESA](BOARD).0.pwmgen.02.output-type 1 #PWM pin0\ setp hm2_[MESA](BOARD).0.pwmgen.02.offset-mode 0 # offset mode so 50% = 0\ setp hm2_[MESA](BOARD).0.pwmgen.02.scale [JOINT_2]SCALE\ \ # ---Encoder feedback signals/setup---\ setp hm2_[MESA](BOARD).0.encoder.02.counter-mode 0\ setp hm2_[MESA](BOARD).0.encoder.02.filter 1\ setp hm2_[MESA](BOARD).0.encoder.02.index-invert 0\ setp hm2_[MESA](BOARD).0.encoder.02.index-mask 0\ setp hm2_[MESA](BOARD).0.encoder.02.index-mask-invert 0\ setp hm2_[MESA](BOARD).0.encoder.02.scale [JOINT_2]ENCODER_SCALE\ \ # position command and feedback\ net joint-2-pos-cmd <= joint.2.motor-pos-cmd\ net joint-2-pos-cmd => pid.y1.command\ \ net joint-2-pos-fb <= hm2_[MESA](BOARD).0.encoder.02.position\ net joint-2-pos-fb => joint.2.motor-pos-fb\ net joint-2-pos-fb => pid.y1.feedback\ \ # PID Output\ net pid-y1-signal-in pid.y1.output => boot.0.pid2\ net pid-y1-signal-out <= boot.0.pout2\ net pid-y1-signal-out => hm2_[MESA](BOARD).0.pwmgen.02.value\ \ # Axis: Z Joint: 3 Output: 3\ # PID Setup\ setp pid.z.Pgain [JOINT_3](P)\ setp pid.z.Igain [JOINT_3](I)\ setp pid.z.Dgain [JOINT_3](D)\ setp pid.z.bias [JOINT_3](BIAS)\ setp pid.z.FF0 [JOINT_3](FF0)\ setp pid.z.FF1 [JOINT_3](FF1)\ setp pid.z.FF2 [JOINT_3](FF2)\ setp pid.z.deadband [JOINT_3](DEADBAND)\ setp pid.z.maxoutput [JOINT_3](MAX_OUTPUT)\ setp pid.z.error-previous-target True\ \ # joint-0 enable chain\ net joint-3-index-enable <=> pid.z.index-enable\ net joint-3-index-enable <=> joint.3.index-enable\ net joint-3-index-enable <=> hm2_[MESA](BOARD).0.encoder.03.index-enable\ \ net joint-3-enable <= joint.3.amp-enable-out\ net joint-3-enable => pid.z.enable\ net joint-3-enable => hm2_[MESA](BOARD).0.pwmgen.03.enable\ \ \ # PWM Generator setup\ setp hm2_[MESA](BOARD).0.pwmgen.03.output-type 1 #PWM pin0\ setp hm2_[MESA](BOARD).0.pwmgen.03.offset-mode 0 # offset mode so 50% = 0\ setp hm2_[MESA](BOARD).0.pwmgen.03.scale [JOINT_3]SCALE\ \ # ---Encoder feedback signals/setup---\ setp hm2_[MESA](BOARD).0.encoder.03.counter-mode 0\ setp hm2_[MESA](BOARD).0.encoder.03.filter 1\ setp hm2_[MESA](BOARD).0.encoder.03.index-invert 0\ setp hm2_[MESA](BOARD).0.encoder.03.index-mask 0\ setp hm2_[MESA](BOARD).0.encoder.03.index-mask-invert 0\ setp hm2_[MESA](BOARD).0.encoder.03.scale [JOINT_3]ENCODER_SCALE\ \ # position command and feedback\ net joint-3-pos-cmd <= joint.3.motor-pos-cmd\ net joint-3-pos-cmd => pid.z.command\ \ net joint-3-pos-fb <= hm2_[MESA](BOARD).0.encoder.03.position\ net joint-3-pos-fb => joint.3.motor-pos-fb\ net joint-3-pos-fb => pid.z.feedback\ \ # PID Output\ net pid-z-signal-in pid.z.output => boot.0.pid3\ net pid-z-signal-out <= boot.0.pout3\ net pid-z-signal-out => hm2_[MESA](BOARD).0.pwmgen.03.value\ \ ##############\ ## SPINDLE ###\ ##############\ # Spindle PWM Setup\ setp hm2_[MESA](BOARD).0.pwmgen.04.output-type [SPINDLE_0](PWM_TYPE)\ setp hm2_[MESA](BOARD).0.pwmgen.pwm_frequency [SPINDLE_0](PWM_FREQUENCY)\ setp hm2_[MESA](BOARD).0.pwmgen.04.scale [SPINDLE_0](SCALE)\ \ # Spindle Feedback\ setp spindle.0.at-speed true\ \ # Spindle Command Pins\ net spindle-on <= spindle.0.on\ net spindle-on => pid.s.enable\ net spindle-on => hm2_[MESA](BOARD).0.ssr.00.out-01\ net spindle-cw <= spindle.0.forward\ net spindle-ccw <= spindle.0.reverse\ net spindle-brake <= spindle.0.brake\ \ # Spindle Enable\ net spindle-on <= spindle.0.on\ net spindle-on => hm2_[MESA](BOARD).0.pwmgen.04.enable\ \ # Spindle Connections\ net spindle-vel-cmd <= spindle.0.speed-out\ net spindle-vel-cmd => pid.s.command\ net spindle-pid-out <= pid.s.output\ net spindle-pid-out => hm2_[MESA](BOARD).0.pwmgen.04.value\ }