On 09/23/2016 09:22 AM, Florian Rist wrote:
> Hi,
> thinks more or less work now, but I'd like to have LinuxCNC take care of
> homing and limits.
>
> Here's what I did:
>
> I disconnected the axis axis.3.motor-pos-cmd pin from the
> emcmot.03.pos-cmd signal and connected a pin of my new component. I set
> FERROR and MIN_FERROR to 9999999.
>
> Now I can control the position of axis 3 from my Python script and AXIS
> displays axis position. That's nice and work well.
>
> Now the only think that I'm missing is someone taking care of the travel
> limit of my axis. I have a homing switch and set-up homing and
> soft-limits for the axis, but as I'm not using AXIS to control the axis
> this does not have an effect any more.
>
> Is there away to get back the travel limiting in a easy way?

There's no easy way to home a joint without letting LinuxCNC's Motion 
component control it.

You can limit position, velocity, and acceleration by using the limit3 
component between your command signal and the joint actuator (stepgen or 
whatever):  http://linuxcnc.org/docs/2.7/html/man/man9/limit3.9.html


Maybe you could rig something up where Motion controls the joint while 
it's unhomed, and it switches to your control signal when it's homed?

I'm not sure if that would work, but it's probably work trying.

Try having axis.3.motor-pos-cmd and the output of your 
sensor-to-position component go into a mux2 component 
(http://linuxcnc.org/docs/2.7/html/man/man9/mux2.9.html).  The select 
pin would be netted to axis.3.homed, and the output would go to the 
limit3 input, and from limit3 to the stepgen command input.

This way, when the joint it unhomed it tracks Motion's homing commands, 
and when it finishes homing it goes to your sensor-to-position 
component's commanded position, all while obeying the limit3 
constraints, including during the switch-over from motion's homing to 
your sensor-to-position command.

If the joint unhomes (for example if it's marked VOLATILE_HOME and the 
joint controller loses power from an E-stop) then it will stop tracking 
your sensor-to-position component, go back to where Motion left it 
(probably near the home switch) while obeying the limit3 constraints, 
and be ready for you to re-home it.  Once you re-home it, it will go 
back to following your sensor-to-position component's commands.

If you try this, let us know if it works!  If you make a video we can 
make a showcase for the www.linuxcnc.org front page :-)


-- 
Sebastian Kuzminsky

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

Reply via email to