How To …

1. Prepare a line drawing for engraving

Line drawings are fairly easy to set up for engraving on a laser cutter/engraver, and engrave best if the drawings have thick, clear, lines. If the lines are faint, then they may end up being pixelated when converted to a bitmap. If the image is hand-drawn, then scan it in colour using 600 dpi (you can then lower the resolution later to suit the type of engraving you want).

The process will be illustrated using one of the example drawings from the Sensory Objects Project, and using Photoshop CS4. You can use other image editing applications (such as GIMP) and they will do the job just as well, but you will need to modify these instructions accordingly. If you find any difficulties using other applications, then please email me.

The drawing below is by Sam, which was drawn on paper using coloured markers. It has been scaled to 15cm x 11cm at a resolution of 300 DPI.

Sam's drawing (scanned original)

Sam’s drawing (scanned original)

Before this can be converted to a a 1-bit bitmap, it must first be converted to greyscale (merging any layers first). This is what the image looks like after to converting to greyscale:

Sam's drawing converted to greyscale

Sam’s drawing converted to greyscale

As you can see, the drawing is not very high contrast. If you engrave this now, the engraving will be quite shallow and indistinct from the background. To get a better engraving it is a good idea to increase the contrast, and you can do this in PhotoShop using the threshold adjustment. Threshold can be found under

Image > Adjustments > Threshold …

This is the same image with the threshold modified to give the maximum contrast, but without reducing the image quality too much:

Sam's drawing with contrast improved using threshold adjustment

Sam’s drawing with contrast improved using threshold adjustment

If you were to save this image as a 1-bit bitmap now, and then engrave it, the drawing would be recessed into the material (i.e. the black part of the image would be removed from the material). However, in this instance we would like to create a relief from the drawing, so that the original line drawing is raised above the background plane. So there is one more stage to complete – invert the image. In PS use

Image > Adjustments > Invert

then save the image as a 1-bit bitmap. We retained the original 300 dpi for this image when it was saved as a bitmap, though you could try a higher/lower resolution and see if there is a difference.

Sam's drawing inverted

Sam’s drawing inverted

The above image is now ready to engrave. On the LaserScript 3060 (with a 60W tube), we used a speed setting of 200, a power setting of 20 and scan gap of 0.05, although it is recommended to use a scan gap of 0.085 for an image at 300 dpi. We have tried both and the difference is barely perceptible. if you have a 40W tube, then you will probably need to increase the power setting slightly. As a guess try 25 instead of 20, but I would recommend that you do a test engrave first using a scrap of wood and check the result (just engrave the letter ‘A’ and see how it comes out).

After having set up the image, we engraved it into 3mm laser cutting birch plywood. Here’s the resulting engraving:

Sam's engraved shell

Sam’s engraved shell

You can just about see that the line drawing is raised against the background plane, and this makes it very nice to feel.

2. Calculate the scan gap for a given image DPI

If you wish to engrave an image (e.g. a line drawing or photograph) then you will need to set up the scan gap to correspond to the DPI of the image so that you obtain the correct resolution for the engraving. There is a simple formula for doing this:

DPI to Scan Gap = 25.4/DPI

For example, if you have a 300 dpi image, this formula would give a scan gap of about 0.085. Change the scan gap when you are engraving – it’s usually found on the same dialog as the speed and power setting.

 

3. Driving a stepper motor with an ATTiny85

This was an experiment to how well an Atmel ATTiny85 could driver a cheapo (off-the-shelf) stepper motor. The unit is a standard 28BYJ-48 stepper motor, with its associated ULN2003 based driver board, bought from ebay for about £3.00. It was tested initially by  connecting the driver board to an Arduino UNO to make sure that it worked okay. The steps which follow are what you need to do if you want to try the same.

You’ll need a 28BYJ-48 stepper motor, with its associated ULN2003 based driver board, and Arduino UNO with USB cable, an ATTiny85 microcontroller, a 10uf capacitor and jumper cables.

1. First off you need to plug the stepper motor into the driver board (easy – just plug it in!) and then connect the driver board to the UNO. Connect IN1 to IN4 on the driver board to pins 3, 4, 5 and 6 on the UNO.

If you use an external power source for the stepper motor board (which is what I have done below, using a 9V battery) a wire from the negative terminal on the stepper motor board needs to be connected to the GND on the UNO. You can use a DC power source from 5V to 12V. I initially used a 9V PP3 battery for testing.

