Ethercat HAL driver
Regarding DC mode, the manual does not detail its optimal configuration, an option would be to delete the line and it will be in free mode, it can work without DC mode but it will not be synchronized with the thread, it may not be important.
<dcConf assignActivate="1000" sync0Cycle="*1" sync0Shift="0"/>
approximate description
dcConf assignActivate="1000"
sync0Cycle="*1"
sync0Shift="0"/>
the settings on the device are here
As for connecting the signals it depends on how you have it, if you have it in speed mode then you have to create a PID
the important signs are:
motor encoder -> joint.0.motor-pos-fb
engine velo-cmd -> x-pid.command
engine start -> x-pid.enable
reguard
Chimeno
Attachments:
Please Log in or Create an account to join the conversation.
ALBERT
DUDE YOU ARE THE MAN…. SUCCESS, SUCCESS, SUCCESS!!! You put me on the right track to figure out my problem and I have it working in my test system now.
Ok, after you had stated that everything looked fine in TC3, I went back and was looking at the “online” for the EL5151 and still getting a flat line while turning the encoder shaft. I have always had the encoder hooked up as I could see the LED’s up at the top of the terminal flash for the A & B channel.
So, I decided to do the check as you described with the C input to 24V+ and low and behold the line moved while looking at it in the “Online” mode. As soon as I saw this, I decided to pull the encoder wires and simply put a wire in each A & B channel, with these I quickly back and forth touched 24+ and sure enough the counts were adding up. I was confused as I was getting the full flashes on the A & B input at the encoder channel, but never seeing anything change in the counts in either LCNC or TC3.
THE ANSWER TO THE PROBLEM.
Ok, so I was getting pulses from the encoder, but my problem was that I had a “weak pull-up resistor” I had just enough coming through to fire the LED’s, therefore fooling me with thinking the terminal was “seeing” the encoder. I had used the same encoder setup that I have previously used on other setups with DB25 Parallel port connector, plus even with this machine to get it working even though it was slow because of the parallel port and encoder software with LCNC. I had a 9.6K resistor in there and it was getting about 8 volts or so at peak. I went and pulled the Beckhoff EL515x PDF and checked the logic voltage for the terminal and it was “0“: < 5 V DC, “1“: > 15 V DC, so therefore I was getting the LED’s to flash rapidly but the logic circuit never saw at least 15v as it was basically “floating” and ghosting me with the LED’s. I kept tweaking until 4.6K got everything working. I had gotten down to 2.4K, but backed off as did not want to get the circuit hot during long term usage.
What a long road for such a simple thing, but glad all my terminals are good and it was a cheap fix, I have plenty of resistors laying around. I should have caught this way back, but I did not put 2 and 2 together until figuring it out in TC3 with watching it in the Online Tab. It is basically the same in LCNC with Halscope, but I was not getting it figured out. I will say it has made me much better overall as I studied so many parts of LCNC & TwinCAT to figure this all out.
ONCE AGAIN, SUPER THANKS FOR PUTTING ME ON THE RIGHT PATH. Now I am going to finish this machine up and get ready for the next one.
Thanks,
Robert
Attachments:
Please Log in or Create an account to join the conversation.
Thank you again so much for your reply... I think I understand that the default settings I can read when I plug the device in twincat and go online... I can see this:
which from what I understand means DC sync with a 2ms cycle. Is that helpfull?
Also I think I have to send three register values to turn on cyclic and enable motor as specified here for CSP:
But I don't yet know how:
Finally I saw that it was possible to define bit haltype for the control-word and status-word using complex hal-type...
but I don't understand why in the example (linuxcnc-ethercat/examples/generic-complex/CPD17/ethercat-conf_X.xml) there is a different subindex (1 and 2).
I have put :
<pdoEntry idx="6040" subIdx="0" bitLen="16" halPin="control-word" halType="u32"/>
<pdoEntry idx="6040" subIdx="01" bitLen="48" halType="complex">
but I am not sure it is correct from the documentation.
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<!-- ECT60 slave -->
<slave idx="0" type="generic" vid="00000A88" pid="0a880002" configPdos="true">
<!--<initCmds filename="ECT60.xml"/>-->
<syncManager idx="0" dir="out">
</syncManager>
<syncManager idx="1" dir="in">
</syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="0" bitLen="16" halPin="control-word" halType="u32"/>
<pdoEntry idx="6040" subIdx="01" bitLen="48" halType="complex">
<complexEntry bitLen="1" halPin="X-cmd-SwitchOn" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-EnableVoltage" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-/QuickStop" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-EnableOperation" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OPmodeRel1" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OPmodeRel2" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OpmodeRel3" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-FaultReset" halType="bit"/>
<complexEntry bitLen="1" halPin="XcTimeOut" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OpmodeRel4" halType="bit"/>
</pdoEntry>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="bit"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="poscmd" halType="float" scale="838860.8"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="16" halPin="status-word" halType="u32"/>
<pdoEntry idx="6041" subIdx="01" bitLen="48" halType="complex">
<complexEntry bitLen="1" halPin="X-stat-ReadyToSwitchOn" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-SwitchOn" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-OperationEnable" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Fault" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-VoltageEnabled" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-QuickStop" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-SwitchOnDisable" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Warning" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Keep" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Remote" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-TargetIsReached" halType="bit"/>
</pdoEntry>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode_fb" halType="bit"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actpos" halType="float" scale="1.192092896e-6"/>
<pdoEntry idx="60FD" subIdx="00" bitLen="32" halPin="digital_inputs" halType="bit"/>
</pdo>
</syncManager>
<dcConf assignActivate="1000" sync0Cycle="*1" sync0Shift="0"/>
</slave>
</master>
</masters>
Attachments:
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
I'm not sure if you are asking on how to run in csp mode but ff you want to run in csp mode, you need to set the mode as an sdo entry in your custom xml file.
Try,
<sdoConfig idx="6060" subIdx="0"><sdoDataRaw data="08"/></sdoConfig>
Then enable the amps as usual.
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
A couple of questions regarding the driver for the Delta ASDA amplifiers. Is there an easy way to add pdo's to the driver. I would like to expose 0x60FD, digital outputs and the mode 0x6060 in addition to the drivers pins.
I was using my own custom xml file running in csp mode 0x08 but everyone else seems to run in csv mode 0x09, and the driver works perfectly once you figure out the scale. I'm not an expert on motion control but I think that the reason is that in csv mode when the command stops the amps stop. In csp mode the amp moves to a positon based on the command.What happens in between I don't know. If someone could clarify this that would be helpful.
Any help, would greatly be aprreciated.
Kind regards,
Dan
Please Log in or Create an account to join the conversation.
If it is usefulwhich from what I understand means DC sync with a 2ms cycle. Is that helpfull?
It is configured in mode 2 Bit 2 = Bit 2 = 1: DC-Mode (SYNC0)
at a speed of 2000000
<dcConf assignActivate="1000" sync0Cycle="20000000" sync0Shift="0"/>
It would be not to repeat the same address, although it does not make sense to duplicate the values, I think it is sweet to delete and leave only one of them, you also have to move the dc-conf at the beginning.
<masters>
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
<!-- ECT60 slave -->
<slave idx="0" type="generic" vid="00000A88" pid="0a880002" configPdos="true">
<!--<initCmds filename="ECT60.xml"/>-->
<dcConf assignActivate="1000" sync0Cycle="20000000" sync0Shift="0"/>
<syncManager idx="0" dir="out">
</syncManager>
<syncManager idx="1" dir="in">
</syncManager>
<syncManager idx="2" dir="out">
<pdo idx="1600">
<pdoEntry idx="6040" subIdx="00" bitLen="10" halType="complex">
<complexEntry bitLen="1" halPin="X-cmd-SwitchOn" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-EnableVoltage" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-/QuickStop" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-EnableOperation" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OPmodeRel1" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OPmodeRel2" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OpmodeRel3" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-FaultReset" halType="bit"/>
<complexEntry bitLen="1" halPin="XcTimeOut" halType="bit"/>
<complexEntry bitLen="1" halPin="X-cmd-OpmodeRel4" halType="bit"/>
</pdoEntry>
<pdoEntry idx="6060" subIdx="00" bitLen="8" halPin="opmode" halType="bit"/>
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="poscmd" halType="float" scale="838860.8"/>
</pdo>
</syncManager>
<syncManager idx="3" dir="in">
<pdo idx="1a00">
<pdoEntry idx="6041" subIdx="00" bitLen="11" halType="complex">
<complexEntry bitLen="1" halPin="X-stat-ReadyToSwitchOn" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-SwitchOn" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-OperationEnable" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Fault" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-VoltageEnabled" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-QuickStop" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-SwitchOnDisable" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Warning" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Keep" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-Remote" halType="bit"/>
<complexEntry bitLen="1" halPin="X-stat-TargetIsReached" halType="bit"/>
</pdoEntry>
<pdoEntry idx="6061" subIdx="00" bitLen="8" halPin="opmode_fb" halType="bit"/>
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actpos" halType="float" scale="1.192092896e-6"/>
<pdoEntry idx="60FD" subIdx="00" bitLen="32" halPin="digital_inputs" halType="bit"/>
</pdo>
</syncManager>
</slave>
</master>
</masters>
the configuration that gives you @sqmathlete if you have to put it before the PDO registration
Another way to do it would be in the .xml file
<?xml version="1.0" encoding="utf-8"?>
<EtherCATMailbox>
<CoE>
<InitCmd>
<Transition>PS</Transition>
<Comment><![CDATA[Modes of Operation]]></Comment>
<Timeout>0</Timeout>
<Ccs>1</Ccs>
<Index>24672</Index>
<SubIndex>0</SubIndex>
<Data>08</Data>
</InitCmd>
</InitCmds>
</CoE>
</EtherCATMailbox>
reguard
Chimeno
Please Log in or Create an account to join the conversation.
You can add all the PDOs that the controller supports, it would be the same way as the default ones.
If you have TWINCAT3 it is easy to test all the supported PDOs
reguard
Chimeno
Please Log in or Create an account to join the conversation.
- sqmathlete
- Offline
- Premium Member
- Posts: 118
- Thank you received: 17
Sorry, I was unclear. I meant in the source file lcec_deasda.c.
Also,can you explain how you determined the scale value for this
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actpos" halType="float" scale="1.192092896e-6"/>
Dan
Please Log in or Create an account to join the conversation.
The value I did not look for it, is from a previous publication by @theshadeAdemás, ¿puede explicar cómo determinó el valor de escala para este
<pdoEntry idx = "6064" subIdx = "00" bitLen = "32" halPin = "actpos" halType = "float" scale = "1.192092896e-6" />
PDOs are defined in lines 194-199, you also have to modify lines 122-148 and put the number of maximum PDOs in the .h file #defineSorry, I was unclear. I meant in the source file lcec_deasda.c.
LCEC_DEASDA_PDOS 6
Reguard
Chimeno
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.