Ethercat HAL driver

More
6 years 5 months ago - 6 years 5 months ago #168902 by chimeno
Hi @sqmathlete

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
Last edit: 6 years 5 months ago by chimeno. Reason: Edit
More
6 years 5 months ago #168971 by sqmathlete
@ chimeno

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
Code:
<pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actpos" halType="float" scale="1.192092896e-6"/>

Dan
More
6 years 5 months ago - 6 years 5 months ago #168994 by chimeno
Hi @sqmathlete

Ademá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" />

The value I did not look for it, is from a previous publication by @theshade

Sorry, I was unclear. I meant in the source file lcec_deasda.c.

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 #define
Code:
LCEC_DEASDA_PDOS 6
I don't know if this is what you need ?? If you have the device's .xml description file, I can see it in TWINCAT3 that PDO you need

Reguard
Chimeno
Attachments:
Last edit: 6 years 5 months ago by chimeno.
The following user(s) said Thank You: sqmathlete
More
6 years 5 months ago - 6 years 5 months ago #169002 by chimeno
Hi all guys, I have attached a new EM3712 controller, for you gamers !!


Reguard
Chimeno
Last edit: 6 years 5 months ago by chimeno. Reason: Edit .xml
The following user(s) said Thank You: CORBETT
More
6 years 5 months ago - 6 years 5 months ago #169035 by theshade
Hello @ chimeno,

I made some progress yesterday. When I start linuxcnc my device goes into OP and now if I write this in a terminal.
The motor gets current and I can't turn it by hand anymore:
Code:
ethercat -p0 -t uint16 download 0x6040 0 0x0006 # EnableVoltage+QuickStop ethercat -p0 -t uint16 download 0x6040 0 0x0007 # +SwitchOn ethercat -p0 -t uint16 download 0x6040 0 0x000f # +EnableOperation

But how and where should I have this in linuxcnc?
[update] I think there are plenty of examples in here: github.com/aschiffler/linuxcnc/tree/master/configs/roschi_cnc
I will try to adapt sth from this in the hal file...
Code:
setp lcec.0.3.drivecontrol-8 1 setp lcec.0.3.drivecontrol-13 1 setp lcec.0.3.drivecontrol-14 1 setp lcec.0.3.signalcontrol-0 0 setp lcec.0.4.drivecontrol-8 1 setp lcec.0.4.drivecontrol-13 1 setp lcec.0.4.drivecontrol-14 1 setp lcec.0.4.signalcontrol-0 0 setp lcec.0.5.drivecontrol-8 1 setp lcec.0.5.drivecontrol-13 1 setp lcec.0.5.drivecontrol-14 1 setp lcec.0.5.signalcontrol-0 0
Also I think my "scaling" is currently wrong, I think the encoders are 1000 steps per rev while the stepper is actually 200 steps per rev.. and I will attach some SFU1605 screws to them.

Thank you again for your support
Last edit: 6 years 5 months ago by theshade.
More
6 years 5 months ago - 6 years 5 months ago #169148 by chimeno
Hi @theshade
I do not use this type of generic file, it costs me a bit, and without having the device it is also a little more difficult
I attach a new .xml file with some changes

a your .hal file
Code:
setp lcec.0.X-cmd-SwitchOn 1 setp lcec.0.X-cmd-EnableVoltage 1 setp lcec.0.X-cmd-/QuickStop 1 setp lcec.0.X-cmd-EnableOperation 1

Now the driver is ready to work ...

the scale is surely wrong if not calculated, but to start leave at 1 and then check the measurement
Could this be the scale?
Code:
<pdoEntry idx="607A" subIdx="00" bitLen="32" halPin="poscmd" halType="float" scale="40.0"/> <pdoEntry idx="6064" subIdx="00" bitLen="32" halPin="actpos" halType="float" scale="200.0"/>

Now we connect the signals ...
Code:
lcec.0.poscmd -> joint.0.motor-pos-cmd lcec.0.actpos <- joint.0.motor-pos-fb

I hope it is a good start ...

Reguard
Chimeno
Attachments:
Last edit: 6 years 5 months ago by chimeno. Reason: Edit
Time to create page: 2.083 seconds
Powered by Kunena Forum