M19 and spindle-index-enable issues
09 Jun 2021 14:49 - 09 Jun 2021 15:21 #211623
by MaxP
M19 and spindle-index-enable issues was created by MaxP
Hey!
I am trying to tune up the orientation of the spindle to work with the M19 command. Before that, the spindle-at-speed signal was configured and the G33.1 command was tested. It works fine. However, when the M19 is running, it is constantly in error with the position. Observing the spindle-index-enable signal with the HAL, I saw that when the M19 was running, it was not exposed. Therefore, the value on the encoder is not reset (for each revolution it now increases by 1). As I understand it, the value at the input to orient.0.position should be between 0 and 1, and due to the fact that there is no spindle-index-enable, the number is not reset to zero when the index mark is reached. Also, I checked by manually setting the HAL command "setp spindle-index-enable true" that the encoder will reset the counter. Pin spindle.0.orient is activated normally when processing M19. Therefore, I tried to generate the activation of the spindle-index-enable signal by the presence of the spindle.0.orient signal, but it could not be done correctly.
Please, help me:
1) Should really orient.0.position be between 0 and 1?
2) Should linuxcnc set spindle-index-enable when processing M19?
3) What else should you check?
4) Does the spindle driver need to be changed from "speed control" to "position control"?
Thank you in advance,
Max
Also, I using MESA 7i76 , current hal file attached.
I am trying to tune up the orientation of the spindle to work with the M19 command. Before that, the spindle-at-speed signal was configured and the G33.1 command was tested. It works fine. However, when the M19 is running, it is constantly in error with the position. Observing the spindle-index-enable signal with the HAL, I saw that when the M19 was running, it was not exposed. Therefore, the value on the encoder is not reset (for each revolution it now increases by 1). As I understand it, the value at the input to orient.0.position should be between 0 and 1, and due to the fact that there is no spindle-index-enable, the number is not reset to zero when the index mark is reached. Also, I checked by manually setting the HAL command "setp spindle-index-enable true" that the encoder will reset the counter. Pin spindle.0.orient is activated normally when processing M19. Therefore, I tried to generate the activation of the spindle-index-enable signal by the presence of the spindle.0.orient signal, but it could not be done correctly.
Please, help me:
1) Should really orient.0.position be between 0 and 1?
2) Should linuxcnc set spindle-index-enable when processing M19?
3) What else should you check?
4) Does the spindle driver need to be changed from "speed control" to "position control"?
Thank you in advance,
Max
Also, I using MESA 7i76 , current hal file attached.
Attachments:
Last edit: 09 Jun 2021 15:21 by MaxP. Reason: attach config
Please Log in or Create an account to join the conversation.
10 Jun 2021 10:43 #211685
by andypugh
Replied by andypugh on topic M19 and spindle-index-enable issues
In theory you should only need to set index-enable once, and then as soon as the spindle turns it will be "homed".
I think that spindle homing really needs to be built in to the home sequence. In fact the entire multi-spindle patch was done as a precursor to doing this, and it remains on my list.
As long as the spindle encoder can track full spindle speed and counts reliably you can just "setp encoder.NN.index-enable 1" in the HAL file, and the spindle will be in synch if (and only if) the spindle rotates through index at least once before he M19 command.
I think that spindle homing really needs to be built in to the home sequence. In fact the entire multi-spindle patch was done as a precursor to doing this, and it remains on my list.
As long as the spindle encoder can track full spindle speed and counts reliably you can just "setp encoder.NN.index-enable 1" in the HAL file, and the spindle will be in synch if (and only if) the spindle rotates through index at least once before he M19 command.
Please Log in or Create an account to join the conversation.
10 Jun 2021 12:41 #211693
by alkabal
Replied by alkabal on topic M19 and spindle-index-enable issues
Hi
About homing spindle, imo using C axis allow to use built in hal pin for starting homing using the regular process and work very fine.
For orient (without c axis) i have do something in my revised code allowing to home spindle automatically after chosen axis is homed or before first velocity start or before first M19 move.
The code take care to home allways with same speed and direction for "i think" better accuracy, but maybe is useless to take care of this.
Br
About homing spindle, imo using C axis allow to use built in hal pin for starting homing using the regular process and work very fine.
For orient (without c axis) i have do something in my revised code allowing to home spindle automatically after chosen axis is homed or before first velocity start or before first M19 move.
The code take care to home allways with same speed and direction for "i think" better accuracy, but maybe is useless to take care of this.
Br
Please Log in or Create an account to join the conversation.
05 Nov 2021 03:10 #225340
by Michael
Replied by Michael on topic M19 and spindle-index-enable issues
Sorry to bring back a few month old thread but I was just tossing around this idea for my current build.
Basically the spindle needs to do a full rotation at start up before an M19 will work correctly. Seen quite a lot of ways to tackle this issue. But two seemed to be the easiest to implement.
1. Typically for orient the spindle gets a sperate position loop. If this loop was setup as a C axis could it be included in the homing sequence? What would be the pitfall of doing it that way?
2. Since I have to do a remap of the toolchange procedure anyway can my first lines of the NGC code for it be:
o<toolchange> sub
M3 S200
G4 P1
M19 R0 Q10 P0 ; align the spindle
Basically the spindle needs to do a full rotation at start up before an M19 will work correctly. Seen quite a lot of ways to tackle this issue. But two seemed to be the easiest to implement.
1. Typically for orient the spindle gets a sperate position loop. If this loop was setup as a C axis could it be included in the homing sequence? What would be the pitfall of doing it that way?
2. Since I have to do a remap of the toolchange procedure anyway can my first lines of the NGC code for it be:
o<toolchange> sub
M3 S200
G4 P1
M19 R0 Q10 P0 ; align the spindle
Please Log in or Create an account to join the conversation.
05 Nov 2021 15:27 #225404
by andypugh
Replied by andypugh on topic M19 and spindle-index-enable issues
Yes, that G-code should work.
You could set a G-code parameter the first time through so that it does not do it every time too.
You could set a G-code parameter the first time through so that it does not do it every time too.
Please Log in or Create an account to join the conversation.
05 Nov 2021 16:09 - 05 Nov 2021 16:44 #225407
by Michael
Replied by Michael on topic M19 and spindle-index-enable issues
That's an interesting idea. But I can't wrap my mind around how to just do it the first time.
Last edit: 05 Nov 2021 16:44 by Michael.
Please Log in or Create an account to join the conversation.
05 Nov 2021 16:40 #225410
by andypugh
(Untested, I am on a train)
Replied by andypugh on topic M19 and spindle-index-enable issues
O100 IF [#5000 EQ 0]
M2 S100
G4 P2
#5000 = 10
O100 ENDIIF
(Untested, I am on a train)
The following user(s) said Thank You: Michael
Please Log in or Create an account to join the conversation.
11 Nov 2021 08:33 #226079
by nkp
Replied by nkp on topic M19 and spindle-index-enable issues
Can do something like homing the spindle when turning on the machine? (By running the spindle for a few seconds).
And to control whether the index mark is found after that - if it is not found - an error!
And to control whether the index mark is found after that - if it is not found - an error!
Please Log in or Create an account to join the conversation.
11 Nov 2021 15:57 #226113
by andypugh
Replied by andypugh on topic M19 and spindle-index-enable issues
I intend to add spindles to the homing sequence. In fact the whole multi-spindle change was mainly in preparation for that.
I just haven't done it yet.
I just haven't done it yet.
Please Log in or Create an account to join the conversation.
11 Nov 2021 16:14 - 11 Nov 2021 16:16 #226116
by spumco
Replied by spumco on topic M19 and spindle-index-enable issues
O100 IF [#5000 EQ 0] M2 S100 G4 P2 #5000 = 10 O100 ENDIIF (Untested, I am on a train)
M3 might be better than M2 in this case;)
Last edit: 11 Nov 2021 16:16 by spumco. Reason: formatting
Please Log in or Create an account to join the conversation.
Time to create page: 0.144 seconds