I have a big problem, I can't configure my axis, I can make it move smoothly but I can't drive it in velocity mode .... not because there isn't something wrong, but I think it just comes from a lot of confusion that I'm doing ... I use the generic drive speed profile and I can't figure out which parameters compared to the classic mesa 7i77 configuration I have to insert .... I insert an excerpt of my xml to understand the nomenclature .... and an excerpt from the file. hal ....
/* xml */
Code:
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1">
<slave idx="0" type="generic" vid="000007DD" pid="01" configPdos="true">
<sdoConfig idx="6060" subIdx="0"><sdoDataRaw data="08"/></sdoConfig>
<sdoConfig idx="60C2" subIdx="1"><sdoDataRaw data="01"/></sdoConfig>
<sdoConfig idx="60C2" subIdx="2"><sdoDataRaw data="FD"/></sdoConfig>
<sdoConfig idx="607E" subIdx="0"><sdoDataRaw data="00"/></sdoConfig>
<!-- <sdoConfig idx="607E" subIdx="1"><sdoDataRaw data="E0"/></sdoConfig>
<sdoConfig idx="6091" subIdx="1"><sdoDataRaw data="0375"/></sdoConfig> /* gear ratio param ... but not work ... so I leave it*/
<sdoConfig idx="6091" subIdx="2"><sdoDataRaw data="0010"/></sdoConfig>
<sdoConfig idx="6092" subIdx="1"><sdoDataRaw data="0360"/></sdoConfig>
<sdoConfig idx="6092" subIdx="2"><sdoDataRaw data="0168"/></sdoConfig> /* questo non và settato*/ -->
<syncManager idx="0" dir="out"></syncManager>
<syncManager idx="1" dir="in"></syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1601">
<pdoEntry idx="6040" subIdx="00" bitLen="16" halPin="driverControl" halType="bit"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="posCommand" halType="float" scale="14000"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1A01">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="driverStatus" halType="bit"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="posActual" halType="float" scale="0.000071429"/>
<pdoEntry idx="6077" subIdx="00" bitLen="16" halPin="torActual" halType="float"/>
<pdoEntry idx="606C" subIdx="00" bitLen="32" halPin="velActual" halType="float"/>
<pdoEntry idx="603F" subIdx="00" bitLen="16" halPin="errorStat" halType="float"/>
</pdo>
</syncManager>
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-250000" sync1Cycle="0" sync1Shift="0"/>
<watchdog divider="2050" intervals="1000"/>
</slave>
/* .hal*/
Code:
#*******************
# AXIS X
#*******************
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
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-pos-cmd => pid.x.command
net x-vel-cmd => pid.x.command-deriv
net x-pos-fb => pid.x.feedback
net x-output => pid.x.output
# these part is ok no need help#
# ---PWM Generator signals/setup--- IN ETHERCAT there is no analog signal generator so I think it can be removed
#setp hm2_5i25.0.7i77.0.1.analogout0-scalemax [JOINT_0]OUTPUT_SCALE
#setp hm2_5i25.0.7i77.0.1.analogout0-minlim [JOINT_0]OUTPUT_MIN_LIMIT
#setp hm2_5i25.0.7i77.0.1.analogout0-maxlim [JOINT_0]OUTPUT_MAX_LIMIT
# enable _all_ sserial pwmgens
# net x-enable hm2_5i25.0.7i77.0.1.analogena
# these signals give me problems .... I have to convert them as it is written in the .hal file that I carry later?
net x-output => hm2_5i25.0.7i77.0.1.analogout0 # and these signal ??
net x-pos-cmd joint.0.motor-pos-cmd => #??
net x-enable joint.0.amp-enable-out => lcec.0.0.driverControl-3
# ---Encoder feedback signals/setup--- I'm unable to scale encoder raw signal
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 [JOINT_0]ENCODER_SCALE
net x-pos-fb <= lcec.0.0.posActual #these id right or not?
net x-vel-fb <= lcec.0.0.velActual #these id right or not?
net x-pos-fb => joint.0.motor-pos-fb <= lcec.0.0.posActual #these id right or not?
#actualPos is raw and scaled on xml ... so no need I think. Is right?
#net x-index-enable joint.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
#net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts
Finally these is a sample find on these infinite post .... there are converted signal ... but if use "scale" into xml file is necessary converter "posActual" signal from/to u32 for perform [JOINT_0]SCALE signal?
/* converted signal sample from these long post */
Code:
Translate X Position Feedback
net RawPositionFeedback0 lcec.0.0.Axis1RxPositionFeedback => x_scale_fb.in
setp x_scale_fb.gain [JOINT_0]PSCALE_INV #invert of below
setp x_scale_fb.offset 0
net xpos-fb joint.0.motor-pos-fb <= x_scale_fb.out
# Translate X Position Command
net xpos-cmd joint.0.motor-pos-cmd => x_scale_cmd.in
setp x_scale_cmd.gain [JOINT_0]PSCALE #invert of above
setp x_scale_cmd.offset 0
net PosCmdX-Scaled x_pos_cmd_u32.in <= x_scale_cmd.out
net PosCmdX-IntOut x_pos_cmd_u32.out => lcec.0.0.Axis1TxPositionCommand
but if use "scale" into xml file is necessary converter "posActual" signal from/to u32 for perform [JOINT_0]SCALE signal?
I have not found configuration files that could help me to realize the "SCALE" of the encoder signal .... I don't understand how to get there .... is it just a problem of numeric conversions?
Thanks in advances for any help.
bkt