Help Needed: Cracking the Code on LinuxCNC Servo Homing Setup!

More
2 years 4 months ago #303486 by rodw
Remember Linuxcnc is THE MOTION CONTROLLER!
Linuxcnc will control two motors in unison. 
To Home a gantry though, I think we would need to extend custom_1joint_state_machine()
github.com/rodw-au/cia402_homecomp/blob/...2_homecomp.comp#L139
You can see the code calls the homing.c state machine
github.com/LinuxCNC/linuxcnc/blob/master...motion/homing.c#L718
which deals with offsets.
It's probably not a big deal as it would just move the two motors in unison after they are both homed by the home_offset if HOME_SEQUENCE is negative.
But lets just get one joint homing first.
 

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

More
2 years 4 months ago #303488 by rodw

I am thinking the best solution for the entire LCNC and ECAT is to do the same as what Siemens/Fanuc have done and find a solution for homing that makes sense based on true ABS encoder technology. There is a net savings in cost in doing this as well as ensuring the precision required. The cost savings comes in the wiring and reliability aspect. Less wires less cost and less chance for things to break. And it maintains proper separation of concerns with a true master slave setup.

I will be looking at how to change LCNC to act more like the CNC ECAT standard vs. trying to reinvent the wheel. Currently LCNC has a single mode for positioning. Command Position Mode. Which is the same as S/D mode using a Mesa. The drive is in follow my lead more or less. This creates some questions as to whether the ECAT interface in LCNC can use the same functionality of the standard interface within the ECAT interface. Can LCNC use the ABS POS FB as the FB to close the loop on the LCNC side? Will the driver do an actual tandem control? Can LCNC custom homing work with a "home in place" "update position to current ABS POS FB, then assume homed?

 
Don't get to carried away. Linuxcnc has been homing for a long time. Many of us don't want to spend on high quality absolute encoders and that is not mandated by the  ethercat standards. In fact, the cia402 standard does not care how a joint is homed and neither does Linuxcnc.

Whilst the documentation may be sparse, the code base isn't. You need to read and understand homing.c and how homing works as discussed in the docs under homing configuration. When you read that you will see that our home comp knows the home offset and homing sequence of each joint.
so we now know that after a joint is homed, we need to move the home offset and if the home sequence is negative we need to move it in unison with the matching joint with the same negative home sequence number.

So gantries don't sound hard at all!
But said, we need to get 1 joint homing first.
I'm quite happy about what I found out tonight because we don't need to litter our home comp with additional pins!

 

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

More
2 years 4 months ago #303489 by Donb9261
Thanks for the clarification. But, I was talking respect to the Delta tandem axis solution which gives LCNC control of only one drive while that drive controls the tandem drive. Not ideal at all.

I have not seen where the tandem axis control is open to ECAT. Did I miss that? I know for the standard non-lcec servo thread it is. If so, where is the documentation for that to setup the ini and hal for ECAT tandem axis(aka Gantry) control. If this is already available, then yes homing becomes much easier and can be controlled by LCNC in isolation for at least the ABS multi-turn condition.

So, let's understand this. Can LCNC with lcec provide proper tandem axis control of sync'd motion? IDK... If so, what is the best practice for the ini and hal configs?

On that thread, what is the best practice for providing a known datum(homing) that satisfies the tandem axis problem?

Option 1 - Use the drives encoder out pins to a Mesa card and let LCNC see the Z index for each motor for non-multi-turn encoder drives
Option 2 - Use a scale with Mesa to do the same thing if the drive does not support RS422 output and also uses the home to index/ref marker from the scale
Option 3 - Use the ECAT derived FB POS as the failsafe actual position and write routine in custom homing that simply uses the multi-turn recorded and stored position value to call the axis "homed" then simply move the axis or tandem axis to the zero location from that derived position

Once homing is complete, will LCNC close the loop for the tandem axis as it does in the non-lcec setup? Or is open loop good enough? I would think so given the drives are ECAT on 1ms ticks. More than ample for low error sync. That is how the big boys do it. I see no reason why it would not work here other than the slight .02ms lag over the lcec bus as compared to a standard ECAT system. iGh has the timing table in their docs. I don't see an issue unless the machine exceeds 2000IPM. Which if so, I would not use LCNC. I would buy a Siemens control. ECAT chips are mature enough now but I am still always suspicious of motion at those speeds. For good reason.

I think we are making progress here at least in terms of speaking a common language. It inspires me that soon a solution for the problems will be found. Thanks for your kind assistance. LCNC may soon be let loose from the stone age! Lol!.

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

More
2 years 4 months ago #303490 by rodw

So really the gantry function is not needed / helpful when we have a full controller (such as LinuxCNC)

And what we need is to be able to configure 'home offset' whether homing is done fully in LinuxCNC or in a servo drive
Ys, this is all that's needed. we include homing.c in our homecomp which in turn loads homing.h
This code that sets these parameters is called from our homecomp  github.com/LinuxCNC/linuxcnc/blob/master...motion/homing.c#L607
 

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

More
2 years 4 months ago #303491 by Donb9261
On L615 there is a bool for volatile_home. What is the meaning of this state?

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

More
2 years 4 months ago #303501 by Donb9261
Okay so if true then the axis must home on start up.

3.10. VOLATILE_HOME
If this setting is true, this axis becomes unhomed whenever the machine transitions into the OFF state. This is appropriate for any axis that does not maintain position when the axis drive is off. Some stepper drives, especially microstep drives, may need this.

Wouldn’t this assist with the home routine where the axis home is stored in ABS and required no home? If false, then read the ABS, set joint homed true. Set the machine coordinate to the current ABS. Homing done. ?

Seems you could also create a bool to switch back and forth between the gantry mode and independent mode. Say you had X and U as your tandem axis set. You could then when independent move the motors and measure the square of the gantry. Once square, set the ABS for each drive, then switch back to tandem axis control in LCNC. Done?

Seems somewhat logical to me, but unsure what has to be done get that into code yet.

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

Time to create page: 0.262 seconds
Powered by Kunena Forum