Hello Guest it is March 28, 2024, 07:25:35 PM

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 - beezerlm

Pages: 1 2 »
1
Mach4 General Discussion / Mcode Macro works in program but not MDI?
« on: March 26, 2020, 04:57:11 PM »
I have a macro M100 that I use to control a grinding cycle.  It checks the user input and outfeeds a grinding wheel until the total grind amount is reached.  If I make a program:

Code: [Select]
M100
M30

The macro program runs fine.  But if I just call M100 from MDI, the macro starts but never outfeeds the wheel. The wheel outfeed is done in the plc loop like this:

Code: [Select]
local g_code = ""
g_code = g_code ..string.format("G0 G91 A%.4f\n",cut_amount)
mc.mcCntlGcodeExecute(inst, g_code)

The macro and plc loop both read from and write to Gregister values for this cycle to work.  This used to work properly in a much older version of Mach4. Currently running version 4300

Can anyone give me an idea as to what would cause differing behavior like this?  I would expect M100 to do the exact same thing running in MDI or as a Gcode program?

2
Mach4 General Discussion / Problems - Win10 update + PMDX_424 + LUA
« on: February 07, 2020, 09:55:08 AM »
Over Xmas break I decided to update windows on all my computers.  After updating windows, I got a new error when trying to home my machine:

Code: [Select]
PMDX-SmartBOB-USB X-axis homing error, missing or invalid home switch configuration PMDX-SmartBOB-USB Y-axis homing error, missing or invalid home switch configuration
I contacted Steve at PMDX and was advised to update PMDX plugin/firmware along with Mach4.  Now I get this message when starting Mach4:

Null_Value_Error.jpg


This appears to be in regards to my PLC script used to display a DRO from PMDX424 Encoder input:

Code: [Select]
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, "SmartBOBUSB/EncoderDRO")
local zEncoderVal = mc.mcRegGetValueString(hreg)
local zEncoderVal = tonumber(zEncoderVal)
local zEncoderValInches = (zEncoderVal * 0.0004)
WriteRegister("Z_DRO_INCH", tostring(zEncoderValInches))

The SmartBOBUSB/EncoderDRO register value is now null.  If I look at the real time diagnostics for the PMDX424, it shows the encoder input as "Disabled":

RT.jpg



If I look at the Register diagnostics, the value for SmartBOBUSB/EncoderDRO is blank and it will not accept a manually entered value:

Register_Diagnostics.jpg


I can tell it's reading the encoder because the log shows signal 11 and 12 alternating to Hi/Low as it should for channel A/B of the encoder.

I have made no changes to configurations, profile or scripts for 3 years.  All I wanted to do was update windows and now I have had a machine down for over a month  :-\  Any ideas what changed to cause these issues?

Mach4 Build#: 4300
PMDX Plugin Version: 0.53.263
PMDX Bootloader Version: 1.9.66
PMDX Firmware Version: 0.60.208
Windows 10 Pro Version: 1909, OS build 18363.535

3
Mach4 General Discussion / Rename A axis to U axis?
« on: September 29, 2016, 01:04:00 PM »
There is probably something simple I am missing here, but I would like to rename the "A axis" to "U axis" throughout the system.  Is there a simple way to change the letter of an axis in Mach 4?

4
Mach4 General Discussion / Macro - Pause until input triggered
« on: September 26, 2016, 08:14:44 PM »
Is there a simple way to pause motion until an input is triggered within a macro? 

I would like to ensure my Z axis returns home before the macro ends because after the macro would be an X-Y move. This is a cylinder where I have output 1 activate the "up" direction and output 0 activate the "down" direction. 

Something like this:

1. activate output_1 (up)
2. wait for Z home switch to trigger
3. end macro.

What is the best way to code step 2 (wait for input) in a Macro?

5
Mach4 General Discussion / PLC Script troubleshooting
« on: September 10, 2016, 09:37:26 AM »
I have a Moore Jig grinding machine that has a reciprocating pneumatic Z-axis.  It has a glass scale on the axis that is hooked to my motion controler (PMDX-424).  I have a PLC script set up so the user can specify an upper and lower limit on the stroke and the solenoid will change direction once one of the limits are reached.  My problem is that sometimes the machine will only perform a partial stroke on the way down changing direction well before it reaches the lower limit.  It never does this on the way up.  Perhaps there is an issue with my code?

