Hello everyone,
I would like to revisit this topic.
The component has been working very well and reliably for three years now.
Unfortunately, I have already broken the spindle support twice, but this was not due to the component itself, but rather to the compressed air in our workshop.
I would therefore like to install a position switch to check the position of the cylinder and ensure that it is actually retracted.
To do this, the component would need to be expanded with an additional pin and a query.
Now my question to you, or rather to Rod, is whether you could help me with this again?
This is the current Comp file:
Code:
component spinport "LinuxCNC HAL component that switches the spindle support";
description
"""
Component to trigger the spindle support
\\fBEXAMPLE:\\fR
.br
.br
loadrt spinport names=spport
.br
addf spport servo-thread
.br
net position axis.y.pos-cmd => spport.position
.br
setp spport.on 900
.br
setp spport.off 1600
.br
net spport-trigger spport.trigger
""";
author "Rod Webster";
pin in float position "Motion signal for Axis position";
pin out bit trigger "True if spinport segment should be triggered";
param rw float on "Absolute axis coordinate from which the support is retracted";
param rw float off "Absolute axis coordinate from which the support is extended";
function _;
license "GPL";
;;
#include <rtapi_math.h>
FUNCTION(_) {
if((position > on)&&(position < off))
trigger = 0;
else
trigger = 1;
}