fc60 wrote: Would someone paste some sample code that limits the spindle to 100RPM and feed to 10IPM?
Is this code something you paste into the normal *.cnc file?
It can't always be simply pasted in, depending on whether the halui overrides are already in use. So you would need to understand your HAL file to know where it needed to be edited.
Using halui is only one way, and might not be the best way. For the spindle a limit block in the path from motion to pwm would probably be better.
Code:
loadrt mux_generic config="ss7,ss7"
#motion-type is signed, mux-generic needs unsigned
loadrt conv_232_u32 count=1
...
addf conv_s32_u32.0 servo-thread
addf mux-gen.0 servo-thread
addf mux-gen.1 servo-thread
...
net select-motion-type-signed motion.motion-type =>conv_s32_u32.0.in
net select-motion-type-unsigned conv_s32_u32.0.out => mux-gen.00.sel-int mux-gen.01.sel-int
net mux-gen.00.out-s32 => halui.spindle-override.counts
net mux-gen.01.out-s32 => halui.max-velocity.counts
setp halui.spindle-override.direct-value 1
setp halui.spindle-override.scale 100
setp mux-gen.00.in-s32-00 100
setp mux-gen.00.in-s32-01 100
setp mux-gen.00.in-s32-02 100
setp mux-gen.00.in-s32-03 100
setp mux-gen.00.in-s32-04 100
setp mux-gen.00.in-s32-05 5
setp mux-gen.00.in-s32-06 100
setp halui.max-velocity.direct-value 1
setp halui.max-velocity.scale 100
setp mux-gen.01.in-s32-00 100
setp mux-gen.01.in-s32-01 100
setp mux-gen.01.in-s32-02 100
setp mux-gen.01.in-s32-03 100
setp mux-gen.01.in-s32-04 100
setp mux-gen.01.in-s32-05 10
setp mux-gen.01.in-s32-06 100
Provided untested and without warranty.
The numbers will need to be tweaked to suit your particular machine, I expect. Specifically the velocity scale needs to be max velocity and the limit for other motion types needs to be set to the same value. For the spindle the scaling is a ratio, so probably won't actually work as-is except to prevent the spindle turning altogether with an override of zero.