M19 and spindle-index-enable issues

More
3 years 5 months ago #270863 by andypugh
(Note that the way to enable homing is to add 16 to the "mode" setting. Then you need to connect the new index-enable pin) 

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago - 3 years 5 months ago #270882 by 0x2102
Thanks Andy. I will take a look at the new orient.comp with "homing". Not sure if will address the issue, or will the new orient re-enable the spindle encoder index with every M19 command?

My particular issue is after I run my spindle in the higher rpm range (max 36000rpm). I can replicate the issue above 16K rpm. I still get a speed signal from the spindle encoder but the mesa encoder is not counting a 100%, it's missing a few counts every second or so and that adds up when you run the spindle for 5 min order longer. Right after I stop the spindle and try to do an M19R0, the angle is off by a bit. When I call my spindle homing routing, it will re-sync everything at low spindle speed and the M19 R0 is at the right position.

I wrote a simple test comp that waits for the spindle.0.brake (M5) signal && the encoder rpm between 2000 - 1000 - to then re-enable the encoder index. The spindle still does a couple of turns before it comes to a full stop and LinuxCNC has a "clean" encoder reader for a correct M19 call right after the M5. 

This seems to be working fine for me and my particular use case: high speed spindle with encoder. 

component spindle_index_enable "Enable spindle index after M5 (brake-on)";
pin in float rpm_in;
pin in bit brake_on;
pin io bit out;
function _;
license "GPL";
author "0x2102";
;;
FUNCTION(_) 
{
        if (rpm_in >= 1000 && rpm_in <2000 && brake_on) {
            out = 1;}
        else 
            out = 0;
}

 
Last edit: 3 years 5 months ago by 0x2102.

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #270883 by andypugh
When "enable" is set with new "orient" it first sets index-enable and then sets a spindle position just a little ahead of the current position. Then when it sees index-enable go low it reverts to the previous logic.

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #270884 by andypugh
When "enable" is set with new "orient" it first sets index-enable and then sets a spindle position just a little ahead of the current position. Then when it sees index-enable go low it reverts to the previous logic.

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #272160 by Aciera
@andy
I've been trying to get that component to work, seems to be exactly what I need.
I'm having a bit of trouble with the index-enable:
Whenever I connect the orient.index-enable pin in hal everything that is using the encoder index-enable stops working. ie. I use the encoder index-enable also for joint.3.index-enable, pid.a.index-enable and for spindle.0.index-enable.
Looks like it permanently pulls the index-enable signal in hal to zero.
Any ideas?

Please Log in or Create an account to join the conversation.

More
3 years 5 months ago #272197 by Aciera
An update:
I got this working with some minor changes and it looks very promising. Thanks for this Andy!
This rehomes the motor in spindle mode using M19 and lets me reposition the spindle back to within 0.2 degrees of the last rotary position (which I manually type into the M19 command for now). The remaining tolerance is then compensated by the rotary joint pid as soon as I switch back to rotary mode.
The only issue I see is a somewhat unpredictable speed change in the spindle orient after the spindle index signal has been detected but this can probably be taken care of with the orient pid.


Warning: Spoiler!

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum