Saturday, 16 April 2011

Inverted Pendulum Part I

Foreword (no technical content)

For the best part of a year, I've been hoarding an old Dell Deskjet 720. As printers go, this was a pretty crappy printer. The ink cartridges or 'cash cows' as I like to call them, were only officially available through Dell and therefore very expensive. The Lexmark driver (for it was actually a Lexmark at heart) was closed source and buggy and the print quality was poor. All of these are probably explained by the fact Dell were giving them away free when I bought my first computer about 6 years ago. Here is what it is supposed to look like:
I had been toying with the idea of taking it apart and making something out of the parts but didn't really come up with any good ideas. There are already lots of projects such as RepRap which use printer parts to make rapid prototyping machines or similar CAMs. I don't really have the space or need for any of these at the moment so the printer went un-hacked.

Earlier this week I came across this project - a self balancing one wheeled robot. This reminded me of the inverted pendulum lab experiment which I'd done during my time at Southampton University. Labs generally weren't much fun, but I remember enjoying this one so I set about making an inverted pendulum out of printer carriage and some other parts.

Step 1: Tear-down
So far this has been the most fun part. I'm not sure how people can make those really long winded videos/slide shows of incrementally taking apart their newly bought I phone. Once I started disassembling the printer I soon forgot about photographing anything which is why there is a large gap in the photo sequence below:

This part was quite interesting. Most desktop inkjet printers use aqueous inks. Aqueous inks are volatile and if a print head is left exposed to the air for long (which could be a matter of minutes for some inks) then the water will evaporate from the nozzle plate leaving the less volatile pigments to block up the nozzles. In commercial inkjet printers, a lot of money and effort is spent trying to prevent the nozzles from drying up and becoming blocked between prints. In this Dell printer, there are two suction cups (one for black, one for colour) which are pressed up against the nozzle plate when the carriage reaches the extreme of its travel. Below is a close up of this mechanism. When the printer is switched on, the carriage moves left, pushing the suction cups down and out of the way.



The right end of the transport is shown below. The carriage, which by this time has been stripped down as much as possible, travels along the heavily greased steel dowel.


At the opposite end, a 24V DC motor is coupled to the drive belt. The belt was surprisingly easy to remove. The cog at the other end of the printer is mounted on a spring loaded assembly which makes it easy to remove and fit the belt.



I decided to leave the paper feed rollers in place, since I may find a use for them later. They too are spring loaded, so it is possible to feed fat media, such as a bare PCB through the mechanism without breaking anything.


A stepper motor which I currently know very little about drives the paper feed mechanism.


Step 2: The electronics

Not shown in these picture is a self contained 30V 0.4A power supply which fits into the back of the printer. It has two rectangular contacts which mate with the large steel contacts shown in the right of the picture below. This is the main print controller board which I have spent a little time inspecting. There is a Lexmark IC in the centre of the board which doubtlessly does the grunt of the data processing. The rest of the board is made up of a 1K Atmel EEPROM chip, two switch mode power supplies, a status LED, ribbon cable to carriage, stepper motor controller and DC motor controller. In the top left of the board is a photointerrupter which, coupled with a plastic flange, acts as the product detect, to notify the print controller that the leading edge of the paper has arrived at, or a known distance from, the print head.

The second and much smaller board is mounted behind at the rear of the carriage. It is linked by a flexi-pcb. This board has a single IC marked SC90105 which is about all I could deduce. I couldn't find a datasheet for the part so I can only guess at what it is for. Since this board connects directly to the electrical contacts of the printer cartridge, I'd guess that this is a shift register with high current outputs for driving the individual nozzles. I'm more used to working with industrial inkjet print heads, which are much different.

The black plastic block on the right is an optical, quadrature linear encoder. It has a slot through which the linear strip passes. The strip is printed with black bars to interrupt the photo beam inside the sensor. This is the part I'm most interested in, as I need to be able to track the position of the carriage in order to keep the pendulum near the centre of the transport.


