DiyouPCB – Calibrating the Printer
Attention: for the first calibration phase is necessary to uninstall the Printing Bed.
Connecting your computer to the printer
Plug the USB cable to the printer and your computer and run Putty to connect to it.
If you see the message above then you have connected sucessfully.
You can uses two types of commands:
- HPGL Commands - used to print PCB's mainly.
- User Commands - are additional commands to the HPGL language that allow you to perform certain functions manually.
HPGL Commands
HPGL is a well-known plotter language developed by Hewlett Packard.
HPGL uses a cartesian coordinates system (X,Y) where each unit of plotting (without scaling) corresponds to 0.025mm. This means that if you want to move the printer 1mm you have to tell the printer move 40 units of plotting.
All HPGL commands have to be finished by the character ";" and some of them include parameters that are separated by the character ",".
Example:
PA 732,261;
The language is very extense, but we only implemented the subset of commands that Eagle generates and needed to print PCB's.
They are the following:
- AA - Allows to draw arcs and circles. Has three parameters X,Y, DEGREES. The degrees (0 to 360) can be positive or negative depending on whether you want draw the circle in a clockwise or counter-clockwise direction.
- IN - Initializes the printer. Move the laser to the home position and starts the sequence of Auto Focus.
- IP - Set the start point, normally 0.0.
- PA - Moves the laser to an absolute position. Has two parameters: coordinates X,Y.
- PD - Turns-on the laser to start drawing.
- PU - Turns-off the laser.
- SC - Used to scale the drawings. Not used to draw PCB's
- SP - Allows you to select the pen. It is not used in the printer.
- VS - Allows you to change the print speed
For more information see: HPGL .
User Commands
The printer user commands are the following:
- ? - Allows you to obtain information about the status of the printer (if on-line, position, speed, memory, etc.)
- ! - Allows you to temporarily pause printing (Pause).
- | - Allows you to resume printing (Restart)
- Ctrl-X - Reset (by software) the printer. To hardware reset press the reset button.
- @P - Allows you to adjust the laser power from 0 to 128. Example: @P90.
- @L1 - Turns on the laser.
- @L0 - Turns off the laser.
- @H X,Y - Backlash compensation calibration (Hysteresis)
You still can not test them because you have not connected the power supply yet.
Safety First
The printer uses a class 3B laser diode near to ultraviolet (405nm) wavelength. It is a low-power laser (less than 50mw) and with a very narrow focal length lens (1.6 mm) so it is not as dangerous as other lasers types but anyway we recommend you that never LOOK DIRECTLY AT THE LASER and use at all times protection goggles appropriate to the laser wavelength. For more information, see: Laser Safety.
The printer electronics allows you to add a security door switch and turn off the laser and stop the motors when open the door. It's an extra security measure that we recommend.
Some electronic components (motor drivers, power supply regulators, etc. ) generate heat. They uses an aluminum radiator that can burn your skin if you touch. So, careful when you touch them and please keep them away from flammable materials.
Although the stepper motors are low-power, careful when you handle them when the printer is running: belts and moving parts can hurt your hands.
The printer is an electrical equipment so take the necessary security measures to handling this kind of devices.
Connecting the power supply
Finally we are going to connect the printer to the power supply, but before that please check again that all the wiring is correctly installed, belts tight, X and Y shafts oiled, motors wired and connected, etc.
Anticipating problems…
It is possible when you connect the power supply to the printer that something will go wrong (the motors run in the wrong direction or they do not stop at the end of the race, due to wrong wiring connections). For this reason we recommend you to be ready to quicly turn off the printer if you see some strange behavior in this first power connection.
When you will turn on the printer the X and Y axis will move to the home position (0,0) at the lower-left side of the printing bed. The Y-axis will do it first, then the X-axis. If they do not move or do it erratically it may be because stepper drivers do not provide enough current to motors or you the belts are too tight or too loose. If the belts are ok, adjusts carefully the small pot of the stepper motor drivers, very slowly to the right, until the motor move.
If any of the axis (or the two) move in the wrong direction when you turn on the printer (not to home), is because you connected the stepper motors in the wrong way. Turn off the printer and check the motor wiring. Usually the solution is to turn arround the motor connector on the PCB.
If any of the axis (or the two) don't stop when reach the home position is because end-stop micro switches does not work well or they don't activate when colliding with the bumpers. Check that end-stops works well, are wiring correctly and aligned with the bumbers.
If the printer axes move to the home position when you turn on the printer and stop there then it's going well.
First testing
You can now connect with Putty and try some commands.
First we can use the command ? to know the status of the printer.
Then you can check if the laser works. First set the laser power for example to 85 with the following command:
@P85
Then turn on the laser with @L1 (remember that you must not look directly to the laser beam).
If the laser is turned on, everything is going well. You can turn it off with @L0.
If the laser does not turn on then you will have to check the wiring, connectors, cables, etc. something is wrong or the pickup electronics was damaged.
If the testing goes well, try using the Auto Focus system: type the command IN.
The printer axes will then move to the home position and you will see that the laser turn on and the lens of the Pikcup moves up and down trying to focus. It will be unable to do it because the printing bed is uninstalled, but when you install it, the printer will focus on the reflective foil at the focus point.
Finally try to move the axes of the printer using the command PA.
Example:
PA 3000.3000; - Moves the laser beam, more or less, to the center of the printer.
PA 0.0; - Move the laser beam to the initial position printing position.
Familiarise yourself with the commands and the operation of the printer before continue with the calibration.
Calibrating the stepper motor drivers
This is a very important point. The drivers of the stepper motors has a small potentiometer which must be adjusted very carefully because it is very small and sensitive. Any small movement of the potentiometer turns into a decrease or increase of the current that the motor receive. Lack of current and the motor will not moved, or will lost steps or move stumbing. Too much current and the drivers and/or motors will hot or vibrate in excess. The drivers have a safety system that disconnect them when they reach a certain temperature so it is difficult to damage them, but the stepper motors can burn by excess current. Therefore, it's very important to carefully calibrate the stepper motors drivers.
Go axis by axis moving them from one end to another of the printer, setting up the driver potentiometer slightly until you can see that the axis move smoothly and it does'nt stop nor lose steps and no heats up in excess.
Once calibrated it is recommended to run the printer during a certain time and check again.
Calibrating the Auto Focus
To calibrate the Auto Focus sytem first you have to re-install the Printing Bed.
Thread the four corners bolts into the Printing bed supports, until the window glass will be approximately 6 or 7mm from the lens of the pickup. You can use a caliper to measure the gap between the bottom of the plywood and the top of the plastic support. It has to be approximately 19mm.
Then use the command "IN" to move the pickup to the home position and start auto-focus sequence. You will see that the laser turns on and the lens moves up and down. It's possible that the laser doesn't focus at all, but the important thing for the moment is that the laser will point to the correct place: the reflective foil.
Check that the pickup lens does not hit the glass. If so unscrew a little bit the printing bed until it does not crash.
Then looking underneath the glass you need to check that the laser is pointing correctly to the reflective foil of the Focus Point. If inot adjust the bumper screw that stop the X-axis microswitch or remove it if necessary.
If even so you cannot point the laser beam to the reflective foil you may change two firmware parameters (Configuration.h file) and compile/upload it again.
Those parameters indicate the firmware the extra movement that has to do the printer from the Home Position to the Focus Point.
// How many mm add to home position to get focus position
#DEFINE FOCUS_OFFSET_X 0
#DEFINE FOCUS_OFFSET_Y 0
If the laser points to the right place then it's all a matter of adjust and level the height of the support until the pickup can focus on the foil and the glass is leveled.
Try with the "IN" command several times until it provide you a focus position close to 200 (position of the servo that moves the focus lens).
When you run the command it will appear the following message:
Focusing, wait a moment please…..
Then you will see a series of numbers, and finally the message:
Focused at: XXX
Where XXX is the focus position of the lens servo.
If repeatedly running the "IN" command the focus positon is maintained around a value close to 200, the printer will be calibrated.
On the other hand if the following message appears:
Impossible to focus. Check laser distance from lens to glass.
It means that the glass is too far away from the pickup lens so you have to screw a little the printing bed bolts. The adjustment is very fine: don't screw/unscrew the bolts too much at once.
If you hear that the lens hits the glass or see the laser is focused but in a very low position (less than 180) it means that the glass is very close to the lens and you will have to unscrew the printing bed bolts. If the laser focus in a low position it means that it is focusing on the bottom of the glass not in the reflective foil, so screw a little the bolts.
A trick: calibrate the printer with a PCB on the glass (the size that you commonly use) and the door closed. Add any other weight that you usually put on top of the printer when printing. Small variations in weight make the wood or glass flex tenths of a millimeter modifing the focus position so calibrate the focus level with all the stuff on the printer.
Calibrating the printer init position
When the printer gets focus correctly at the Focus Point then automatically will move the laser beam to the lower-left corner of the glass window where the PCB to print is. That will be the (0,0) coordinates of the drawing.
If you observed the measures of the glass window and the printing bed probably you don't have to do any adjustment. But if you see that the laser beam doesn't point to the proper position, then you may adjust the following parameters in the firmware Configuration.h file and recompile/reload it.
// How many mm add to home position to get the glass
#DEFINE HOMING_OFFSET_X 5
#DEFINE HOMING_OFFSET_Y 0
Tighten the belts
It is difficult to know when the belts are properly tightened: you'll see in the practice. They do not have to be neither too tight nor too loose. If the tension is inadequate it will probably cause a problem called backlash whose main effect is that distorts circles.
If after check the belt tension your printer can't print round circles, you can adjust the following parameters in the Configuration.h file.
#define X_DEFAULT_BACKLASH_MM 0.3f
#define Y_DEFAULT_BACKLASH_MM 0.2f
Adjusting the steps per unit
There is a parameter in the firmware configuration file that allows you to adjust the steps by mm. Is the following:
#DEFINE DEFAULT_AXIS_STEPS_PER_UNIT {80.00 , 80.00 }
Probably it's not necessary to adjust these parameters, but if you see that the measures of your printed circuits do not correspond with the originals you will have to measure and adjust. Also if you make changes in the printer specifications: pulleys, belts, motor microstepping configuration, etc.
The procedure to calibrate the steps per mm is the following:
- Move 100mm one of the axis with the PA command. For example the Y-axis: PA 0.4000;
- Measure with a digital caliper if the axis really moved that length.
- If your measurement was different than 100mm it means that it is necessary to adjust it.
- Multiply the value obtained (for example 101mm) with the current value of the step per unit parameter (80).
- Divide the result by the distance that you indicated the printer to move (100mm).
- The result (80.8) is the new value of the DEFAULT_AXIS_STEPS_PER_UNIT parameter.
- Change it, compile/upload the firmware and test again.
- Re-measure and verify that the axis move now exactly 100mm.
- Once adjusted one axis, calibrate the other in a similar way.
Printing the calibration test
To verify that the printer is working properly make a printing test.
Close Putty application and start DiyouPCBRun.
Connect to the printer and load DiamondTest.hp file from C:\Users\MyUser\DiyouPCB\Sketchbook\PCBFiles directory.
You will see the following on the screen:
To print the calibration diamond you will need a small PCB of approx. 40mm x 40mm.
Turn off the light (and on a red light), apply the Dry-Film to the PCB and place it on the printer glass (left-down corner) upside down.
Close the printer door and click on the Print button.
The printer will move the laser beam to the Focus Point and will start the auto-focus procedure. Once focused it will begin to print on the PCB.
Yo will see on the screen the evolution of the drawing in blue color. To the right of the window: the HPGL commands that are sent to the printer.
When the printer finish printing, the drawing will be all in blue color and you will see in the lower window the message "End of job".
Then you can open the printer door, remove the PCB, and develop the dry-film in a couple of minutes.
...and if the drawing appears clear, precise and well shaped then !!the printer is calibrated! Congratulations.
Adjusting the laser power
It is very important to properly adjust the laser power in order to get good results. The laser power level that you should use depends on the following factors:
• Pickup - we have seen that the behaviour of pickups of the same model (PHR-803T) are different and need differents power levels.
• Dry-film - we have only tested the blue type Dry-film that you can find on the internet. You probably will need to adjust laser power for other types.
• Solar-Film - The type of solar film that is glued to the printing window and its ability to filter UV rays also affects laser power.
• Speed - If you increase or decrease the printing speed it will be necessary to adjust the laser power equally.
By default, the printer uses three laser power levels that can be set in the firmware. One determines the default power of the laser, another the laser power used for small circles (vias, pads, etc.) and the last one the power used when short segments are drawn. If the segments are very short, the laser will be too long in the same place and can produce an halo around the laser beam. To avoid this effect the printer automatically reduces the power in short segments and small circles.
The mentioned parameters of the configuration file are as follows:
#define DEFAULT_ENTRY_POWER 65
#define DEFAULT_LASER_POWER 88
#define DEFAULT_EXIT_POWER 65
#define SMALL_CIRCLE_FEEDRATE 10
#define SMALL_CIRCLE_ENTRY_POWER 60
#define SMALL_CIRCLE_POWER 66
#define SMALL_CIRCLE_EXIT_POWER 60
#define SMALL_SEGMENT_SIZE 1
#define SMALL_SEGMENT_ENTRY_POWER 69
#define SMALL_SEGMENT_POWER 73
#define SMALL_SEGMENT_EXIT_POWER 69
Here ends the building process. Next step is learning how to use your new PCB printer.