HAL CiA402 Drive Interface for Can Bus,Ethercat etc...

More
1 year 4 months ago #329770 by Grotius
Hi,

The request:
A few weeks ago i recieved a ethercat servo drive from a forum sponsor. A Delta-asda-b3 drive and motor set.
The sponsor had a request for me. Figur out homing the drive using it with linuxcnc.

The difficulty:
Now the drive has internal home programs. And there comes the problem. How to deal with this using homemod.so?
Where homemod.so is the component responsible for linuxcnc home sequence.

The desired home sequence:
1. Home with search_vel to hard end stop of machine using a lower motor torque and stop on torque home limit value.
2. Move back from hard stop to find the first motor index z pulse, using the servo drive's internal home program.

The motivation to get it work:
1. Using the servo drives internal search for index z pulse program is the most accurate way to home a machine as it is not
depending on a servo cycle, where the servo cycle is not contributing to a ultra high precision.
In theory the index pulse may in between 2 servo cycles. This is what i mean with no ultra high precision.

My workflow:
1. To use the servo drive with ethercat i had to install lcec and cia402.
After installation and editing the ethercat .xml file,  i was able to run  the servo set.

2. The original cia402.so component was written in halcompile language.
The idea was to convert the halcompile component code into a c coded component.
This resulted in a base component, code can be found here.

3. After coding a few day's i was gradually understanding how the servo's work and i could expand the codebase
to include torque control. And i was able to run servo drive internal homing programs.
This resulted in a new component : libcia402

4. After up's and down's and trying different workflows i was able to edit the homemod.so component,
that is used by linuxcnc to do the home sequence.
The new component works exactly as the homemod.so, but it has additional features to enable external homing.
This resulted in a new component:  libhomecia402

Note: The motivation to keep the homemod.so original is that users can now combine external homing on servo's
with steppers and homing works as normal.

Conclusion:
The extern homing on index works as expected.

Variations:
As we use the .ini file to set home configuration. In .hal we can set servo drive home program and more values.
Therefore i did not test other external home variations so far. But we can think of multiple home sequence variations.

Installation on rip systems:
Readme. Section installation.
The following user(s) said Thank You: tommylight, pommen, besriworld, COFHAL, hmnijp

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

More
1 year 4 months ago #329936 by Grotius
Hi all.

In the previous post i designed a c coded cia402 component to use with external homing, running on a general ethercat .xml config.

In this post i can announce that i included a new driver into the lcec source code.
The delta-asda-b3 is now included. And it can use external homing using homemod_extern.so
The homemod_extern is specified in the .ini file : link

Now the hal file, looks quite simple :
hal example
And also the ethercat .xml file look simple :
ethercat-conf example

Source:  
linuxcnc-etthercat
homemod_extern

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

More
1 year 4 months ago #329942 by Hakan
Sounds great!
What are your plans with this?
Keep it separate in your code or bring it into mainstream linuxcnc code?
The following user(s) said Thank You: Grotius

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

More
1 year 4 months ago #329947 by Grotius
Others may bring it in the main stream.
I am against one off the github policys.
Therefore i stay at Codeberg wich dont use the policy i hate.

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

More
1 year 4 months ago #330967 by Marko6
Hi everyone.

Does anyone have CSV mode working? I'm running CSP on XYZ without any problems, but CSV on the spindle is just running the drive (Delta C2000 + Ethercat + Encoder) and I can't send the speed/direction signal.

I've spent two days trying to get it running, but to no avail. Also, there is no sample hal/ini file that explains CSV and the spindle.

Thank you. BR,
Pavel

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

More
1 year 3 months ago #331481 by Marko6
Hi everyone. I have made some progress on 3x Lichuan + 1x Delta C2000. Now I am able to measure the speed when the drive is turned on manually. But still no success with the speed command.

I found that the speed command in HAL CiA402 is 60FF and here in Delta it is 6042. I have tried both, but when I set only 6042 in the XML file, I am not even able to turn on the drive.

Any idea? Thank you. 

 

File Attachment:

File Name: ethercat-conf.xml
File Size:8.75 KB
 

File Attachment:

File Name: cia402.hal
File Size:5.25 KB
 

File Attachment:

File Name: cia402.ini
File Size:4.56 KB

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

Time to create page: 0.423 seconds
Powered by Kunena Forum