Code:
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
net y1-index-enable <=> pid.y1.index-enable
net y1-enable => pid.y1.enable
net y1-pos-cmd => pid.y1.command
net y1-vel-cmd => pid.y1.command-deriv
net y1-pos-fb => pid.y1.feedback
net y1-output => pid.y1.output
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.1.analogout2-scalemax [JOINT_1]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout2-minlim [JOINT_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout2-maxlim [JOINT_1]OUTPUT_MAX_LIMIT
net y1-output => hm2_5i25.0.7i77.0.1.analogout2
net y1-pos-cmd joint.2.motor-pos-cmd
net y1-enable joint.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 [JOINT_1]ENCODER_SCALE
net y1-pos-fb <= hm2_5i25.0.encoder.02.position
net y1-vel-fb <= hm2_5i25.0.encoder.02.velocity
net y1-pos-fb => joint.2.motor-pos-fb
net y1-index-enable joint.2.index-enable <=> hm2_5i25.0.encoder.02.index-enable
net y1-pos-rawcounts <= hm2_5i25.0.encoder.02.rawcounts
# ---setup home / limit switch signals---
net y1-home-sw => joint.2.home-sw-in
net y1-neg-limit => joint.2.neg-lim-sw-in
net y1-pos-limit => joint.2.pos-lim-sw-in
For Y1 ou seem to be choosing the PID gains from the [JOINT_2] section (and I wouldn't) and the encoder scale from the [JOINT_1] section (and I wouldn't
But the main error is that you are setting the scale of encoder.01 in the joint.02 section.