Automatic pen change

Setup for an automatic pen change on my 'Plotter-2'

Note: my setup uses the 'Coolant Enable' signal (controlled via M8, M9) to control a small circuit to open and close the gripper. It should be possible to change the setup for use with the spindle-PWM signal to control the gripper - for this a special grbl version is needed.

[1. Setup of 'Homing']

[2. Adjust the gripper position]

[Setups]


1. Homing, enable and adjustment

At my plotter, the end-switches are located:
X axis: on the left, Y axis: on the rear, Z axis: on the top.

After the homing the machine coordinates are -207, -3, -3, calculated from the $13x values - in my case:

$130=210.000
$131=180.000
$132=110.000

minus the $27 value - in my case $27=3.000 (Retract distance after triggering switch to disengage it. Homing will fail if switch isn't cleared.).
Also the homing direction determines the final homing machine coordinates.

 

More details on grbl-wiki

 


2. Adjust the gripper position

View from top to down: position when the gripper takes the pen,
machine coordinate X=-203.5 Y=-10.5 Z=-83.
I choose X +15 mm from this position as the tool change position in the tool table offset.

The tool-change-script moves a bit towards +Y, then X-15, then a bit back -Y to reach the position on the picture.

More information about the gripper and pen holder

 

 

 

 

 

 

 

 


Setups

Tool change setup
Set buttons 17 to 28 in pen colors
Clear buttons 17 to 28

Note the variables #TOAx (TOol Actual position) which will be replaced when sending the code towards the controller.
( Select and grip pen nr.)
( G53 indicates machine coordinates - no transform required)
( move Z in relative coordinates to compensate different tool length)
M8                        ( open gripper)
G53 G90 G0 X#TOAX Y#TOAY  ( move gripper in front of actual pen in absolute machine coordinates)
G53 G90 G0 Z#TOAZ         ( move gripper to correct height)

G91 Y3                    ( move gripper in position)
X-15
M9                        ( close gripper)
Y-3
Z20                       ( lift pen to get it out of holder)
X15                       ( take pen)

G90
G53 G90 G0 Z#TOAZ         ( move gripper to correct height)
Note the variables #TOLx (TOol Last position) which will be replaced when sending the code towards the controller.
(Move pen back to pen storage)
(Assumption: active pen storage position is empty)
( G53 indicates machine coordinates - no transform required)
( move Z in relative coordinates to compensate different tool length)
G53 G90 G0 X#TOLX Y#TOLY    ( move gripper in front of last pen in absolute machine coordinates)
G53 G90 G0 Z#TOLZ           ( move gripper to correct height)
G91 G0 Z25                  ( lift pen)

G91 X-15                    ( move pen into holder)
Z-25                        ( move pen down)
M8                          ( open gripper)
Y3                          ( remove gripper from pen)
X15	

G90
G53 G90 G0 Z#TOLZ           ( move gripper to correct height)
Note the decreasing tool exchange position Y (5th column), which matches with my pen holder.
# T-Nr; Color; T-Name; ExPosX; ExPosY; ExPosZ; ExPosA; T-Diameter; XY-Feed; Z-Feed; Z-Save; Z-Deepth; Z-Step; Spindle-Spd; Step-over %, GCode
# paint_Stabilopower
  1, FFFF00,yellow              ,    0,    0,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  2, FAD780,apricot             ,    0,  -15,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  3, FFA500,orange              ,    0,  -30,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100,
  4, 4CBED9,light blue          ,    0,  -45,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  5, 14B43C,lime                ,    0,  -60,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  6, FF0000,red                 ,    0,  -75,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  7, D90385,pink                ,    0,  -90,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  8, 8C5F96,lilac               ,    0, -105,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
  9, 008000,green               ,    0, -120,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
 10, 0000FF,blue                ,    0, -135,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
 11, 5F311E,brown               ,    0, -150,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100, 
 12, 000000,black               ,    0, -165,    0,   0, 2, 1000,  500, 2, -1,   1,    1000, 100,
Setup values can be applied via copy & paste on the Serial-COM window of GRBL-Plotter.
$0=10          (Sets time length per step. Minimum 3usec.)
$1=25          (Sets a short hold delay when stopping to let dynamics settle before disabling steppers. Value 255 keeps motors enabled with no delay.)
$2=0           (Inverts the step signal. Set axis bit to invert (00000ZYX).)
$3=1           (Inverts the direction signal. Set axis bit to invert (00000ZYX).)
$4=0           (Inverts the stepper driver enable pin signal.)
$5=1           (Inverts the all of the limit input pins.)
$6=1           (Inverts the probe input pin signal.)
$10=2          (Alters data included in status reports.)
$11=0.010      (Sets how fast Grbl travels through consecutive motions. Lower value slows it down.)
$12=0.002      (Sets the G2 and G3 arc tracing accuracy based on radial error. Beware: A very small value may effect performance.)
$13=0          (Enables inch units when returning any position and rate value that is not a settings value.)
$20=0          (Enables soft limits checks within machine travel and sets alarm when exceeded. Requires homing.)
$21=0          (Enables hard limits. Immediately halts motion and throws an alarm when switch is triggered.)
$22=1          (Enables homing cycle. Requires limit switches on all axes.)
$23=1          (Homing searches for a switch in the positive direction. Set axis bit (00000ZYX) to search in negative direction.)
$24=150.000    (Feed rate to slowly engage limit switch to determine its location accurately.)
$25=1000.000   (Seek rate to quickly find the limit switch before the slower locating phase.)
$26=250        (Sets a short delay between phases of homing cycle to let a switch debounce.)
$27=3.000      (Retract distance after triggering switch to disengage it. Homing will fail if switch isn't cleared.)
$30=1000       (Maximum spindle speed. Sets PWM to 100% duty cycle.)
$31=0          (Minimum spindle speed. Sets PWM to 0.4% or lowest duty cycle.)
$32=0          (Enables laser mode. Consecutive G1/2/3 commands will not halt when spindle speed is changed.)
$100=167.979   (X-axis travel resolution in steps per millimeter.)
$101=167.979   (Y-axis travel resolution in steps per millimeter.)
$102=503.937   (Z-axis travel resolution in steps per millimeter.)
$110=5000.000  (X-axis maximum rate. Used as G0 rapid rate.)
$111=5000.000  (Y-axis maximum rate. Used as G0 rapid rate.)
$112=2500.000  (Z-axis maximum rate. Used as G0 rapid rate.)
$120=400.000   (X-axis acceleration. Used for motion planning to not exceed motor torque and lose steps.)
$121=400.000   (Y-axis acceleration. Used for motion planning to not exceed motor torque and lose steps.)
$122=400.000   (Z-axis acceleration. Used for motion planning to not exceed motor torque and lose steps.)
$130=210.000   (Maximum X-axis travel distance from homing switch. Determines valid machine space for soft-limits and homing search distances.)
$131=180.000   (Maximum Y-axis travel distance from homing switch. Determines valid machine space for soft-limits and homing search distances.)
$132=110.000   (Maximum Z-axis travel distance from homing switch. Determines valid machine space for soft-limits and homing search distances.)

We use our own or third party cookies to improve your web browsing experience. If you continue to browse we consider that you accept their use.  Accept  More information