Spindle config EtherCAT

More
2 years 9 months ago #290461 by eduard
Replied by eduard on topic Spindle config EtherCAT
I did not found how to use CiA402 with this VFD since the VL mode not supported (I think) in dbraun hal-cia, and I not have any examples except for servos.

But I made the config and using the hal parameters, can control the vfd and everithing is working with a small exception.

Here is the code:

#*******************
# SPINDLE
#*******************

setp lcec.0.MX2.spindle-controlword 15

net spindle-vel-cmd-rpm => lcec.0.MX2.spindle-target-velocity
net spindle-vel-fb-rpm => lcec.0.MX2.spindle-actual-velocity
#net qtdragon.spindle-fault <= lcec.0.MX2.spindle-statusword

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in

# ---Setup spindle at speed signals---

sets spindle-at-speed true

When I set the controlword to 15, the vfd is powering on and waiting for the rpm input.
But when shutting down lcnc if I not set manually to 0:

lcec.0.MX2.spindle-controlword 0

on the next start the vfd not accepting remote signals from lcec (or whatever it is).

I tried to set a shutdown.hal with this parameter

setp lcec.0.MX2.spindle-controlword 0

but not working.

Any idea how to solve this?
The following user(s) said Thank You: hilo90mhz

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

More
2 years 9 months ago - 2 years 9 months ago #290462 by 0x2102
Replied by 0x2102 on topic Spindle config EtherCAT
You will need to modify the CIA402 code ...it's just an example that support CSP and CSV but you could modify and support other modes as well.

Add the MUX2 to fix your issue...

It will set the lcec.0.MX2.spindle-controlword to 15 when the "spindle-enable" signal is 1 (true) and to 0 when the "spindle-enable" signal is 0 (false).
Last edit: 2 years 9 months ago by 0x2102.
The following user(s) said Thank You: eduard

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

More
2 years 9 months ago - 2 years 9 months ago #290487 by eduard
Replied by eduard on topic Spindle config EtherCAT
UPD:
It was a type mismatch. After I changed the spindle-controlword to float from u32 in xml, now is working. But its weird, since the servo controlword still u32 and working as well. 
Why?

Anyway, thanks for the help, now I understand what I'm doing in hal. 


After testing, is not working yet.

How can I check these signals:
mux2.spindle-enable.in0
mux2.spindle-enable.in1
spindle-ctrl-cmd

they are not appearing in halshow

This is the full scpindle code:
...
...
loadusr -W lcec_conf /home/eduard/linuxcnc/custom/ethercat-conf.xml
loadrt lcec
loadrt cia402 count=1
loadrt mux2 names=mux2.spindle-enable

addf    lcec.read-all            servo-thread
addf    cia402.0.read-all       servo-thread
addf    motion-command-handler  servo-thread
addf    motion-controller       servo-thread
addf    cia402.0.write-all      servo-thread
addf    lcec.write-all            servo-thread

addf    mux2.spindle-enable        servo-thread
...
...

#*******************
#  SPINDLE
#*******************

#Spindle OFF
setp mux2.spindle-enable.in0 0

#Spindle ON
setp mux2.spindle-enable.in1 15

net spindle-vel-cmd-rpm     => lcec.0.MX2.spindle-target-velocity
net spindle-vel-fb-rpm      => lcec.0.MX2.spindle-actual-velocity
net spindle-enable             => mux2.spindle-enable.sel
net spindle-ctrl-cmd    mux2.spindle-enable.out     =>         lcec.0.MX2.spindle-controlword

#net qtdragon.spindle-fault <= lcec.0.MX2.spindle-statusword

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs    <=  spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  spindle.0.speed-out
net spindle-vel-cmd-rpm-abs    <=  spindle.0.speed-out-abs
net spindle-enable             <=  spindle.0.on
net spindle-cw                 <=  spindle.0.forward
net spindle-ccw                <=  spindle.0.reverse
net spindle-brake              <=  spindle.0.brake
net spindle-revs               =>  spindle.0.revs
net spindle-at-speed           =>  spindle.0.at-speed
net spindle-vel-fb-rps         =>  spindle.0.speed-in

# ---Setup spindle at speed signals---

sets spindle-at-speed true
 
Last edit: 2 years 9 months ago by eduard.

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

More
2 years 8 months ago #292599 by scottlaird
Replied by scottlaird on topic Spindle config EtherCAT
This is an Omron MX2? Those are surprisingly cheap on eBay...

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

More
2 years 8 months ago #292633 by GuiHue
Replied by GuiHue on topic Spindle config EtherCAT
@scottlaird: The MX2 (Omron) and WJ200 (Hitachi) are great VFDs, well liked with the linuxcnc community due to the wj200 comp that deals with the rs485 connection. Both VFDs do not come with an EtherCAT Interface. This is a quite costly addon.
I have a WJ-ECT at my disposal, but cannot test it yet as I only have one matching VFD and spindle on hand and that is still in use.

I guess I can do the testing soonish if necessary.


@eduard
The mux2 cannot be found in halshow? Have you tried the search bar? They appear to be laded to the servo-thread. They should appear.
What exactly is not working?

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

More
2 years 8 months ago #292663 by scottlaird
Replied by scottlaird on topic Spindle config EtherCAT
It looks like the EtherCAT addon for the MX2 is all over eBay right now for <$100, and tiny MX2s aren't much more expensive. Probably more than I want to spend on test hardware, but maybe if I can find a 2.2kW unit for a reasonable price it'd be worth picking one up.

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

Time to create page: 0.280 seconds
Powered by Kunena Forum