Pick n Place with G Code

20100815 pm

Mach3 doesnt do userdefined variable names, need to use #1 #2 etc nor can we name subs so we will go with plan B which is to generate GCode from Excel tables..

 


 

20100815

Goal / approach: Have a framework as close as possible to:

Manually before hand:

Load PCB holder calibration point (if not permanent)
All feeders first component aligned to position 1

Var PCBcount = 1
Var LastPCB = 5
While PCBCount <=  LastPCB

    Load 0805-10r on head 1
    Load 0805-3k3r on head 2
    ..

    Place head1 at x,y where x,y is offset from PCB origin
    Place head2 at x,y where x,y is offset from PCB origin
    ..

    Load 0805-10r on head 1
    Load 0805-3k3r on head 2
    ..

    Place head1 at x,y where x,y is offset from PCB origin
    Place head2 at x,y where x,y is offset from PCB origin
    ..

    PCBCount += 1

Next while


Heads vs camera

  • All raw positioning is done from the cameras perspective
  • Each pickup head has offset (from the camera) variables in the X & Y axis
    • _h1_x, _h1_y, _h2_x, _h2_y

Work areas:

  • Feeders x 25
    • Each has a permanent component type
    • Have a 'feeder' global home calibration point (Camera perspective)
      • Set x0 y0 z0 on feeder calibration for G55
  • Per feeder:
    • Have an offset for x y from feeder G55 origin as variables identifying the no 1 component location for that feeder ie
      • _x_f1c1, _y_f1c1
    • Have a y increment variable to indicate spacing between each component on that feeder tape
      • _y_space_f1c1
    • Have a pickup head A axis pickup depth as a variable (with Z axis at 75) ie
      • _h1_pick_a_f1c1, _h2_pick_a_f1c1
    • Have a pickup head A axis place depth for each PCB thickness (usually 1.6mm) (with Z axis at 75) 
    • _h1_place_a_1.6_f1c1, _h2_place_1.6_f1c1

Head Selection

  • Custom vb macro to select each head & do vacuum off on?

 

-------------

So to pickup the first f1c1 component we would create a function sub ie:

(Initialise)
(Head offset variables)
#<_h1_x> = 34.2656
#<_h1_y> = 19.3859

(f1c15 setup)
#<_x_f1c15> = 28.2094
#<_y_f1c15> = -4.5
#<_y_space_f1c15> = 4
#<_h1_pick_a_f1c51> = 33.5
#<_h1_place_a_1.6_f1c15> = 20
..

(Select Head 1)
0001 SUB
M09
#<_h_x> = #<h1_x>
#<_h_y> = #<h1_y>
0001 ENDSUB

(Pick f1c15)
0115 SUB
G55
G0 X[#<_x_f1c15> + #<_h_x> + ] Y[#<_h_y> + #<_y_f1c15>]
G0 A[#<_pick_a>]
(Increment y for next pickup of this component)
#<_y_f1c15> = #<_y_f1c15> + #<_y_space_f1c15>
0115 ENDSUB

..

To use the above:

0001 CALL (Select head)
#<_pick_a> = [#<_h1_pick_a_f1c15>]
(Pick f1c15)
0115 CALL

 

The above variables will allow us to say a simple move to the next component to be picked up

  • PCB work area, 1 or more identical PCBs each run
    • Holder has permanent calibration point (Camera perspective)
  • For each PCB rotation
    • Each PCB has an offset to its origin (same origin as PCB package)
    • _x_pcb_offset, y_pcb_offset