M19 spindle orient
Anybody to has HAL or INI files?
LinuxCNC samples ar at no help.
Thank You in advance!
but I do not find how to set a speed (RPM or RPS ) 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)
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.
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.
File Attachment:File Name: orientate1...13-3.pdf
File Size:37 KB
Here is the orient schematic with hardware encoder only. Seems to work ok.