Machsupport Forum
Mach Discussion => Brains Development => Topic started by: corydoras on January 14, 2020, 05:55:52 AM
-
In a custom screenset I am using a compare function of an OEM DRO and an axis DRO to set a OEM LED to green if the axis has moved to the correct position (same as the OEM DRo). This is working in most cases, BUT; Sometimes the positioning is just a little off maybe 1/1000 mm. This does not matter , but as this is not an excact equal value in the compare, the led does not turn green. I have good resolution in the motor tuning with approg 600 steps/mm (no deciaml after comma) , so I am not sure why it sometimes calculates off.
My question is; Are there any way of writing a formula in a brain that says something like this; (A = B +/-0.250) ( I know this is not mathematically correct, but hopefully gets the explanation up front)
In PLC programming it is possible to write a compare block like this: Variable1 < Variable2 + 0.025 AND Variable1 > Variable2 - 0.025 -----> Output
Or, could Mach3 be set up to use lesser digits? ( I think I have read somwhere that there are actually lots more digits in the code of the program, but not more than 4 after comma is shown in the DRO.
Any good suggestion on how to solve this issue is greately appreciated
Best regards
Roy
-
here is a small sample
added 0.125 to dro(1300) and stored it in dro(1301)
subtracted 0.125 from dro(1300) and stored it in dro(1302)
then compared both with x-axis dro and result is Led(1300)
not tested just written down
-
Thanks a lot Thomas
That is PLC code alright:)
I will try this out.
BTW, the saw build is coming along well, and phase 2 of the build will include yur genious fingerjoint jig:)
Thanks again
Best reg
Roy
-
Hi Thomas.
The brain worked just as intended. Thank you very much Sir, and have a great afternoon
Best reg
Roy