Ethercat HAL driver

More
08 Jan 2021 20:12 - 08 Jan 2021 20:17 #194539 by jc2ktr
Replied by jc2ktr on topic Ethercat HAL driver

Well I finally got my ECT-60 scaled. I am using 5mm pitch leadscrew so 300RPM = 1500mm/M. After rereading the manual i noticed that Target Velocity and Target Position are in pulses!!! LinuxCNC uses machine units. So at 4000 pulses per revaluation from the manual I get 800 pulses for 1mm. I don't know why 4000 pulses because the motor description say 1000 count encoder. my guess is microstepping in the drive.

<!-- Target Position -->
<pdoEntry idx="607a" subIdx="00" bitLen="32" halPin="TargetPosition" halType="float" scale="800"/>
<!-- Target Velocity -->
<pdoEntry idx="60ff" subIdx="00" bitLen="32" halPin="TargetVelocity" halType="float" scale="800"/>

I have this test drive at the office. Have not tried at home with multiple drives.


Thanks for the information, so that means that my ballscrew with 6mm pitch has a scale of 4000/6 = 666.666...

Hm i will try it tomorrow.

Seems a good start.

May i ask you how scaled the feedback from the ECT?

I don't know why 4000 pulses because the motor description say 1000 count encoder. my guess is microstepping in the drive.

Scroll down to the middle of the page, there is the explanation why 1000 pules of the quadrature encoder make 4000 counts, servo drives do not use microstepping.
www.dynapar.com/technology/encoder_basics/quadrature_encoder/



The ETC60 is not a Servo, it is a Closed-Loop Stepper with EtherCAT interface from my understanding.
Right the disk has 1000 increments but from counting the rising and falling edges on 2 channels you get 4000 counts per revolution.
Last edit: 08 Jan 2021 20:17 by jc2ktr. Reason: edit

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

More
10 Jan 2021 13:25 #194722 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
Hi,

Way back in April 2020 there was some discussion about the EL5101 incremental encoder. I have finally got around to hooking mine up and I am happy to say that it worked perfectly out of the box. However, I am running the encoder on the spindle of the lathe and I need to be able to monitor the index pulse in order for linuxcnc to synchronise motion while threading.

According to the manual (pg 144) the status of A,B and C inputs can be monitored via 0x6010:09, 0x6010:0A, and 0 x 6010:0B . Is it possible to add these pdo's either by twincat or by modifying the el5101 source file?


Kind regards,
Dan
Attachments:

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

More
10 Jan 2021 22:02 #194787 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
Dan,

Good to see that it worked out the box. I still have been using the 5151's for joint feedback, but want to use the 5101 on the spindle like you are doing so I will be watching to see if you get the index working. I just haven't had time to machine the encoder bracket and physically get the encoder setup on the particular machine that I want to add spindle feedback on as have been working on 2 other setups... otherwise I would be right there with you on the same problem.

Hopefully Albert (Chimeno) or Grotius will help with tweaking the terminal code... as they always help.

Robert

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

More
11 Jan 2021 20:47 - 11 Jan 2021 21:47 #194952 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello @sqmathlete

The EL5101 driver created by linuxcnc-ethercat does not work with the pulse signals A, B, C directly from the device but a counter is created by software, I think you also have an index pin, I attach a register that creates the driver EL5101

hal_bit_t *ena_latch_c;
hal_bit_t *ena_latch_ext_pos;
hal_bit_t *ena_latch_ext_neg;
hal_bit_t *reset;
hal_bit_t *inext;
hal_bit_t *overflow;
hal_bit_t *underflow;
hal_bit_t *latch_c_valid;
hal_bit_t *latch_ext_valid;
hal_bit_t *set_raw_count;
hal_s32_t *set_raw_count_val;
hal_s32_t *raw_count;
hal_s32_t *raw_latch;
hal_u32_t *raw_frequency;
hal_u32_t *raw_period;
hal_u32_t *raw_window;
hal_s32_t *count;
hal_float_t *pos_scale;
hal_float_t *pos;
hal_float_t *period;
hal_float_t *frequency;


Hello @jc2ktr
I hope your controller is working

Hello @bkt
If you have problems with the device signals or missing registration, you can ask the manufacturer for an update and then record a new firmware using TWINCAT3, I hope it works for you soon


Greeting
Chimeno
Attachments:
Last edit: 11 Jan 2021 21:47 by chimeno.
The following user(s) said Thank You: bkt

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

More
11 Jan 2021 23:25 #194982 by jc2ktr
Replied by jc2ktr on topic Ethercat HAL driver


Hello @jc2ktr
I hope your controller is working

Greeting
Chimeno


Hi @Chimeno

Yes and no :) the axis moves but scaling is still off. Its curious if linuxcncs dro has the right scaling/units the travelled distance is off. When the distance is ok the dro's are off.

Made a break for few days, to clear the head and then i go on the problem again.

Greetings Sven
The following user(s) said Thank You: chimeno

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

More
12 Jan 2021 14:08 #195053 by MRBaird
Replied by MRBaird on topic Ethercat HAL driver
the feed back for my ECT was 0.0125. seems to be working so far.

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

More
12 Jan 2021 14:18 #195055 by MRBaird
Replied by MRBaird on topic Ethercat HAL driver
I am trying to get a EL3054 to work. I am completely new to Linux so everything is a bit challenging. Do I just modify a similar .H and .C file and add in lcec.conf? Does it compile when its run for the first time or do i have to compile myself?

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

More
12 Jan 2021 16:50 #195089 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
@ Chimeno

The EL5101 driver created by linuxcnc-ethercat does not work with the pulse signals A, B, C directly from the device but a counter is created by software,


Yes, the encoder is updated at a much faster rate internally. By scaling the frequency appropriately, velocity in rpm or rev/s can be calculated quite easily...or at least close enough for the spindle. I was all messed up in the scaling :silly:




This satisfies the first requirement for coordinated motion,
net spindle-velocity encoder.3.velocity => spindle.0.speed-in
linuxcnc.org/docs/2.8/html/examples/spin..._synchronized_motion .

Chimeno, you are a very skilled wizard that knows what he is doing, I do not. So at this point, I am not sure if I am willing to risk bricking the terminal by rewriting the eprom. I'm going to see if I can figure out how to satisfy
net spindle-position encoder.3.position => spindle.0.revs
. with the currently available pdo's. I'm probably just not understanding some detail.
Will keep you posted.

As always thanks for you generous help!

Kind regards,
Dan
Attachments:

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

More
12 Jan 2021 16:59 #195090 by sqmathlete
Replied by sqmathlete on topic Ethercat HAL driver
@ Chimeno

Sorry, my mistake there are three parts to satisfying coordinated motion. Spindle speed in rpm and rev/sec can be calculated from the frequency, as described earlier. It is this part that I don't understand
net spindle-index-enable encoder.3.index-enable <=> spindle.N.index-enable
. Perhaps this is where I will have to rewrite the eprom? Again, I will keep working on it and let you know.

Kind regards,
Dan

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

More
12 Jan 2021 19:00 - 12 Jan 2021 19:02 #195106 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello @sqmathlete

Chimeno, you are a very skilled wizard that knows what he is doing, I do not. So at this point, I am not sure if I am willing to risk bricking the terminal by rewriting the eprom. I'm going to see if I can figure out how to satisfy


I think I was wrong in my last post, the EEPROM topic is for the user @bkt, you don't have to reprogram the eeprom for that.

Greeting
Chimeno
Last edit: 12 Jan 2021 19:02 by chimeno.

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

Time to create page: 0.186 seconds
Powered by Kunena Forum