Ethercat - newbie guidelines

More
09 Jan 2022 11:37 #231238 by rodw
Replied by rodw on topic Ethercat - newbie guidelines
OK, that works! Thanks so much for catching my silly mistake. I've never had to worry about the order of things before in components I've written.

What I ended up with
 

File Attachment:

File Name: cia402_202...-09.comp
File Size:11 KB


I need to check it against a standard version of homing.c But I'm sure it will work!
Attachments:

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

More
09 Jan 2022 11:53 #231239 by rodw
Replied by rodw on topic Ethercat - newbie guidelines
Actually, its not right yet. It needs some logic to manage if the sensor is enabled when homing is requested. It does not like that at all. Another day!.

I think we can check if the home switch is enabled in 0x60FD and set my homing_mode to HOME_CONFIRM if the home input is true when homing is requested

I think also we need a pin to unhome the drives as they can be left in a unexpected state sometimes.

Anyway, its looking good.
 

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

More
09 Jan 2022 16:59 #231253 by db1981
Replied by db1981 on topic Ethercat - newbie guidelines
okay, but these cases have to be caught by the drive. Maybe the drive config is not right, yet.

-the home sensor is only connected to the drive?

at the moment the drives gets an rising edge of the home bit after the opmode is changed the drive should:
-clear the is_homed bit (unhome)
-start its home procedure and set the is_homing bit
in the case the home_switch is enabled while starting homing, the drive adds an step to leave the sensor first or skips the search step.
-after finishing its internal procedure, the drive clears is_homing and set the homed bit (this is noticed by the cia comp and triggers lcnc)

this is the normal behaviour of an home function and all drives that i know are working like that...

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

More
09 Jan 2022 21:48 #231261 by rodw
Replied by rodw on topic Ethercat - newbie guidelines
Yeh, I had a bit of a play this morning before work and did not have much luck.
I added an input for the home switch which is fed by an output from lcec.
Take homing method 19
 
When the home switch (attached only to the drive) is activated per the top diagram, the drive halts movement. It should halt and reverse to find the edge which its not doing. Deactivate the switch and the move to position finishes (applying offset set in the drive).

I did get it to force lcnc homing but the drive was not in correct state. I will try your ideas.

Somehow I think linuxcnc still has its finger in the pie and possibly overriding our desired behaviour.
Attachments:

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

More
09 Jan 2022 22:16 #231263 by tommylight
Homing from the wrong side of the switch would result in what you describe, see lover part of the drawing.
Just a stab in the dark.

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

More
09 Jan 2022 22:36 #231265 by rodw
Replied by rodw on topic Ethercat - newbie guidelines

Homing from the wrong side of the switch would result in what you describe, see lover part of the drawing.
Just a stab in the dark.

Yes its possible the HOME_LATCH_VELOCITY has an incorrect sign. I did think of that.  But this is all happening external to Linuxcnc. Eg Linuxcnc is not commanding the motor to move, the drive is.

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

More
09 Jan 2022 22:57 - 09 Jan 2022 22:58 #231266 by db1981
Replied by db1981 on topic Ethercat - newbie guidelines
but maybe your input logic on the drive is inverse, or them are sink inputs.
hold down the switch, start the homing, release the switch and push it again.
I'm shure your drive then has done the excepted homing.

normaly you can set inverse of the input with an register.
Last edit: 09 Jan 2022 22:58 by db1981.

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

More
09 Jan 2022 23:05 #231267 by rodw
Replied by rodw on topic Ethercat - newbie guidelines

but maybe your input logic on the drive is inverse, or them are sink inputs.
hold down the switch, start the homing, release the switch and push it again.
I'm shure your drive then has done the excepted homing.

normaly you can set inverse of the input with an register.

Worth a try! 0x2008 sets input port polarity on this drive. (Normally Open or Normally Closed)

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

More
10 Jan 2022 06:04 #231288 by tommylight
I never said anything about LinuxCNC.
What you describe exactly matches the B section of the attached picture, so the drive is doing what is told but from the wrong side so it stops.

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

More
10 Jan 2022 10:02 #231294 by rodw
Replied by rodw on topic Ethercat - newbie guidelines
Well I went back and checked what limit switches I had bought and they were normally open (NO). I checked the settings and  NO polarity is a 1. Bit 4 (where the first bit is 0), is the one applicable for the home switch.  The default setting in the register is 0xF0 so the input was set to NO.

I played around with the polarity and ended up with an utter mess. so reverted back to the working config using the component above.

So I'm going to sit this out until I get some ball screws mounted and the drives off my desk and into a machine. That may take a while.

Thanks everyone for your support.  I will report back in due course.

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

Time to create page: 0.333 seconds
Powered by Kunena Forum