Ethercat HAL driver

More
5 years 8 months ago #198252 by bkt
Replied by bkt on topic Ethercat HAL driver
You are in right .... my error I post the old xml in position mode .... I correct immediately.

regards
bkt

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

More
5 years 8 months ago - 5 years 8 months ago #198295 by bkt
Replied by bkt on topic Ethercat HAL driver
After many and many attempts, I put back the synchro position mode. I'm carrying a piece of xml. I have a mechanical reduction of 37.5 my drive has a resolution of 131672 puls / rev (17bit) and with this hal and ini configuration I get the required movement of + and - 90 ° on my joint .... what is it that I don't have I got it? In fact, the scale factor on the xml file was reached by attempts without any apparent logic .... the method escapes me even if I have reached the goal.

My xml file:
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> <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"/> </pdo> </syncManager> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-250000" sync1Cycle="0" sync1Shift="0"/> <watchdog divider="2050" intervals="1000"/> </slave> <slave idx="1" 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> <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"/> </pdo> </syncManager> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-250000" sync1Cycle="0" sync1Shift="0"/> <watchdog divider="2050" intervals="1000"/> </slave> <slave idx="2" 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> <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"/> </pdo> </syncManager> <dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="-250000" sync1Cycle="0" sync1Shift="0"/> <watchdog divider="2050" intervals="1000"/> </slave> <slave idx="3" type="EK1100" name="Busklemme"/> <slave idx="4" type="EL1008"/> <slave idx="5" type="EL2008"/> </master> </masters>


My pieces of .hal file:
Code:
loadusr -W lcec_conf /home/my/linuxcnc/configs/et-3ax/cia402v1.xml loadrt lcec loadrt [KINS]KINEMATICS setp rotarydeltakins.platformradius 190.00 setp rotarydeltakins.thighlength 340.0 setp rotarydeltakins.shinlength 800.0 setp rotarydeltakins.footradius 74. #autoconverted trivkins loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS loadrt conv_u32_float names=cu32f.0,cu32f.1,cu32f.2 loadrt toggle count=1 addf lcec.read-all servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf lcec.write-all servo-thread addf cu32f.0 servo-thread addf cu32f.1 servo-thread addf cu32f.2 servo-thread addf toggle.0 servo-thread net ec-slaves-responding <= lcec.slaves-responding net ec-link-up <= lcec.link-up net ec-all-op <= lcec.all-op net ec_up lcec.state-op => iocontrol.0.emc-enable-in lcec.0.0.driverControl-0 lcec.0.1.driverControl-0 lcec.0.2.driverControl-0 setp lcec.0.0.driverControl-1 1 setp lcec.0.0.driverControl-2 1 setp lcec.0.1.driverControl-1 1 setp lcec.0.1.driverControl-2 1 setp lcec.0.2.driverControl-1 1 setp lcec.0.2.driverControl-2 1 #net faultReset-All lcec.0.0.driverControl-7 <= esternalCmd => lcec.0.0.driverControl-7 lcec.0.1.driverControl-7 lcec.0.2.driverControl-7 #net faultSignal-0 lcec.0.0.driverStatus-3 => esternalSignal-0 #net faultSignal-1 lcec.0.1.driverStatus-3 => esternalSignal-1 #net faultSignal-2 lcec.0.2.driverStatus-3 => esternalSignal-2 #net faultSignal-3 lcec.0.3.driverStatus-3 => esternalSignal-3 net Xaxe_on joint.0.amp-enable-out => lcec.0.0.driverControl-3 net Yaxe_on joint.1.amp-enable-out => lcec.0.1.driverControl-3 net Zaxe_on joint.2.amp-enable-out => lcec.0.2.driverControl-3 net Xaxe_fb joint.0.motor-pos-fb <= lcec.0.0.posActual net Xaxe_cmd joint.0.motor-pos-cmd => lcec.0.0.posCommand net Yaxe_fb joint.1.motor-pos-fb <= lcec.0.1.posActual net Yaxe_cmd joint.1.motor-pos-cmd => lcec.0.1.posCommand net Zaxe_fb joint.2.motor-pos-fb <= lcec.0.2.posActual net Zaxe_cmd joint.2.motor-pos-cmd => lcec.0.2.posCommand

