I found a workaround; It's possible to read HAL pins from g-code. The
problem is they don't necessarily update after the program is started. But
according to the manual, a state sync command--M66E0L0-- forces it to
update. The problem is that this stops the motion, and now instead of a
non-stop scan, I have a stop-go at each point. I still get around 4
readings per second so it would be workable, just not ideal.
Configuration section)
G20 (Inches)
F10 (probe speed)
#4=-1 (Y start)
#5=.01 (Y increment)
#6=101 (Y count)
(End configuration section)
(LOGOPEN,profile-results.ngc)
#9=0 #10=0
G0Z#7
(file preamble)
(LOG,G20)
(LOG,G64 P0.002)
(LOG,F30)
O1 while [#9 lt #6]
G1 Y[#4+#5*#9]
(LOG, G1 X#<_hal[z-pos-fb]>Y#<_Y> )
M66E0L0
#9=[#9+1]
O1 endwhile
(LOG,G0X0Y0)
(LOG,M2)
(LOGCLOSE)
G0Y#4
M2
On Fri, Feb 25, 2022 at 10:33 PM Thaddeus Waldner <[email protected]>
wrote:
>
>> I am not sure what the built-in parameters such as #<_Z> show in this
>> situation. I would suspect that it is commanded position but it's not
>> hard to find out.
>>
>
> I just ran the following gcode:
>
> (Configuration section)
> G20 (Inches)
> F2 (probe speed)
>
> #4=-1 (Y start)
> #5=.04 (Y increment)
> #6=51 (Y count)
>
> (End configuration section)
>
> (LOGOPEN,profile-results.ngc)
> #9=0
>
> O1 while [#9 lt #6]
> G0 Y[#4+#5*#9]
> (LOG, G1 #<_Y>, #<_Z>)
> #9=[#9+1]
> O1 endwhile
>
> (LOGCLOSE)
> G0Y#4
> M2
>
> I manually moved the z encoder while this was happening.
> It produces a log file as expected, bu all the z-values are zero.
> some more testing with (DEBUG, #<_Z>) showed that #<_Z> stays zero until
> it is changed by motion. For example, using the jog keys will change it.
>
> Anything else I can try?
>
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users