A personal repository of random information in compensation for a fatigued biological computer
Breaded Electronics / Embedded » Home made pick place SMT machine OLD pages » Pick n Place G Code generated by MS Excel
20100921
SO we now have excel taking the diptrace output and ny adding a couple of formulas and vlookups back to head & feeder offset we have all x y coordinates calcualted for populating a single PCB.
A small VB program is outputting gcode and it works.
Now to allow for an array of pcbs.
It seems the G Code process is to put the pick place gcode for each identical PCB into a subroutine and then offset the PCB coordinates using the G52 command..
Seems easy enough.. but.. the G52 command effects all fixture offsets so perhaps not so suitable..
So.. how about a variable that identifies the current pcb which relates to the fixture offset..
Process:
G56 is the origin for the first PCB in the array, this is our PCB global reference.
If we move to G56, we can set G59 P101 etc using relative G91 from G56 coordinates per the required offset..
So if 4 PCBs we set G59 P101 - P104
Then our main GCode sets #100 = 101 and calls the subroutine, which uses G59 P[#100] (instead of the current G56 fixture setting).. then set #100 = 102 and repeat etc..
Well, I'm sure I tested that G10 responds to G91, ie make an offset relative to the current position but it ain't working now..
So.. to achieve the same thing, ie set offsets in G code from G56 when G56 is unknown at the time of creating the GCode.. I can use variables:
G56 is work offset 3, the Mach 3 Mill manual tells me vars #5261-5263 are G56 X Y & Z respectively.. so we will use these in our code..
20100916
So we cant use named variables in Mach 3 G Code, or pass params to subs
So we will see if we can setup tables of params in Excel and generate G Code from them.
Note:
DipTrace exports Pick n Place table based on its origin.. we can use this after manually cleaning it up..
Example for LED4R, note this board layout was horizontal with RJ12 on the right, origin bottom left.
Export is:
From this we create corrected:
We then manually add sensibly for that component step:
We then sort the entire array by:
We then add calculated columns for direct use in resulting gode:
We then run our macro to create G Code sequence for each rotation.
Possible options:
G Code requirements:
For each different PCB assembly orientation (0, 90, 180, 270 degrees clockwise) require an instruction G Code file..
Comprising of:
For each pickup instruction need to know:
Pickup sequence:
For each place instruction need to know:
Placement Sequence: