ASD-A2 EtherCAT on LinuxCNC

More
5 years 1 month ago #219789 by jirkam
Replied by jirkam on topic ASD-A2 EtherCAT on LinuxCNC
Hello.
So I'm back.
It lasted without a mistake for a few weeks. I managed to record the behavior on video.
Here is the video
1.red - joint.0.f-error ("X" axis)
2.blue - joint.1.f-error ("Y" axis)
3.green - joint.2.f-error ("Y" axis)
4.purple - joint.3.f-error ("Z" axis)
5.orange - lcec.0.pll-out
6.green - lcec.0.pll-err (it is marked on the video - therefore it is white)

Sometimes he doesn't do it all week.
Sometimes he does it twice a day.
Sometimes he does it all day.
Sometimes it stops making mistakes on its own.
Sometimes I have to restart Linuxcnc to stop making mistakes.

Does anyone know where the problem might be?

Thank you very much Jirka

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

More
3 years 10 months ago #258559 by mehdidadash
Hi jirkam
Can you attach your final configuration files like XML, INI, HAL,... ?

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

More
3 years 10 months ago #258589 by jirkam
Replied by jirkam on topic ASD-A2 EtherCAT on LinuxCNC
Hi
I found out that if I turn on the drivers first and only the PC after about 10 seconds, then it doesn't make the error.
Thank you.
Jirka
The following user(s) said Thank You: mehdidadash

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

More
3 years 10 months ago #258592 by db1981
Replied by db1981 on topic ASD-A2 EtherCAT on LinuxCNC
Hello Jirka,

i have noticed an "~big" error in your hal file.

you adding lcec.real-all and write-all at the beginning of the hal file.

caused that liunxcnc builds its execution order of task functions in the order they are placed in the hal file, your servo-thread calls ec-read and then immediatly writes out lcec-write. So nothing is done with the Data in the meantime. Lcec.write-all uses "old"data from the last cycle . Which causes timing issues and leads to an bad servo tuning.

the right order would be:

addf lcec.read-all (gets data from hardware)
addf motion, value-converts, pids, classicladder etc.. (works with the data)

last addf lcec.write-all (send new data to hardware).


In your case lcec.write-all is called in front of motion and pids. So it sends "old" data from the last cylce to the drives without the new calculations. You got an 1
cycle offset between input and output data.

(you can search for "execution order" in the forum, i have descripted this in detail somewhere)

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

More
3 years 10 months ago #258627 by jirkam
Replied by jirkam on topic ASD-A2 EtherCAT on LinuxCNC
Hello "db1981"
Thank you very much for the tip.

When I write it like this:
Code:
# Generated by stepconf 1.1 at Thu Sep 10 02:41:11 2020 # If you make changes to this file, they will be # overwritten when you run stepconf again loadrt [KINS]KINEMATICS loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_dio=24 num_aio=8 loadrt pwmgen output_type=1 loadusr ethercat debug 1 loadusr -W lcec_conf delta_pos.xml loadrt lcec addf lcec.read-all              servo-thread loadusr ethercat debug 0 addf pwmgen.make-pulses base-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf pwmgen.update servo-thread addf lcec.write-all             servo-thread

so will it be ok?

Will the servos behave completely differently, or will the behavior change slightly?

Thank you very much.
Jirkam

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

More
3 years 10 months ago #258634 by db1981
Replied by db1981 on topic ASD-A2 EtherCAT on LinuxCNC
that is the correct order.

you are not using pids in linuxcnc. So the behavior will change slightly.

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

Time to create page: 0.549 seconds
Powered by Kunena Forum