Spindle synchronized motion with Mesa 7i96s

More
06 Mar 2024 05:06 - 06 Mar 2024 05:07 #295292 by carson
I've seen a bunch of issues with getting spindle synchronized motion to work on this forum but have not encountered any solutions that work for me yet.
I'm using a Mesa 7i96s and I configured my HAL file using pncconf (also added an additional custom hal file for my mpg).
When I try a G33, I get the error "Spindle not turning in G33"
and when I try G76, I get "Chosen spindle (0) not turning in G76"
I've confirmed that spindle.0.revs is counting upwards (I did have to change the sign of the encoder scale in the ini file.  It's not a quadrature encoder, just using phase A, not phase B ) and hm2_7i96s.0.encoder.00.index-enable goes from True to False when the spindle first passes the index of the encoder.  spindle.0.at-speed seems to always be true.

What else might I be missing?
The G code manual for g76 and g33 mention "The pins motion.spindle-at-speed and the encoder.n.phase-Z for the spindle must be connected in your HAL file".  I don't see either of these pins in the pncconf generated hal file and hm2_7i96s.0.encoder.00 doesn't seem to have a phase-Z pin.

Thanks for any help,
Carson
Attachments:
Last edit: 06 Mar 2024 05:07 by carson.
The following user(s) said Thank You: Sergiy_J_S_Automatic

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

More
06 Mar 2024 15:31 #295331 by andypugh
Replied by andypugh on topic Spindle synchronized motion with Mesa 7i96s

The G code manual for g76 and g33 mention "The pins motion.spindle-at-speed and the encoder.n.phase-Z for the spindle must be connected in your HAL file".  I don't see either of these pins

The spindle feedback pins changed from motion.spindle-XXXX to spindle.0.XXXX when multiple spindle support was added. 
(If you look at the latest docs, this change has been made) linuxcnc.org/docs/stable/html/gcode/g-code.html#gcode:g76

encoder.N.XXX will not exist if you are using a Mesa encoder rather than a software/HAL encoder. 

I assume you have the encoder pulse wired to both the phase-A and phase-Z hardware pins on the Mesa card? 

Is the encoder set to counter-mode? 

It is possible that the system believes that the spindle speed is too high to performt the threading pass.

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

More
06 Mar 2024 16:13 #295332 by PCW
The hal and ini file look OK

Did you verify that the spindle position increments by 1 for each turn?

What RPM are you running the spindle?

Does the RPM value from the encoder match?

I would not expect this to matter since spindle-at-speed is forced true,
but crazy numbers might make the spindle-synch motion controller
give up

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

More
06 Mar 2024 21:56 #295354 by carson
Replied by carson on topic Spindle synchronized motion with Mesa 7i96s

I assume you have the encoder pulse wired to both the phase-A and phase-Z hardware pins on the Mesa card? 

Is the encoder set to counter-mode? 

It is possible that the system believes that the spindle speed is too high to performt the threading pass.

The encoder pulse is just wired to the phase-A pin on the mesa card.  There is no phase-Z, just phase-A and phase-B.  The index pulse is wired to the index pin on the mesa card.

Yes, the encoder is set to counter-mode.

The spindle is not being controlled by Linuxcnc, it's just an AC motor with a pulley.  I'm running at ~500 rpm (which is the lowest speed).  I've done threading (g76) with this setup before using linuxcnc and a parallel port.  This is my first attempt now that I've upgraded to the mesa ethernet board.

Did you verify that the spindle position increments by 1 for each turn?

What RPM are you running the spindle?

Does the RPM value from the encoder match?

Yes, when I watch hm2_7i96s.0.encoder.00.position, it increases by 1 every revolution
When I watch spindle.0.speed-in with the motor running it reads ~9.6 rps ~570 rpm which is about what I expect.

Let me know if you have other suggestions/things to check.  Thanks for your help!

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

More
06 Mar 2024 22:04 #295355 by carson
Replied by carson on topic Spindle synchronized motion with Mesa 7i96s
I guess the encoder "phase-Z" is the same as the index.  My home-built encoder has a 60 pulse per revolution output that I have wired to the phase-A pin on the mesa board and a 1 pulse per revolution output that I have wired to the index (or phase-Z?) pin on the mesa board.

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

More
06 Mar 2024 22:12 #295356 by carson
Replied by carson on topic Spindle synchronized motion with Mesa 7i96s
I also don't understand why I immediately get the "spindle not turning" error when executing a g33 or g76.  I seem to remember that previously (with my old parallel port setup) I could execute these commands with the motor stopped, then Linuxcnc would just wait, and then I could manually move the spindle to start the cut.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
06 Mar 2024 22:32 #295358 by tommylight
Replied by tommylight on topic Spindle synchronized motion with Mesa 7i96s

I guess the encoder "phase-Z" is the same as the index. 

Yes.

I also don't understand why I immediately get the "spindle not turning" error when executing a g33 or g76. 

Did you try adding - in front of scale value in the ini file, or using "calibration" from the "machine" menu?

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

More
06 Mar 2024 22:42 - 07 Mar 2024 00:16 #295360 by PCW
Do you have a M3SXXX or M4SXXX command in your gcode?

Because you will get "Chosen spindle(0)  not turning in GXX"
error if not...
Last edit: 07 Mar 2024 00:16 by PCW.

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

More
07 Mar 2024 20:21 #295427 by carson
Replied by carson on topic Spindle synchronized motion with Mesa 7i96s
Oh wow, yeah, I forgot to put in the m3sxxx gcode before the g76. 
Thanks for your help guys!  Sorry for the silly mistake
The following user(s) said Thank You: tommylight

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

More
07 Mar 2024 21:15 #295429 by PCW
No problem, It looked like all the low level stuff was right so gcode
was the next thing to look at.
The following user(s) said Thank You: tommylight

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

Moderators: piasdom
Time to create page: 0.098 seconds
Powered by Kunena Forum