Hello Guest it is November 27, 2022, 07:16:55 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - pjcevallos@gmail.com

Pages: 1
1
Mach4 General Discussion / Read Register from a text file
« on: August 08, 2022, 06:51:35 PM »
Hi

Is it possible to read registers or variables from a text file using Lua scripts?

The idea is to overwrite the text file when needed while a gcode is running, and therefore change the registers/variables in the process but from the text file.

Hope you can help me

Pablo

2
Hi

Is there any way to enable an output when a specific axis is running?

For example for the X axis

G21 G90 X10 Y10 (output is enable)
G21 G90 Y15 (output is disable)

kind regards

Pablo


3
Hi

We need a piece of advice to see if an automated defect detection and correction program can run in Mach4. For example, our current gcode program has different sections such as:
Section 1 – Gcode blocks (lines 1-10)
Section 2 – Gcode blocks (lines 11-20)
Section 3 - Gcode blocks (lines 21-30)
Etc.

Defect Scanning
To implement the defect detection, we can easily insert a block that activates and output (M64 p#) and waits a specific time to do a scanning (G4 P#). It is just moving the piece below the camera and scanning. Easy. The new program should be written as:
Section 1 – Gcode blocks (lines 1-11)
Subsection 1 – gcode block for defect detection
Section 2 – Gcode blocks (lines 12-21)
Subsection 1 – gcode block for defect detection
Section 3 - Gcode blocks (lines 22-32)
   Subsection 1 – gcode block for defect detection
Etc.

Defect detection and correction
Then, the post-processing of the image will be done in another software (python, Matlab, etc). It will detect if there is an error, and here is our problem, How do we inform Mach4 there is an error and how to correct it.
Problem 1. How do we inform mach4 there is an error? 
I think it will be easy to write on the signal script to actively search for a digital input to STOP the program. This is something similar than having a limit switch. We are using soft limits because we have absolute encoders, and the systems works perfectly with that. Can we use a limit axis input if the soft limits are active? I think this would be the fastest solution. However, if a limit switch is activated, it disables mach4 rather than stopping the program, and restart the program from a different gcode line, which is the stated in the problem 2.

Problem 2. How to correct the defect.

Our strategy to correct the defect is “simple” as we only need to Re-Start the gcode program in a previous section decided by the external software. We can do it manually once we see the software indicates an error, but the idea is to automate it and eliminate human interaction. In the following program, the first phase corresponds to “defect detection and stopping the program”, and the second phase correspond to start the program in a previous fcode line commanded by the software as shown below:
(First phase: defect detection)
Section 1 – Gcode blocks (lines 1-11)
Subsection 1 – gcode block for defect detection
Section 2 – Gcode blocks (lines 12-21)
Subsection 1 – gcode block for defect detection
Section 3 - Gcode blocks (lines 22-32)
   Subsection 1 – gcode block for defect detection
(-comment: defect detected, digital input is activaded, program is stopped)
Section 4 - Gcode blocks (lines 33-42)
   Subsection 1 – gcode block for defect detection
Etc

(second phase: defect detection)
Section 1 – Gcode blocks (lines 1-11)
Subsection 1 – gcode block for defect detection
Section 2 – Gcode blocks (lines 12-21) – New start of the program
Subsection 1 – gcode block for defect detection
Section 3 - Gcode blocks (lines 22-32)
   Subsection 1 – gcode block for defect detection
Section 4 - Gcode blocks (lines 33-42)
   Subsection 1 – gcode block for defect detection
Etc

The question here is how we can tell mach4 to start the program at a specific line? Which communication to use? We are using an EtherCAT controller with several several GPIO, also we can have analog inputs and outputs. Maybe, there is another type of communication to inform mach4 which line to start in the program. I believe it shouldn’t be something that complicated, but not sure if mach4 can do it.

The second option is if the loading and running of a gcode program can be automated. Python, Matlab, etc then will chop the original program and upload the new one. is it possible?

What thoughts do you have? is it possible?

Kind regards


Pablo

4
Mach4 General Discussion / How to set up analog outputs in Mach4?
« on: February 07, 2022, 11:22:16 AM »
Hi everyone

The control tab in Mach4 allows using analog outputs, DIFFERENT from the analog output that controls the spindle. I have extra analog outputs 0-10V that I need to use to control other equipment.

Does anybody have experience setting them up, and then how to activate it and control it in Mach4?
Do I need to create a macro?

I am a newbie in Mach4 so any guidance is appreciated.

Best wishes

Pablo

Pages: 1