M19 and spindle-index-enable issues

More
5 years 4 months ago - 5 years 4 months ago #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:5.55 KB
Last edit: 5 years 4 months ago by MaxP. Reason: attach config

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

More
5 years 4 months ago #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
5 years 4 months ago #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
4 years 11 months ago #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
4 years 11 months ago #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
4 years 11 months ago - 4 years 11 months ago #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: 4 years 11 months ago by Michael.

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

Time to create page: 0.235 seconds
Powered by Kunena Forum