Hello Guest it is April 16, 2024, 02:19:14 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 - Osker

Pages: 1
1
Has anyone successfully configured MACH4 and a PoKeys57CNC to do threading with a single index pulse per revolution?  I have found videos demonstrating threading with a PoKeys57CNC and Mach4.  However, an encoder is being used versus a single index pulse. 

The PoKeys57CNC manual indicates that it will do threading with either an index pulse or an encoder.  My index pulse generator is fairly typical.  A slotted IR sensor, an encoder disk with a single hole, and a microprocess for doing a little signal conditioning.  I have enabled threading; checked the box for using ultra-fast encoders, and checked the box for lathe(index).  The RPM DRO in Mach4 displays the correct RPM, so I think it reasonable to conclude that index pulse is being seen.  I have looked at the Index Pulse signal with an oscilloscope and it is a reasonably clean asymmetrical square wave.  The signal high is +4V, the low is essentially zero.  At 300 RPM the high pulse is about 8ms.     

I copied the threading example code from the Mach4 Lathe manual.  When the code is loaded the displayed tool path appears correct and there are no error messages.  After clicking Cycle Start, the X & Z axis move to their respective start positions.  When the G76 code line is processed, nothing happens.  It is as if either Mach4 or the PoKeys57CNC is waiting to synchronize on the index pulse.

I am running the most current versions of Mach4 and the PoKeys plugins.  Other than the threading issue, the lathe works as one would expect.  Any suggestions for what to try will be appreciated.

Dan

2
Mach4 General Discussion / Mach4 Function Primer
« on: May 21, 2018, 11:57:38 AM »
I am migrating from Mach3 to Mach4 and have several M functions that need to be re-written to work with Mach4.  After looking at several code examples and DazTheGas videos (which are very informative)  my progress is still painfully slow.  ls there a primer for using the common functions called in Mach4 scripting and the general logic behind them?  In the absence of a primer, it would be helpful if the following code from the Lua examples was explained.  No need to explain what a function is, declaration of variables,  or the use of if then statements.  just what the functions are doing.  I see the function mc.mcGetInstance() used in a lot of Mach4 macros. I  assume that is polling some register and code execution depends of the result, but what are the possible results?


The macros I use emulate  G77:  Variables are defined in Gcode for start and stop axis positions, feed rates, and cutting depth per pass.  A macro is then called which executes until the final depth is achieved.  Nothing major, but it does reduce code.
  
I am not looking to be taught how to fish, just to bait the hook.
 
local inst = mc.mcGetInstance()
local a,b
function GCodeExecute(GCodeString)
   local rc = mc.mcCntlGcodeExecuteWait(inst, GCodeString) --This is the standard function call for executing gcode. it waits for motor feedback before continuing in the file.
   if rc ~= mc.MERROR_NOERROR then return "GCode failed", false end
end

a,b = GCodeExecute("G0 X1 Y2.5 Z3.5")
if b == true then
   mc.mcCntlSetLastError(inst, "Motion Succeeded")
else
   mc.mcCntlSetLastError(inst, a)
end
--You can even incorporate variables into the function call.
local travelxdistance = 1.45
a,b = GCodeExecute("G1 X"..travelxdistance.."Y0")--You can concatenate to the end of the gcode string using '..'
if b == true then
   mc.mcCntlSetLastError(inst, "Motion Succeeded")
else
   mc.mcCntlSetLastError(inst, a)
end

3
There may be an issue with the most recent MACH4Lathe profile within MACH4 Hobby (4.2.0.3804).   I am not able to edit the position of the X axis using keyboard input.  The profile appears to load normally.  All axes move when jogged, and the respective current position updates within the DRO.  The current positon in the Z axis can be edited using the keyboard.  However, I am unable to edit the X axis using the same procedure as used when editiong the Z axis.  
 
To edit a current positon I:
 
1) Use the mouse to position the cursor within the X current position box.

2) Left mouse click

3) Nothing happens when in the X DRO, but when in the Y DRO the values highlight and can be edited using the keyboard and the DRO updates when enter is pressed.  Pretty much what one expects.

