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.

Time to create page: 0.072 seconds
Powered by Kunena Forum