Hello Guest it is April 29, 2024, 09:55:30 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 - mediumSasuage

Pages: 1
1
Mach4 General Discussion / Load Gcode File not working in macro
« on: April 08, 2024, 09:11:05 AM »
Hi All,

I am trying to make a macro that allows me to dynamically edit GCODE. To do this, I am going to edit the GCODE in python and save the file to a directory, then reload it into Mach4 using a macro. I have written a test macro for the load GCODE part:

Quote
function m313()   --load gcode file
   
   local inst = mc.mcGetInstance() -- get mach4 instance
   mc.mcCntlCloseGCodeFile(inst)
   wx.wxMessageBox('Closed GCODE')
   
   local NextFileParen = "(C:\\Mach4Industrial\\Profiles\\CHAMP\\GCODE\\GCODEtoLoad.txt)"
   --wx.wxMessageBox(NextFileParen)
   
   local NextFile = string.gsub(NextFileParen, "[()%c%s]", "")
   wx.wxMessageBox('next file\n'..NextFile)
   
   wx.wxSleep(1) --gives Mach a second to do its thing
   
   mc.mcCntlLoadGcodeFile(inst, NextFile)
   
   wx.wxSleep(5) --gives Mach a second to do its thing
   
   mc.mcCntlCycleStart(inst)
         
end


if (mc.mcInEditor() == 1) then
   --dofile ("load_modules.mcs")
   m313()
end

When I run this macro within the ZeroBrane debugging tool, it appears to work fine. However, when I run it by calling the macro in gcode, it runs to end but does not actually load the GCODE. Anyone got any ideas why this may be/ any hints towards a solution?

Many thanks,
Dan

2
General Mach Discussion / Issue when using G92
« on: October 26, 2023, 06:35:47 AM »
Hey all,

I am running mach4 on a hybrid research platform. We use the A and B axes as extrusion axes. At the start of our GCODE we use G92 A0\nG92 B0 to reset the axis positions to 0 so that the extrusion starts properly. However, sometimes we experience an issue where instead of resetting to 0 it resets the position to some large negative number, causing the extruder to try and force through an excess of material, causing the print to fail.

Does anyone have any ideas why this may be occurring? Or a better/alternative method to reset the axis position to 0 would be appreciated.

Many thanks,
Dan

3
Mach4 General Discussion / Set GCODE Line using Lua scripting
« on: August 23, 2023, 10:04:47 AM »
Hi All,

I am trying to use a macro to move to a specific line within the GCODE. To do so I am trying to use the command

mc.mcCntlSetGcodeLineNbr(inst, GcodeLineNew)

However, this does not seem to run and I can't figure out why. My wonder is whether it is actually supported in LUA because in the API it has a C/C++ example only whereas most other commands have an example for C/C++ and LUA.

Does anyone know anything about this or even know of a better way to skip through GCODE to a specific line.

Many thanks

4
General Mach Discussion / Closed loop steppers = problem?
« on: August 02, 2023, 06:11:00 AM »
Hello,

I am currently using closed loop oriental motors and drivers on my CNC machine. It has been having troubles with accuracy. Recently I checked the distance travelled vs the distance commanded and it was out by 3.15 mm over 240 mm. I used the wizard and recalibrated the counts/unit. Then, it was still out by 3.15 mm over 240 mm (also out by 1.575 mm over 120 mm so I know that it scales.)

Basically, I heard that using closed loop motors can cause similar problems and wondered if anyone has experienced something similar?

Also if I was to disable the encoders, will that cause further problems? EDIT: is it even possible to disable the encoders?

Many thanks,
Dan

5
Mach4 General Discussion / Noise with OB axis
« on: March 23, 2023, 07:15:34 AM »
Hi All,

We are running MACH4 on a custom machine. We have a ceramic extrusion axis with two motors, one for a plunger and one for an auger screw extruder. The plunger is a CNC axis (axis A) and the screw extruder is an out of band axis (OB1). We have been experiencing a fair amount noise/vibration, especially during circular movements.
After much experimentation I have realised that the vibration occurs when the OB1 axis is enabled but does not occur when the OB1 axis is disabled.
Does anyone have any experience with OB axes and have any idea why this might be occurring?

Alternatively, I suppose I could change the screw extruder from a stepper to a DC motor with ESC, since it is effectively running as a spindle and positional accuracy is not important, but I would rather not have to mess around with the hardware.

Thanks for any help  :)

6
Mach4 General Discussion / Change State of Soft limit Button
« on: February 22, 2023, 12:19:47 PM »
Hi all,

So my current set up has the tool holder outside of the soft limits. I turn the limits off to complete the tool change and turn them back on again at the end of the tool change. Ideally, I would like to update the state of the SoftLim button on the home screen along side this switching as a visual aid. I think one way to do this would be to use mc.SoftLimGetState in the PLC and update the state of the button based on this value. However, I'm not sure of the button's handle?

Any ideas/suggestions would be much appreciated.

Cheers

7
Mach4 General Discussion / Closed Loop Monitoring of Mach4?
« 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!  :)

Pages: 1