Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: mediumSasuage on February 17, 2023, 02:48:18 AM
-
Hi,
I am trying to make some closed loop control of my process with Mach4. Basically, it will involve collecting an image, some decision making (preferably in python) based on the image and some geometric data, and then Mach4 should do one of two options based on the decision.
Does any body have any experience with something similar to this? Do you think it can work?
I suppose I would use an analogue input signal from the python script to instruct Mach4 what to do next?
In future, it may be useful to carry additional data across back into Mach4, is it possible to pass across a string or CSV or something as an input?
Thanks in advance for any ideas! :)
-
Are you trying to cut things using fiducials?
-
Hi,
I rather think that mach4 can do what you require, its all about timing.
When most people talk about 'closed loop' they think of Mach trying to maitain angular position control over the shaft of a motor.
Windows is not a realtime operating system and therefore Mach4 is a bufferd control which precludes from the microsecond timining that
such a closed loop requires.
If however you are talking about Mach4 being stopped while an image is collected, and then execute certain actions as a result of processing that image, then yes
it could do so.
May I suggest you write your Python program to collect the image data and output a signal (digital), or signals (binary), or even analog if you have an analog capable
motion control to Mach. Having Mach execute certain chunks of code based on an iput should be no trouble.
Craig
-
we make many similar function like that ,for example we connect the driver to get absolute position by external c# app
actually what should happened as i understand yours needed ,is that the image + decissi0n will be done on yours external app
and then yours app will generate the gcode and run the mach according the results
what i try to say you should look at mach yours executer while all yours toolpath and design will be external
mach have good Api and can do it very easy
only one point i didn't solve
when you force mac load nc file its take time to mach to load and generate ,there is no any way to get from mach signal that its finish and can run
after long try ( mach help didnt help) only way i found is deley amount of time constant time+ time according file length
but mach its real powerful for this Api
-
Hi All, thanks very much for your inputs.