If you don’t use an external power source, then just connect the 5V on the UNO to the + on the stepper driver, and GND on the UNO to the – on the stepper driver.

Here’s a diagram of the connections using an external power source:

Connection diagram for stepper driver and Arduino UNO

Connection diagram for stepper driver and Arduino UNO

2. You can test the stepper using the built-in stepper library supplied with the UNO, but I found that the AccelStepper library was way better, and would recommend that you download and install for testing your stepper motor. When you have it installed, try the following sketch (from 42Bots):

#include <AccelStepper.h>
#define HALFSTEP 8

// Motor pin definitions
#define motorPin1 3 // IN1 on the ULN2003 driver 1
#define motorPin2 4 // IN2 on the ULN2003 driver 1
#define motorPin3 5 // IN3 on the ULN2003 driver 1
#define motorPin4 6 // IN4 on the ULN2003 driver 1

// Initialize with pin sequence IN1-IN3-IN2-IN4 for using the AccelStepper with 28BYJ-48
AccelStepper stepper1(HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4);

void setup() {
stepper1.setMaxSpeed(1000.0);
stepper1.setAcceleration(100.0);
stepper1.setSpeed(200);
stepper1.moveTo(20000);

}//–(end setup )—

void loop() {

//Change direction when the stepper reaches the target position
if (stepper1.distanceToGo() == 0) {
stepper1.moveTo(-stepper1.currentPosition());
}
stepper1.run();
}

This sketch will accelerate the stepper up to a maximum speed. Stop. Reverse direction, then accelerate up to maximum speed in the other direction. Make sure that whatever sketch you are using to drive the stepper motor is working okay before going on to program the ATTiny85. If it doesn’t work correctly on the UNO, it won’t work correctly on the ATTiny. You can find more details of about the AccelStepper library here.

3. Programming the ATTiny85

This is the fun part! We’ll turn the UNO into a programmer for programming the ATTiny85 microcontroller.

Unplug the stepper motor from the UNO for the time being and put it to one side. Now check your Arduino IDE and see if you have the ATTiny core files installed by looking through:

Tools > Board

If you can find an entry that reads something like ATTiny85 @ … then you have it installed. If not, then go to here and follow the installation instructions. If you have to install the core files, remember to restart the Arduino IDE before you continue.

Using jumper cables, connect the ATTiny to the UNO using the following connections:

  • Arduino +5V      —>  ATtiny Pin 8
  • Arduino Ground —>  ATtiny Pin 4
  • Arduino Pin 10   —>  ATtiny Pin 1
  • Arduino Pin 11    —>  ATtiny Pin 5
  • Arduino Pin 12    —>  ATtiny Pin 6
  • Arduino Pin 13    —>  ATtiny Pin 7

If you are not sure of the pin connections to the ATTiny, you can download the datasheet from here. Look at page 2 for the pinout. For reference, here are the connections from the Arduino UNO to the ATTiny85:

Programming the ATTiny85 with an Arduino UNO

Programming the ATTiny85 with an Arduino UNO

Note that the pin 1 dot  on the ATTiny85 is at the top right corner of the chip in the diagram above – the yellow wire is connected to pin 1.

With the Arduino IDE open, first check that the board is set Arduino UNO. No go to:

File > Examples

and load the ArduinoISP sketch. Compile and upload it to the UNO.

Now place the legs of the 10uf capacitor into GND and reset on the UNO board, making sure that the short leg goes into GND. (If the jumpers are in the way, then you can always put the capacitor on the breadboard and connect it to the UNO with jumpers.)

Load the Stepper Motor program back into the IDE and change the motor pin definitions to the following:

// Motor pin definitions
#define motorPin1 0   // IN1
#define motorPin2 1  // IN2
#define motorPin3 2  // IN3
#define motorPin4 3  // IN4

This is necessary, as the port numbers are different on the ATTiny85 from those on the UNO.

Go to:

Tools > Board

and choose ATTiny85 @ 8 MHz (internal oscillator, BOD disabled). Also, go to:

Tools > Programmer

and select Arduino as ISP. Now compile and upload the stepper motor sketch to the ATTiny.

4. Connect the Stepper Motor to the ATTiny

Connect the motor driver board as follows:

IN1 –> PB0

IN1 –> PB1

IN2 –> PB2

IN3 –> PB3

For testing, you can connect both the ATTiny and the driver board to the Arduino to power them, as in the diagram below:

Connecting the stepper motor to the ATTiny (using the UNO as a power source)