Here is a link to a quick video showing a half stroke on about the 3rd or 4th stroke:

https://youtu.be/L82Gi7fmf28

Here is the code I am using in the PLC script:

Code: [Select]

--My Z axis DRO to inches script starts here:

local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, "SmartBOBUSB/EncoderDRO") --get encoder input handle
local zEncoderVal = mc.mcRegGetValueString(hreg)
local zEncoderVal = tonumber(zEncoderVal) --convert input to number for math
local zEncoderVal = (zEncoderVal * 0.0004) --convert input from encoder counts to inches
WriteRegister("Z_DRO_INCH", tostring(zEncoderVal)) --write the result to the Z axis DRO

--My Z axis DRO to inches script ENDS here:

--My Z axis stroke monitor script Starts here:

local zStrokeUp = GetRegister("Z_STROKE_UP")
local zStrokeDown = GetRegister("Z_STROKE_DOWN")
local zStrokeUp = tonumber(zStrokeUp)
local zStrokeDown = tonumber(zStrokeDown)
local output_0 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0) -- Get handle for output 0
local output_1 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1) -- Get handle for output 1
local output_0_state = mc.mcSignalGetState(output_0) --Get state of  signal
local output_1_state = mc.mcSignalGetState(output_1) --Get state of  signal

if  zEncoderVal >= zStrokeUp then
    mc.mcSignalSetState(output_0, 1)
elseif zEncoderVal > zStrokeDown and zEncoderVal < zStrokeUp and output_0_state == 1 then
    mc.mcSignalSetState(output_0, 0)
elseif zEncoderVal > zStrokeDown and zEncoderVal < zStrokeUp and output_1_state == 1 then
    mc.mcSignalSetState(output_1, 0)
elseif zEncoderVal <= zStrokeDown then
    mc.mcSignalSetState(output_1, 1)
end

--My Z axis stroke monitor script Ends here:





6
Long time user of Mach3 but new to Mach4.  I keep seeing references to the Mach4 "Customization Manual" in the Operators and Scripting manuals.  Where can I find this? ???

7
Mach4 General Discussion / Controling pneumatic Z-axis?
« on: May 02, 2016, 11:54:09 AM »
I am in the process of re-retrofitting a Jig grinding machine I did a long time ago.  The machine is sort of a hybrid between the old control and Mach3.  Mach3 controls the X,Y and U (wheel outfeed) Axis.  The old control still handles the Z axis which is pneumatically driven with glass scale feedback.  I would like to take control of the Z in Mach.  This axis does not need to be precision controlled, I just need to be able to set and upper and lower limit so the Z axis will reciprocate between those limits.  I have done something similar in LinuxCNC using a Moog hydraulic servo valve with glass scale feedback to control the position of a hydraulic cylinder, but I have not done this in Mach3 or Mach4.

I am thinking I should take control of the relays that operate the pneumatic solenoid and use a script to monitor the position of the axis.  Once the position hits the upper or lower limit it would activate the relay to change direction.  Does this sound feasible? Is there a better way to do this?

8
General Mach Discussion / Jogging x1 x10 x100 instead of velocity
« on: February 11, 2008, 10:29:13 PM »
Hello,
    Trying to Jog with cnc4pc mpg-2 hooked up to lpt2. It moves all axis but I cannot adjust the increment it moves per click of the mpg. x1 x10 x100 are all the same amount no matter what I do.  Seems like I am stuck in velocity mode or something.

Any Ideas? ???

9
General Mach Discussion / VERY SIMPLE STUPID QUESTION.
« on: December 17, 2007, 07:37:22 PM »
Is there a difference between a parallel cable and a serial cable. I always thought the serial crossed over 2 and 3 pins and parallel kept them in line?

Also, should I use a parallel cable from Lpt1 to Breakout board? :P

10
General Mach Discussion / Lets pick a Spindle motor!
« on: December 04, 2007, 08:01:57 PM »
OK guys here is the deal: ???

I am building a machine to dress shapes into a grinding wheel.  I need to push a 14" dia grinding wheel to about 1000 rpm's.  The wheel should not be under much load because the diamonds I am using are .020" radius tips and I am taking .002" per pass at 3 IPM.  Looking for some suggestions for the most logical hook-up using  a C11 BOB.  What size and type of motor ???

Help is much appreciated! ;D

Pages: 1 2 »