M19 and spindle-index-enable issues

More
09 Jun 2021 14:49 - 09 Jun 2021 15:21 #211623 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.

File Attachment:

File Name: hal_ini.tar.gz
File Size:6 KB
Attachments:
Last edit: 09 Jun 2021 15:21 by MaxP. Reason: attach config

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

More
10 Jun 2021 10:43 #211685 by andypugh
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.

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

More
10 Jun 2021 12:41 #211693 by alkabal
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

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

More
05 Nov 2021 03:10 #225340 by Michael
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

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

More
05 Nov 2021 15:27 #225404 by andypugh
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.

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

More
05 Nov 2021 16:09 - 05 Nov 2021 16:44 #225407 by Michael
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.

More
05 Nov 2021 16:40 #225410 by andypugh
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.

More
11 Nov 2021 08:33 #226079 by nkp
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!

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

More
11 Nov 2021 15:57 #226113 by andypugh
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.
The following user(s) said Thank You: nkp, 0x2102, Michael

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

More
11 Nov 2021 16:14 - 11 Nov 2021 16:16 #226116 by spumco

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.107 seconds
Powered by Kunena Forum