since I never used steppers. I ran pncconf and transferred the results to my machine and set it to quadrature mode
this might be stupid question but why is the a PID loop?
And why is the axis moving back an forth after I jogged it?
There is no feedback coming from the encoders / servo drives to linuxcnc. this should be commented out.
and the servo drives don't move when I jog them with a manual encoder.
I am a bit confused here. Did I made a mistake in PncConf?
Thanks Patrick
Code:
# ######################################################
# Axis-of-motion Specific Configs (not the GUI)
# ######################################################
# AXIS X JOINT 0
#*******************
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
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.x.maxerror 0.012700
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-pos-cmd => pid.x.command
net x-pos-fb => pid.x.feedback
net x-output <= pid.x.output
# Step Gen signals/setup
setp hm2_7i97.0.stepgen.00.dirsetup [JOINT_0]DIRSETUP
setp hm2_7i97.0.stepgen.00.dirhold [JOINT_0]DIRHOLD
setp hm2_7i97.0.stepgen.00.steplen [JOINT_0]STEPLEN
setp hm2_7i97.0.stepgen.00.stepspace [JOINT_0]STEPSPACE
setp hm2_7i97.0.stepgen.00.position-scale [JOINT_0]STEP_SCALE
setp hm2_7i97.0.stepgen.00.step_type 2
setp hm2_7i97.0.stepgen.00.control-type 1
setp hm2_7i97.0.stepgen.00.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp hm2_7i97.0.stepgen.00.maxvel [JOINT_0]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net x-pos-cmd <= joint.0.motor-pos-cmd
net x-vel-cmd <= joint.0.vel-cmd
net x-output <= hm2_7i97.0.stepgen.00.velocity-cmd
net x-pos-fb <= hm2_7i97.0.stepgen.00.position-fb
net x-pos-fb => joint.0.motor-pos-fb
net x-enable <= joint.0.amp-enable-out
net x-enable => hm2_7i97.0.stepgen.00.enable
net freigabe => hm2_7i97.0.pwmgen.00.enable
# encoder feedback
#setp hm2_7i97.0.encoder.00.counter-mode 0
#setp hm2_7i97.0.encoder.00.filter 1
#setp hm2_7i97.0.encoder.00.index-invert 0
#setp hm2_7i97.0.encoder.00.index-mask 0
#setp hm2_7i97.0.encoder.00.index-mask-invert 0
#setp hm2_7i97.0.encoder.00.scale [JOINT_0]ENCODER_SCALE
#net motor.00.pos-fb hm2_7i97.0.encoder.00.position => pid.x.feedback
#net motor.00.pos-fb => joint.0.motor-pos-fb #push copy back to Axis GUI
# home and limit
net in_x_ref => joint.0.home-sw-in
net in_x_limit_n => joint.0.neg-lim-sw-in
net in_x_limit_p => joint.0.pos-lim-sw-in