Connecting the stepper motor to the ATTiny (using the UNO as a power source)

 

Here’s a picture of the ATTiny mounted onto a stripboard, and with a voltage regulator to feed it a steady 5V from a 11.1V lipo battery.

ATTiny85 with voltage regulator

ATTiny85 with voltage regulator

The stepper motor connected to the ATTiny:

Stepper motor driven by an ATTiny85

Stepper motor driven by an ATTiny85

The video below is a short clip of the ATTiny/stepper combo:

 

4. Fixing Broken Wires on a littleBits Fan

We have had quite a lot of littleBits fan modules with broken wires. The problem does not appear to be from misuse, but from poor design. The connector block is attached to the fan by two thin wires, which easily break off near to the fan motor. You can see the three most recent cases of detached wires below:

Three littleBits fan modules with detached leads

Three littleBits fan modules with detached leads

Soldering the wires back on isn’t difficult, but is fiddly. It’s a good idea to start by using a bit of bluetack on either side of the fan to hold it whilst you work:

Hold the fan with some bluetack

Hold the fan with some bluetack

 

The broken wires will still be attached to the solder pad on the fan:

Broken wires attached to solder pads

Broken wires attached to solder pads

 

Remove the old bits of wire from the solder pads using a soldering iron to give a clean(er) pad for soldering the wires back in place.

Solder pads on fan when old bits of wire are removed

Solder pads on fan when old bits of wire are removed

Notice that there are four pads marked, from left to right, A, -, + and I. The red wire goes on the ‘+’ pad and the black wire goes on the ‘-‘ pad. Tin the wires before you solder them on, as it makes the wires easier to solder.

Tin the wires before soldering

Tin the wires before soldering

 

Use another piece of bluetack to hold the wires in place whilst you solder them on:

Hold wires in place with bluetack

Hold wires in place with bluetack

 

Solder both wires in place using a small amount of solder:

Solder the wires in place

Solder the wires in place

 

Whilst this is fine to fix the wires in place, they will no doubt come off again fairly soon. A good idea is to glue the cable in place to stop the connections being strained. I use a hot glue gun for this, applying a small amount to the cable. First push the cable through the fan frame:

Push cable in place

Push cable in place

 

Put a blob of hot glue on the cable to lock it into position:

Hot glue the cable into position

Hot glue the cable into position

 

We have found that this technique really improves the life of the fan, though there is still the issue of it breaking at the connector block … we’ll find a fix for that one soon.

5. Fix a Selphy printer which shows cartridge empty, even when a new cartridge is installed

Took this Canon Selphy home to see if I could fix it, as it was destined for the bin:

When I switched it on, all seemed to be okay – it made the right noises, but when I attempted to print an image it claimed that the ink cartridge was empty. I tried a new cartridge, but it showed the same ‘Cartridge Empty’ error. Obviously, something was not right. A quick Google search revealed that this was a common error!

So, I stripped it down in stages. First removed the four little screws on the bottom of the unit:

Not much inside really – a circuit board for the LCD screen attached to the lid, and another circuit board on the chassis/mechanism. To get the chassis out of the box you need to detach the two ribbon cables from the lid, and remove three screws from the bottom of the unit:

The chassis then lifts out. When it was removed, I noticed that there was a little plastic gear that did not quite mesh with the others, and looked like it had something to do with the mechanism to drive the ink cartridge. You can see this below:

To get a better idea of why it didn’t mesh, I removed the motor – a single screw:

The gear literally just dropped off – not a great design, Canon. It looks like it was designed to fail, eventually, so that you’d have to buy a new printer. Anyway, as it is just a push fit onto the shaft, and the printer was destined for the bin anyway, I had nothing to lose so I headed for the bottle of superglue. A quick clean up with some alcohol to remove any grease, and a liberal coat of glue and the gear was back in place. I then screwed the motor back into the chassis and the gear meshed properly:

Back together again, just reversing the previous steps, and its printing again

There is still a minor issue with the paper tray – it does not engage very well inside the printer as I discovered. So to get it to engage with the stack of paper I had to apply a little pressure downwards on the paper tray. I think I can fix this with a small tweak to the chassis, but that’s for another day. It’s printing, which is the main thing.

2 Responses to How To …

  1. Uve Con Jota says:

    How do you find this motor scheme in prizzing?

  2. Kingarthursdog says:

    Can you be a bit more precise – not clear what you’re asking.

Leave a Reply to Kingarthursdog Cancel reply

Your email address will not be published. Required fields are marked *