Before disassembling the electronics any further, I powered up the electronics, outside of the printer confines, from my bench power supply. I was forced to power it at my power supplies limit of 20V, instead of the 30V it is designed for, but fortunately this was not a problem since I was only interested in the logic level signals. More of a problem was the 1mF capacitor on this board which caused my power supply to current limit for the best part of a minute while it charged up.

I concentrated on the encoder, trying to work out the pin out by viewing the signals on a scope whilst moving the linear strip. Once I acquired some extra hands, this was easy. The part has few markings and none that correspond to a data sheet. For this reason I post the pin out below:


The pitch of the encoder connector is not quite 0.1" so I was forced to straighten the right angle connector to lengthen the contacts enough to fit into standard strip board. The result was fairly neat and is shown below.



I did a quick test to check that the encoder could still travel unhindered along the rail.


The outputs of the encoder are either low voltage CMOS 3V3 or NPN/PNP. I'm not sure which yet. Now I have abstracted the encoder from the rest of the printer I can hook it to an MSP430 microprocessor and begin work on decoding the quadrature encoder outputs. I've done this on an FPGA before but not on a microcontroller. Should be pretty straight forward though. The board on the left is an old IO board from the Student Robotics project circa 2006.


Its been a while since I've done any electronics and some of my tools were showing signs of neglect. It turns out that an old Brillo pad is a great stand-in for a proper soldering iron sponge. The impregnated soap makes a difference from the usual soldering smell.

7 comments:

Gavin said...

Any ideas why there are such big capacitors about the place (especially on what seem to be more like sensor circuits - are they just decoupling?)

Most people found the inverted pendulum to be a terrible lab! I think that was mainly due to the fact that we hadn't really been the control theory properly before we did the lab, which oftened seemed to be the case!

Like the comment about the brillo pad - perhaps consider investing in a proper tip cleaner - they usually have brass (or at least brass looking) swarf like things (basically a brillo pad scaled up) but will be a lot gentler on the tip of your iron (although I have been known to file a soldering iron tip in the past, without issue....)

Chris said...

I think the big capacitor is there for charge storage and not decoupling. The cap is on the board which connects to the ink cartridges. When printing on all nozzles you could imagine needing a sizeable current to drive all the heating elements. I suspect this is why it is needed.

If you need a 1mF capacitor to decouple your power supply then you have probably ballsed up your circuit design somewhere :s

Chris said...

Ignore my previous comments. Decoupling and charge storage amount to the same thing. The point I was failing to make was that the print head probably momentarily draws large currents when printing, so large decoupling cap is required.

Smiler said...

Great post; I look forward to the follow-up! I like the hint about PCB printing in the future…

I share Gav's confusion: why would you want to do the inverted pendulum again?! Still, looks like a fun project, and I hope it works out!

Another theory for the 1mF capacitor: voltage smoothing. Switch-mode power supplies are noisy, and the heads might be sensitive to voltage fluctuations? So you wouldn't really use the charge stored in the capacitor, but you need a large capacitance to filter-out the low-frequency ripple voltage. It's half the reason amplifier power supplies have lots of big capacitors (that, and charge storage). Just a theory…

Rp Prototype said...

Find out best tips for making a circut. Basically i am Elcetronic Engineer want to increase my knowledge for that. when i visit here i decide that great for learning continue your effert for sharing new thing.

Francu Emilian said...

Hi Chris...i beg you if you can give me a schematic with the connections of the Quadrature Encoder sensor .I toked the sensor from a same printer. At the moment I don't know how to connect with the micro-controller, because I'm not very sure how to power supply the sensor...watching your photos i see a short wire, and don't know what is it for.That is way i need a schematic about wiring the sensor to the micro controller to understand how did you connect it.Please send me a email to byemi06@gmail.com.Thank you very much

Andrei said...

Hello Chris ! I am also interested on how you made 4 wires out of 5 wires. It seems like a short-circuit to me. Please provide a schematic, because I also have a similar sensor from an hp printer and I desperately want to connect it to an arduino( I hope it works, it has a 3v3 supply).

Thanks !