LinuxCNC+EtherCAT+Servo
- myz
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
05 Nov 2018 13:32 #119990
by myz
LinuxCNC+EtherCAT+Servo was created by myz
I want to build a Linuxcnc + EtherCAT + Servo demo environment, I used a master card, it provides some APIs, can send and receive ethercat datagrams. The slave is a servo driver that drives the servo motor. My initial thought was: call the datagram api of the master card in base-thread or servo-thread, read the motor-pos-cmd and pass it to the slave, and at the same time, the master reads the position feedback of the slave. Passed to motor-pos-fb, however, I have some questions:
1. Is the idea above me correct?
2. How do I configure the .hal file and the .ini file?
3. What components are needed? For example, the components in the servo_sim.hal file, in addition to the analog components, do you need the rest?
1. Is the idea above me correct?
2. How do I configure the .hal file and the .ini file?
3. What components are needed? For example, the components in the servo_sim.hal file, in addition to the analog components, do you need the rest?
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4865
05 Nov 2018 15:43 #119997
by andypugh
Replied by andypugh on topic LinuxCNC+EtherCAT+Servo
I don't know if you have found it, but there is a big EtherCAT thread here:
forum.linuxcnc.org/24-hal-components/22346-ethercat-hal-driver
forum.linuxcnc.org/24-hal-components/22346-ethercat-hal-driver
Please Log in or Create an account to join the conversation.
- myz
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
07 Nov 2018 07:42 #120154
by myz
Replied by myz on topic LinuxCNC+EtherCAT+Servo
but that is a software master,my card is a hard master
Please Log in or Create an account to join the conversation.
- myz
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
07 Nov 2018 10:47 #120161
by myz
Replied by myz on topic LinuxCNC+EtherCAT+Servo
but that is a software master,my card is a hardware master,Can they be used together
Please Log in or Create an account to join the conversation.
- myz
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
07 Nov 2018 14:07 #120167
by myz
Replied by myz on topic LinuxCNC+EtherCAT+Servo
but that is a software master,my card is a hardware master,Can they be used together
Please Log in or Create an account to join the conversation.
- cmorley
- Offline
- Moderator
Less
More
- Posts: 7780
- Thank you received: 2075
07 Nov 2018 23:53 #120225
by cmorley
Replied by cmorley on topic LinuxCNC+EtherCAT+Servo
so you need to make a device driver for HAL.
A HAL driver needs a function to read the card and a function to write to the card and a way to decide what HAL pins to make.
Usually this is a command line way of configuration on initial loading, but there are other ways.
That in very general terms is what is required.
Chris M
A HAL driver needs a function to read the card and a function to write to the card and a way to decide what HAL pins to make.
Usually this is a command line way of configuration on initial loading, but there are other ways.
That in very general terms is what is required.
Chris M
The following user(s) said Thank You: myz
Please Log in or Create an account to join the conversation.
- myz
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
08 Nov 2018 09:23 #120242
by myz
Replied by myz on topic LinuxCNC+EtherCAT+Servo
I know what you mean. However, the API that receives the ethercat packet and sends the ethercat packet is in user space, so I can only create a user space component, define the pins in the component, and in the.hal file, use the 'net' command to connect the pins I defined to the system pins (for example,net target_pos <= axis.0.mortor-pos-cmd net slave_fb => axis.0.mortor-pos-fb) Then, I loop through the API to send target_pos to the slave station, then call the API to receive feedback, and assign the value to slave_fb. Is this solution feasible? I feel like there's no real time like this, but I can't find examples to refer to.Is there another way?
Please Log in or Create an account to join the conversation.
Time to create page: 0.060 seconds