Mach 3 configuration

Limit switch as home switches:

Speed for homing 5%,

X wasnt always backing off enough so Config-> general Config -> Debounce Interval = 20 seemed to hel


When we had 4 heads (H0-H3) head select is via parallel port pin 16 & 17 linked to PIC18F4610 B6 & B5 respectively

Mach3 M7 (Mist) -> Output2 -> PPort 16 -> 18F4620.B5

Mach3 M8 (Mist) -> Output3 -> PPort 17 -> 18F4620.B6

In Mach3 Output 2 & 3 are tied to parallel port 16 & 17 respectively with spindle setup


B6 B5 Command
Head0 0 0 M9
Head1 0 1 M9 M7
Head2 1 0 M9 M8
Head3 1 1 M9 M7 M8

GCode Axis A drove our select pick place head:

Mach3 -> Axis A Dir -> PPort 9

Mach3 -> Axis A Step -> PPort 8

 


With 8 heads, and no Z axis still on the machine:

GCode Axis Z will drive our selected pick place head.  Additionally, the way we do this we will try to allow for the heads to be replaced with Solenoids in the future.

For 8 DVD heads we need to be able to select a head (3 bits required) and specify an operation:

  • Vacuum toggle
  • Head Step & Dir

 


Macros

We use Output1-4 as input to our head select (only 8 inputs required as at 20101127)

http://www.machsupport.com/forum/index.php?topic=15425.0

Open  notepad and type in your VB, for example to switch on OutPut 3 you would have

ActivateSignal(OutPut3)

Save the file as m****.m1s where the **** is a number you wish, for example it could be m1234.m1s.
Yousave it to the macro folder of the profile you are using, exaple if using standard Mach3Mill profile it would be saved to
C:\Mach3\macros\Mach3Mill

Then when you have m1234 in your code or call from MDI that output will be activated. Similarly for shutting it off write another macro as above and call it for example m1235.m1s. In the macro you would have

DeActivateSignal(OutPut3)

So when your code calls m1235 the output will switch off

Also: http://www.machsupport.com/MachCustomizeWiki/index.php?title=Mach_specific_Subroutines/Functions_grouped_by_purpose#Button_Commands

http://www.machsupport.com/MachCustomizeWiki/index.php?title=Communications_Routes#Mach3_macros

As already mentioned, a macro is a piece of VB Script. Each macro has a name like M134. The M is used at the start of every macro name and the number can be any integral value up to 99999 that is not used to define a built-in M-code. These built-in numbers are listed in chapter 11. Thus for example, M12, M50, M16543 are all valid macro names; while M3, M-56, M0234, M567.4 are not valid names.

Standard macros will use the number range up to M999, Original Equipment Manufacturers (OEMs) are advised to use M1000 to M89999 and end-users can avoid naming conflicts by using M90000 to M99999.

Each macro is stored as text in its own file whose name is the macro name with file extension ".m1s". Thus one would find files: M12.m1s, M50.m1s and M16543.m1s on a system with the above macros in it. The macro files are collected in a folder corresponding to the profile name with which they are to be used within a folder called "Macros" within the Mach3 folder.A macro is called just like an ordinary M-code command by:

  • Execution of a line (block) of a part program containing its name
  • Including its name on commands entered on the MDI line
  • Including its name in the code to be executed on clicking a screen button.

We can pass parameters via P Q S params to a macro..

So we will create a stepper (head) select function passing it the target head no 0-15..

Cypress Enable Basic Scripting http://www.cypressinc.com/enduser.pdf

m90001.m1s

' Read Px and select stepper Px (0-15)

Dim Stepper
Stepper = Param1()
'msgbox Stepper

 

Select Case Stepper
 Case 0
  DeactivateSignal(Output1)
  DeactivateSignal(Output2)
  DeactivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 1
  ActivateSignal(Output1)
  DeactivateSignal(Output2)
  DeactivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 2
  DeactivateSignal(Output1)
  ActivateSignal(Output2)
  DeactivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 3
  ActivateSignal(Output1)
  ActivateSignal(Output2)
  DeactivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 4
  DeactivateSignal(Output1)
  DeactivateSignal(Output2)
  ActivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 5
  ActivateSignal(Output1)
  DeactivateSignal(Output2)
  ActivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 6
  DeactivateSignal(Output1)
  ActivateSignal(Output2)
  ActivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 7
  ActivateSignal(Output1)
  ActivateSignal(Output2)
  ActivateSignal(Output3)
  DeactivateSignal(Output4)


 CASE 8
  DeactivateSignal(Output1)
  DeactivateSignal(Output2)
  DeactivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 9
  ActivateSignal(Output1)
  DeactivateSignal(Output2)
  DeactivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 10
  DeactivateSignal(Output1)
  ActivateSignal(Output2)
  DeactivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 11
  ActivateSignal(Output1)
  ActivateSignal(Output2)
  DeactivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 12
  DeactivateSignal(Output1)
  DeactivateSignal(Output2)
  ActivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 13
  ActivateSignal(Output1)
  DeactivateSignal(Output2)
  ActivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 14
  DeactivateSignal(Output1)
  ActivateSignal(Output2)
  ActivateSignal(Output3)
  ActivateSignal(Output4)


 CASE 15
  ActivateSignal(Output1)
  ActivateSignal(Output2)
  ActivateSignal(Output3)
  ActivateSignal(Output4)


END SELECT 

 

Also a macro to toggle Output5 (PPort 14) with a small delay for turning vacuum on / off