My piece of ini file for X axes for example (other is the same):
Code:
[AXIS_X] MIN_LIMIT = -45000 MAX_LIMIT = 45000 MAX_VELOCITY = 7000.0 MAX_ACCELERATION = 2000.0 [JOINT_0] TYPE = ANGULAR #TYPE = LINEAR MAX_VELOCITY = 3600.0 MAX_ACCELERATION = 650.0 STEPGEN_MAXACCEL = 0 SCALE = 1 FERROR = 2 MIN_FERROR = 20 MIN_LIMIT = -90 MAX_LIMIT = 90 #HOME_ABSOLUTE_ENCODER = 2 HOME = 0 HOME_OFFSET = 0 HOME_SEQUENCE = 0 HOME_SEARCH_VEL = 0 #HOME_USE_INDEX = 1 HOME_LATCH_VEL = 0 HOME_IGNORE_LIMITS = yes

Drive is Maxine EP3 in attach some interesting manual page ... for sure value of position is in Dint .... not sure these infuences the system ... I assumed that the conversion to float is automatic.
Attachments:
Last edit: 5 years 8 months ago by bkt.
The following user(s) said Thank You: besriworld

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

More
5 years 8 months ago #198311 by db1981
Replied by db1981 on topic Ethercat HAL driver
sorry, i did not understand what you want to do..

-You want to control the drive in velocity mode?
-You have problem with the pos feedbackvalue? Feedback from the drive is an signed Integer, automatic conversion is not automatic done, every 16 bits, there will be an huge step in the value. I think the feedback is an raw value, so you need something like an counter/encoder logic.

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

More
5 years 8 months ago #198321 by arvidb
Replied by arvidb on topic Ethercat HAL driver
bkt: I'm not sure if this actually matters, but one thing that looks strange in your xml file is that you're mixing radix characters between the scale parameters: sometimes you use '.' (period) and sometimes ',' (comma).

Which one to use is supposedly controlled by the LC_NUMERIC setting on the system (run 'locale' to check your setting). However I have mine set to sv_SE.UTF-8 (Swedish), and the Swedish standard is to use a comma as radix, but I still use a period in my .hal config files, for example, so... yeah, I don't know if it matters.

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

More
5 years 8 months ago #198322 by arvidb
Replied by arvidb on topic Ethercat HAL driver
I tested it and it does matter: lcec_conf uses atof to convert the scale value to float. On my system atof("1.234") returns 1.234 as expected, but atof("1,234") returns 1.000. So your scale="0,00008" results in a scale of exactly zero. Not good!

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

More
5 years 8 months ago - 5 years 8 months ago #198397 by bkt
Replied by bkt on topic Ethercat HAL driver

@DB1981
-You want to control the drive in velocity mode?
-You have problem with the pos feedbackvalue? Feedback from the drive is an signed Integer, automatic conversion is not automatic done, every 16 bits, there will be an huge step in the value. I think the feedback is an raw value, so you need something like an counter/encoder logic.


Velocity mode no for sure ... Because RXPDO 1601 and TxPDO1A01 ... plus feedback (6064h) is DINT value as 607Ah (cmdPosition) that is DINT. <sdoConfig idx="6060" subIdx="0"><sdoDataRaw data="08"/></sdoConfig> for you these is CSV and not CSP ??? but CSP in maxine manual is bit=7 so 08 is correct value i think (0-1-2 ....7 means i count 8 number) ... is not right these?

@arvidb

bkt: I'm not sure if this actually matters, but one thing that looks strange in your xml file is that you're mixing radix characters between the scale parameters: sometimes you use '.' (period) and sometimes ',' (comma).


if you read better ',' (comma) for sign decimal point is comment out .... but actually reading the topic you don't notice that these lines are commented out .... however do not worry I have already noticed that it was a problem .... in fact the xml file and Lcnc accept the '.' (point) and not the ',' to mark the decimals .... so my mistake .... I correct the xml file by removing all the commented lines so that no one is misled by reading at speed ... NO WORRY there are no scale="0,00008" read from system because <!-- xxxxx --> on xml sintax is equal to /* code c or c++ */ the correct scale is scale="0.000071429"/>

any how thanks for reply and correct my previous so no one make same error of arvidb ... f
bkt
Attachments:
Last edit: 5 years 8 months ago by bkt.

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

Time to create page: 3.710 seconds
Powered by Kunena Forum