- Posts: 295
- Thank you received: 125
Ethercat HAL driver
- chimeno
- Offline
- Elite Member
-
Less
More
6 years 5 months ago - 6 years 5 months ago #168902
by chimeno
Replied by chimeno on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
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
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
- sqmathlete
- Offline
- Premium Member
-
Less
More
- Posts: 118
- Thank you received: 18
6 years 5 months ago #168971
by sqmathlete
Replied by sqmathlete on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
@ 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
Dan
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
- chimeno
- Offline
- Elite Member
-
Less
More
- Posts: 295
- Thank you received: 125
6 years 5 months ago - 6 years 5 months ago #168994
by chimeno
Replied by chimeno on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Hi @sqmathlete
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
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.
Code:
LCEC_DEASDA_PDOS 6
Reguard
Chimeno
Last edit: 6 years 5 months ago by chimeno.
The following user(s) said Thank You: sqmathlete
- chimeno
- Offline
- Elite Member
-
Less
More
- Posts: 295
- Thank you received: 125
6 years 5 months ago - 6 years 5 months ago #169002
by chimeno
Replied by chimeno on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
Last edit: 6 years 5 months ago by chimeno. Reason: Edit .xml
The following user(s) said Thank You: CORBETT
- theshade
- Offline
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 5
6 years 5 months ago - 6 years 5 months ago #169035
by theshade
Replied by theshade on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
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:
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...
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
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
Thank you again for your support
Last edit: 6 years 5 months ago by theshade.
- chimeno
- Offline
- Elite Member
-
Less
More
- Posts: 295
- Thank you received: 125
6 years 5 months ago - 6 years 5 months ago #169148
by chimeno
Replied by chimeno on topic Ethercat HAL generic on raspberry 4 rt (working with beckhoff)
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
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?
Now we connect the signals ...
I hope it is a good start ...
Reguard
Chimeno
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
Last edit: 6 years 5 months ago by chimeno. Reason: Edit
Time to create page: 2.083 seconds