Encoder wiring - Mesa 7i33

More
25 Mar 2011 15:14 #8071 by andypugh
This is the problem:
Debug file information:
hm2-servo.hal:205: Pin 'hm2_5i20.0.pwmgen.03.enable' does not exist
Check line 205 of your HAL file. it looks like you need to add an extra PWMgen for the spindle drive?

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 17:00 #8073 by Fordperf393W
i added this to the .ini

[AXIS_3]

TYPE = LINEAR
MAX_VELOCITY = 1.0
MAX_ACCELERATION = 4.0
BACKLASH = 0.000
FERROR = 0.010
MIN_FERROR = 0.002

INPUT_SCALE = 81920

OUTPUT_SCALE = -1.000
OUTPUT_OFFSET = 0.0
MAX_OUTPUT = 1.0

MIN_LIMIT = -3.0
MAX_LIMIT = 3.0
HOME = 0.0
HOME_OFFSET = -2.9
HOME_SEARCH_VEL = -0.50
HOME_LATCH_VEL = 0.10
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES

# PID tuning params
DEADBAND = 0.000015
P = 100.0
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 1.000
FF2 = 0.0
BIAS = 0.000


and this to the .hal

# ################
# W [3] Axis
# ################

# axis enable chain
newsig emcmot.03.enable bit
sets emcmot.03.enable FALSE
net emcmot.03.enable => pid.3.enable
net emcmot.03.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.03.enable
net emcmot.03.enable <= axis.3.amp-enable-out

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.03.index-mask-invert 0

setp hm2_[HOSTMOT2](BOARD).0.encoder.03.scale [AXIS_3]INPUT_SCALE
net motor.03.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.03.position => pid.3.feedback
net motor.03.pos-fb => axis.3.motor-pos-fb #push copy back to Axis GUI

# set PID loop gains from inifile
setp pid.3.Pgain [AXIS_3]P
setp pid.3.Igain [AXIS_3]I
setp pid.3.Dgain [AXIS_3]D
setp pid.3.bias [AXIS_3]BIAS
setp pid.3.FF0 [AXIS_3]FF0
setp pid.3.FF1 [AXIS_3]FF1
setp pid.3.FF2 [AXIS_3]FF2
setp pid.3.deadband [AXIS_3]DEADBAND
setp pid.3.maxoutput [AXIS_3]MAX_OUTPUT

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.03.output-type 1 #pwm on pin1, dir on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.03.scale [AXIS_3]OUTPUT_SCALE


i assume the pwmgen is for servos, not sure if its necessary to add, but like i said, i copied the others and changed what i figured needed to be changed.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 18:09 #8075 by PCW
Replied by PCW on topic Re:Encoder wiring - Mesa 7i33
Does the CONFIG line from the 5i20.ini file that specifies the numbers of modules look like this?
CONFIG="firmware=SVST8_4.BIT num_encoders=4 num_pwmgens=4 num_stepgens=0"

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 18:54 #8076 by Fordperf393W
yes.
also, the readout is way off from actual distance traveled.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 19:17 #8077 by PCW
Replied by PCW on topic Re:Encoder wiring - Mesa 7i33
OK so If I do nothing more than change the one line in the ini file to specify 4 PWMGENS:
num_pwmgens=4 they show up for me in halmeter, in emc 2.4.3, 2.4.6 and 2.5

Are you sure you are editing the correct.ini file?

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 20:50 #8083 by Fordperf393W
the axis shows up for me in halmeter. i just cannot get it to display the readout of that axis. is it even possible? in the tkemc gui i was able to get it to display "-" not a letter, as the 4th axis, but there was no link between it and the encoder.

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 21:20 #8084 by andypugh
Fordperf393W wrote:

the axis shows up for me in halmeter. i just cannot get it to display the readout of that axis. is it even possible?


Yes, EMC2 supports up to 9 axes.

You don't seem to have the link from the motion controller to the PID input.
net somethingorother axis.3.motor-pos-cmd => pid.3.command

You also need to set up the INI file for 4 axes (and, if you really want it to be a W axis, you need 9 axes, W is last in the list)
[TRAJ]
AXES = 9
COORDINATES = XYZW

linuxcnc.org/docs/html/config_emc2hal.html
linuxcnc.org/docs/html/man/man9/pid.9.html
linuxcnc.org/docs/html/config_ini_config...b:%5BTRAJ%5D-section

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 21:24 #8085 by Fordperf393W
doesnt have to be W, i arbitrarily picked that letter. what is next in the list?

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 21:33 #8087 by andypugh
A is next. (As the docs I linked make fairly clear)

Please Log in or Create an account to join the conversation.

More
25 Mar 2011 22:36 #8091 by Fordperf393W
sorry about that. i think i have a grasp on it now.

is it possible to zero out an axis at its current position?

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.143 seconds
Powered by Kunena Forum