Using the screen editor, I looked at the settings for the two DROs to see if there was a setting that could be toggled to enable the X DRO to be edited.  Did not see one.

Editing the current position for all theree axes appears to be working normally within the new MACH4Mill profile.  Any suggestions for what can be done to correct this will be appreciated.


Regards,

Dan


4
The following is a subroutine I used frequently in Mach3 to mill a shape to a final Z depth.  The basic approach is to define a series of variable.  Use those variables to calculate the number of passes required to reach the final Z depth and then pass that value to the subroutine.  This second subroutine ensures that the final depth is reached and executes spring passes.

Does Mach4 support a similar approach?  If so, please give me a hint of where I can find the information within the MAch4 documentation.

Regards,


Dan

N10 % Mill Shape to depth using two subroutines
N20 % Calculates number of passes to reach final depth
N30 % Second subroutine is at final depth & supports
N40 % spring passes at final depth
N50 %
N60 % Standard Variables
N70 %
N80 % #1 = Z Retract
N90 % #2 = Z Start
N100 % #3 = Z Finish
N110 % #4 = Z depth of cut per pass
N120 % #5 = Number of times for subroutine to loop
N130 % #6 = Number of spring passes
N140 %
N150 % Number of passes to reach zero = absolute values of Z Start + Z finish
N160 % divided by depth per pass. Result is a whole number
N170 %
N180 #1 = 0.25    % Z Retract
N190 #2 = 0.03    % Z Start
N200 #3 = -.125   % Z Finish
N210 #4 = 0.05    % Z depth of cut per pass
N220 #5 = FIX[[ABS[#2] + ABS[#3]]/#4] % Number of times to loop
N230 #6 = 2  % Number of Spring Passes
N240 %
N250 M98 P001 Q#5 % Call subroutine o001  
N260 %
N270 % Mill remaining depth
N280 %
N290 M98 P002 Q#6 % Call Subroutine o002
N300 %
N310 % End
N320 %
N330 G00 Z#1 % Goto Z Retract
N340 M30
N350 %
o001 % (Mill Shape subroutine )
N370 %
N380 G00 Z#1 % Goto Z Retract
N390 G00 X0.2  Y0.45 % Goto X and Y start REPLACE with actual values
N400 #2 = [#2-#4] % decrement Z depth
N410 G00 Z[#2 + [2*#4]] % Clear work by Z Start + 2 times depth of cut
N420 G01 Z#2 F.25 % Down slow to cutting depth
N430 %
N440 % REPLACE with actual values
N450 G01 X-0.25 Y0.45 F4
N460 G01 Y-0.2
N470 %
N480 M99 % Return from Subroutine
N490 %
N500 %
o002 % (Mill Final Depth of Cut Subroutine)
N520 %
N530 G00 Z#1 % Goto Z Retract
N540 G00 X0.2 Y0.45 % Goto X and Y start REPLACE with actual values
N550 G00 Z[#3 + [2*#4]] % Goto Z Finish + 2 times depth of cut
N560 G01 Z#3 F.25 % Down slow to Z Finish
N570 %
N580 % REPLACE with actual values
N590 G01 X-0.25 Y0.45 F4  % Goto X and Y start
N600 G01 Y-0.2
N610 %
N620 M99 % Return from Subroutine

5
I am a victim of the latest Windows 10 update and I am attempting to migrate from Mach3 to Mach4.  For simplicity I am starting with the lathe.  My control hardware consists of an Ethernet SmootheStepper (ESS) connected to a Gecko G540.  All of which was operating normally before the Windows 10 Update.  Since then, I have downloaded and installed a licensed a copy of Mach4 and the latest ESS plugin.  I have followed the ESS documentation for configuring it to work under MACH4 and configured MACH4 according.  The Diagnostics screen show that the ESS is communicating.  While in the Jog screen, the indicated positions of the X and Z axes change as expected, however neither stepper turns.  Obviously, I am missing something.  I am hoping that someone with similar hardware has made the transition.  If so, please send my your working Machine.ini file so that I may be able to spot where I am wrong.

Regards,


Dan

6
CVI MachStdMill (MSM) / How to Enable RPM in MachStd Mill
« on: September 19, 2010, 07:30:19 PM »
I have installed and configured MachStdMill, however I am not able to display the RPM.  I am using the same spindle pulse generator that I used previously and I know that works.  Furthermore, the Hardware screen indicates that the index pulse is being detected and the pulse is detected when I use the "automated setup of inputs" feature.  

When I click the RPM button, the button turns green, but no RPM is displayed.  With the spindle turning and an index pulse being generated, I attempt to use the "Calibrate Spindle" function, but when I click "AutoCal", I receive the message "Start Spindle at any speed".

I assume the problem lies with a configuration setting that I have missed.

Any suggestions for correcting the problem will be appreciated.

Regards,

Osker

7
General Mach Discussion / Implementation of Logical IF Then Statements
« on: December 28, 2007, 08:23:02 AM »
Hello,  I am transitioning from TurboCNC to MACH3 and need assistance with implementing Logical IF Then Statements within MACH3.  The following code snippet within TurboCNC would be used to cut a profile on a lathe (Radius, with X.0 being the Center) by comparing the current cutting depth to the targeted profile depth of cut.  If the  profile depth of the X-axis is below or equal to the current depth of cut, there is no change in the depth of the cutting tool.  If the profile depth of cut is above the current depth of cut, the cutting tool moves to the profile depth of cut.  Each coordinate of the profile is evaluated in the same manner to complete the desired shape.   

If there is a way within MACH3 to implement a similar approach, please point me in the right direction.

Thanks in advance for your consideration.

Regards,

Dan


The concept is to start as some X position that is greater than the stock radius, and decrement the value each pass, until the target depth is achieved.  In the following example #3 is the starting radius, #4 is the target X profile coordinate.  #6 is the target Z profile depth of cut.  For example,

N10 #3 = 0.1
N20  #4 = 0.0375  #6 = -0.2878 M98o770
N30  #4 = 0.0575  #6 = -0.3108 M98o770
and so on for each coordinate of the profile.
After the last coordinate, the depth of the pass would be decremented, and the routine would loop again

% Profile Subroutine

N770 If #4 LE #3 M97o800  //If target X <= Current  X , then cut at current X depth
N780 G01 X#4 Z#6 F#2  //Else cut at profile X & Z coordinates
N790 M99  //Return to Main Program
N800 G01 X#3 Z#6 F#2  //Cut at current X depth
N810 M99  //Return to Main Program

8
FAQs / How to Implement Logical IF Then Expressions in MACH3
« on: December 25, 2007, 11:47:41 AM »
Hello,  I am transitioning from TurboCNC to MACH3 and need assistance with implementing Logical IF Then Statements within MACH3.  The following code snippet within TurboCNC would be used to cut a profile on a lathe (Radius, with X.0 being the Center) by comparing the current cutting depth to the targeted profile depth of cut.  If the target profile depth of cut is below the current depth of cut, there is no change in the depth of the X axis.  If the target profile depth of cut is greater than the current depth of cut, the profile depth of cut is used.  This approach uses the results of a Logical "IF Less Than or Equal to".  If there is a way within MACH3 to implement a similar approach, please point me in the right direction.

Thanks in advance for your consideration.

Regards,

Dan


The concept is to start as some X position that is greater than the stock radius, and decrement the value each pass, until the target depth is achieved.  #3 is the starting radius, #4 is the target X profile coordinate.  #6 is the target Z profile depth of cut.  For example,

N10 #3 = 0.1
N20  #4 = 0.0375  #6 = -0.2878 M98o770
N30  #4 = 0.0575  #6 = -0.3108 M98o770

%RH Profile Subroutine

N770 If #4 LE #3 M97o800  //If target X <= Current  X , then cut at current X depth
N780 G01 X#4 Z#6 F#2  //Else cut at X & Z coordinates
N790 M99  //Return to Main Program
N800 G01 X#3 Z#6 F#2  //Cut at current X depth
N810 M99  //Return to Main Program

Pages: 1