tor 2022-07-28 klockan 21:20 +1000 skrev Rod Webster:
> Nicklas,
> this will be a pretty big brain dump so please read on.
> 
> This is where Dewey's work comes in to solve your problem. You can
> now
> write a custom homing component and install it using halcompile.
> You need to start by reading the homecomp docs
> http://linuxcnc.org/docs/devel/html/man/man9/homecomp.9.html
> Then refer to the sample code
>  
> https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/homecomp.comp
> You also become familiar with homing.c
>  
> https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/motion/homing.c
> Homing starts in homing_init()
>  
> https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/motion/homing.c#L1411
> You might also like to review Dominic Braun's cia402 component
> https://github.com/dbraun1981/hal-cia402 for CANOpen/CIA402 related
> stuff.
> 
> homing_init() in homing.c has been reworked so the default code is
> moved to
> base_homing_init()
> This allows a custom version of homecomp to totally rewrite the
> homing code
> in homing_init and other procedures who have base versions in
> homing.c
> So a custom homing module for CANopen devices might live in a file
> called
> canopen_home.comp and contain its own version of homing_init() that
> starts
> the homing process and just waits until the drive signals homing is
> completed, then set the joint.N.homed pin to true.

In motion module. A pin to start homing and signal completed is OK but
there also ought to be a need to signal an error occured.

Normally then homed motion pins are connected to device. It is possible
to work around with multiplexers but might be useful if these pins are
instead connected to home component then home input pin is true.

> 
> Dominc has some useful stuff in his component and triggered homing
> using joint.N.index-enable
> But Daniel and I found this was not enough, changes to homing.c was
> required. Then Dewey released his custom homing module we are
> discussing
> here.
> Dominic's code has two functions read_all() and write_all() to
> transfer
> data to and from ethercat slaves.
> I think this could be quite a useful technique. I think this could be
> replicated in canopen_home.comp by extending
> void read_homing_in_pins() and write_homing_out_pins() and creating
> any
> additional CANopen pins at the joint level.

Additional CANopen pins at joint level should not be needed in linuxcnc
but may of course be useful in home component at least to show status.

> I did attempt this and got close as I could init the homing process
> but
> cancelling it did not restore the correct state and I did not proceed
> due
> to time constraints.
> I will say working in a homecomp becomes quite complex because you
> have to
> deal with all joints at once so additional data (and pins) must be
> stored in

Most home components do not need any coordination between joints. If
possible to write custom home component it is however possible to write
a home component with pins for several joints there some kind of
coordination is needed.

There is three pins (start homing, completed, error) to connect custom
home component for each joint should be enough.


Nicklas Karlsson



_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to