You can create those three pins (start homing, completed, error)  in
custom_makepins() and connect them to pins created in the ethercat xml
config for your drives.
They will appear as joint.n.start-homing etc.

I wasn't referring to coordination of joints but the differences from
Dominc's cia402.comp where each drive has its own instance of the component
via:
loadrt cia402 count=3
so its much easier to code

Whereas in a custom home comp your code needs to be in a loop of all joints
and any persistent data (eg static variables) need to be stored in the
homing structure
static custom_all_joints_home_data_t *custom_joint_home_data = 0;

and things like:
int jno;
custom_one_joint_home_data_t *addr;
for (jno = 0; jno < njoints; jno++) {
addr = &(custom_joint_home_data->custom_jhd[jno]);
*(addr->is_custom_homing) = customH[jno].is_custom_homing; // OUT
}

The other thing you  will likely need to do is "eat" the following errors
generated while moving when not under linuxcnc control. fun fun!!


Rod Webster
*1300 896 832*
+61 435 765 611
Vehicle Modifications Network
www.vehiclemods.net.au


On Fri, 29 Jul 2022 at 19:05, Nicklas SB Karlsson <n...@nksb.eu> wrote:

> 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
>

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

Reply via email to