M19 spindle orient

More
11 Jan 2018 16:44 #104295 by dinkata
M19 spindle orient was created by dinkata
Configuration 5i25 and 7i77 for X Y Z A and spindle control. What is the right way to configure the controls so M19 command could be executed? Spindle has 2048 pulses differential encoder.
Anybody to has HAL or INI files?
LinuxCNC samples ar at no help.

Thank You in advance!

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

More
11 Jan 2018 20:35 #104310 by raglanlittlejohn
Replied by raglanlittlejohn on topic M19 spindle orient

Here is a jpg of a schematic I've done, to try and get orient working. It seems to work, but I expect it could be simplified, I'm still working on it. I'm using a Mesa 7i85S for the spindle encoder, linked to two software encoders.
Attachments:
The following user(s) said Thank You: tivoi, dinkata

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

More
11 Jan 2018 22:27 #104312 by Todd Zuercher
Replied by Todd Zuercher on topic M19 spindle orient
Why would you use a software encoder if you have a 7i85s?

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

More
12 Jan 2018 02:53 - 12 Jan 2018 03:19 #104328 by dinkata
Replied by dinkata on topic M19 spindle orient
raglanlittlejohn thanks , but I would like to do it with with standard components for M19 :

M19 Orient Spindle
M19 R- Q- [P-]
R Position to rotate to from 0, valid range is 0-360 degrees
Q Number of seconds to wait until orient completes. If motion.spindle.is_oriented does not become true within Q timeout an error occurs.
P Direction to rotate to position.
0 rotate for smallest angular movement (default)
1 always rotate clockwise (same as M3 direction)
2 always rotate counterclockwise (same as M4 direction)
M19 is cleared by any of M3,M4,M5.
Spindle orientation requires a quadrature encoder with an index to sense the spindle shaft position and direction of rotation.
INI Settings in the [RS274NGC] section.
ORIENT_OFFSET = 0-360 (fixed offset in degrees added to M19 R word)
HAL Pins
motion.spindle-orient-angle (out float) Desired spindle orientation for M19. Value of the M19 R word parameter plus the value of the [RS274NGC]ORIENT_OFFSET ini parameter.
motion.spindle-orient-mode (out s32) Desired spindle rotation mode. Reflects M19 P parameter word, Default = 0
motion.spindle-orient (out bit) Indicates start of spindle orient cycle. Set by M19. Cleared by any of M3,M4,M5. If spindle-orient-fault is not zero during spindle-orient true, the M19 command fails with an error message.
motion.spindle-is-oriented (in bit) Acknowledge pin for spindle-orient. Completes orient cycle. If spindle-orient was true when spindle-is-oriented was asserted, the spindle-orient pin is cleared and the spindle-locked pin is asserted. Also, the spindle-brake pin is asserted.
motion.spindle-orient-fault (in s32) Fault code input for orient cycle. Any value other than zero will cause the orient cycle to abort.
motion.spindle-locked (out bit) Spindle orient complete pin. Cleared by any of M3,M4,M5.

but I do not find how to set a speed (RPM or RPS ) for M19
Last edit: 12 Jan 2018 03:19 by dinkata.

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

More
12 Jan 2018 07:06 #104331 by raglanlittlejohn
Replied by raglanlittlejohn on topic M19 spindle orient
Todd, I used the software encoders to get two position values, 0 to 1 per rev, and 0 to 360 per rev. this was the only way I could get orient working.

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

More
12 Jan 2018 14:36 #104335 by Todd Zuercher
Replied by Todd Zuercher on topic M19 spindle orient
Why not set the encoder scale for the hardware encoder counter for your 360 degrees, then use a scale component on the position output by encoder counter to get your per rev number?

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

More
12 Jan 2018 16:23 #104340 by raglanlittlejohn
Replied by raglanlittlejohn on topic M19 spindle orient
Todd Wrote:-
Why not set the encoder scale for the hardware encoder counter for your 360 degrees, then use a scale component on the position output by encoder counter to get your per rev number?

I thought it would be easier to leave the hardware encoder alone for speed measurement, then use separate software encoders for the orient part. I found it very difficult to understand the orient process. Finding the correct float to connect to the orient pins took ages.
I can see a scale component would be better for getting the rev number.
Would using a software encoder cause any problems?. The orient process would be very slow compared to spindle speed counting, so the software encoder should be fast enough.

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

More
12 Jan 2018 16:49 #104343 by Todd Zuercher
Replied by Todd Zuercher on topic M19 spindle orient
There is absolutely no reason (or advantage) to using multiple software encoder counters to read a single encoder. The hardware encoder has both position and velocity outputs, and those outputs values can be sent to multiple inputs and the hardware encoder can reliably count pulses many, many, many times faster and more reliably than can the software encoder (which would have to read pulses in the servo-thread.)

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

More
12 Jan 2018 22:31 #104368 by raglanlittlejohn
Replied by raglanlittlejohn on topic M19 spindle orient
Thanks for the explanation. I've re drawn the schematic for a hardware encoder only, it looks much tidier. The only complication I can see is I will need to turn off the encoder reset when not using orient, but I've found a way to do that.

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

More
13 Jan 2018 18:58 #104393 by raglanlittlejohn
Replied by raglanlittlejohn on topic M19 spindle orient

This browser does not support PDFs. Please download the PDF to view it: Download PDF


Here is the orient schematic with hardware encoder only. Seems to work ok.
Attachments:
The following user(s) said Thank You: dinkata, yeltrow

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

Time to create page: 0.102 seconds
Powered by Kunena Forum