Friday, November 27, 2009

Mine is bigger than yours

Finally got my new big stepper motor. It was bigger than I had realized and took some effort to mount to my system.

Then I learned to drive it. Turns out my greatest enemy is inertia. What I've built is just so damn heavy and massive I can't just start off the motor at full speed. Being a half-assed physicist I should know that already. But I guess experience is also needed.

So to get the motor running properly - careful speedup, slowdown and backslash delay at return need to be coded. Actually. I'm making this all up as I go, don't have any formal education and doing inertia calculations seems like a pain. So I try and see what works.

But basically I need to reduce weight. All that steel and heavy aluminium beams I'm moving along take a lot of effort. And cause excessive shaking of the whole machine resulting in some jitter at the printed page. Also the HP printer carriage is designed to slant forwards and backwards at different stages of the rail. The movement of the whole assembly though causes it to shake at the wrong places, more distorting the printed page.

However. It's not all that bad. Please enjoy my latest print:

The page is starting to look pretty nice:

Saturday, November 14, 2009

Chariots of Fire

I added my old USB chip (FT 232RL) to the game so that I can both control and get diagnostics from the microcontroller. The MCU runs at 20MHz now and I think it wouldn't keep up with the printer at any slower frequency. Getting diagnostics allowed me to plot the main roller/motor movement sequence:

I had a lot of trouble figuring out when to turn the paper sensor on. To understand what the printer does I had to rebuild the old printer from the pieces I had. And I discovered that there's a lever that is pushed when the printer head moves to the very right. When this lever is pushed - no paper is fetched if the roller turns. And paper fetching is actually done with roller turning backwards. But adding another sensor is a pain so I just deduced from the roller movement when it expects the paper sensor to turn on.

This happens when the roller moves backwards, then sits still for 450-600ms, and then moves again backwards. A few cm after that I will turn the paper sensor on and printing commences. The paper-on period is between the two vertical tics on the image.

Another thing I discovered is that the printer is, well, too fast for my rig. It scrolls paper through at mindnumbing 12cm/second. While my rig can probably do 2-3cm/second. However I can control this by printing my stuff inside a box/frame. That forces the printer to slow down. But even that is not enough, the edges get distorted due to slow movement. I need a stronger stepper motor.

This shows my completed rig, with everything I've built so far attached:

There were a few quirks getting the printing working though. Had to add a few hacks. But after some fiddling it finally started working.

The printed page from this video looks like this:

It is a bit fuzzy but it's mostly down to the printer head being too much distance away from the paper surface, paper being slanted and also the print head itself is slanted. So lots of fiddling to do to get to better quality.

Phase 1 successful. I need to give this project some rest now as I've lagged behind my other responsibilities.

Thursday, November 12, 2009

Progress

I can report some progress. The paper jam errors I got before are over. Printer now properly initializes, cleans itself and goes into idle mode. The problem was with my motor response timing and the way I had coded it. Fixed now. I also modularized my designs so everything goes through the energy chain now.

Initialization sequence can be seen from this video:

Printing still does not work though. When I try to print I eventually get a paper/cartridge jamming error. But what I've got now is I think a purely software problem. Will have to try new things again to resolve this.

Update-update. Now I get an out-of-paper error. Yay. Need to figure out now when to turn the paper sensor on. But first I'm going to get some diagnostics.

Reverse engineering

So after the hassle I decided to reverse engineer the optical paper roller position sensor so that I can fake it digitally. I attached a set of wires to it to see what was happening:

After running oscilloscope I determine what each wire did. Only two of them had a changing signal when the wheel turned - we've got a 2 channel encoder. This is what the wires represent:

  • BLACK (pin 1) - ground, 0V
  • BROWN (pin 2) - channel 1
  • BLUE (pin 3) - +5V
  • RED (pin 4) - channel 2
  • ORANGE (pin 5) - +3.3V
  • YELLOW (pin 6) - the other side of the LED

The sensor has pretty much the same layout as Avago's AEDS-965X. Here's a picture off that item's PDF file:

So what was left was to desolder the sensor and attach proper wires I could fake my own signal on:

Now with wires there I could start generating a circuit. I spent a better part of the night trying to make it work. It tended to just crash the printer. Finally I realized it was an electrical problem - I was drawing way too much current from the +5V source - apparently there's a really weak current pump behind it.

I also realized that my motor-on sensor was not working 100%. After fixing that it started working like a charm. Here's the basic circuit I used:

So can I print stuff now? Not really. The printer has some really fancy mechanics inside of it. I think it runs the motor at several power levels and expects it to get stuck on some gear or lever. As that doesn't currently happen it eventually ends up in an error. I'm not really sure how to fix this properly as I didn't take any proper measurements or recordings on how the printer actually is supposed to behave. There are lots of gears and systems inside it and I didn't really investigate how they all work in unison.

So more to do. Perhaps I still do need a second version of that printer so that I could properly observe its workings in its prime to replicate them.

But all in all I believes this reverse engineering and sensor faking was a success.

Wednesday, November 11, 2009

Driver

Finally my stepper driver arrived. Now I don't need to use my own home-grown driver circuit.

The benefits are: DIP-switch controllable current (up to 4.2A, my own circuit only does up to 1.5A) and sub-stepping up to ludicrous levels (using Allegro A3955 I get only down to 1/8 steps). And it's very easy to use. Just plug it in and it does its work. I just have two pins to worry about - direction and pulse. It steps the stepper itself. The downside of course the price.

Unfortunately the speed I hoped for did not really materialize. If only slightly. Currently I'm unsure if it can keep up with what the HP control circuit expects. If not - need to get a better stepper motor. But that's easy - just need to plug it in, driver takes care of the rest.

And on another note I found out why my printer got paper jam errors. The contraption to move the sensor was just not fast enough. I down-geared it by around ~1:4.45 because the encoder wheel has 1200 dashes while my stepper does 400 steps. Instead I should have relied on sub-stepping the motor and attached the encoder directly. If I overdrive the motor I can almost get it to work. It even started scrolling out the paper when the paper sensor was on. But its checking systems move it forw-back very sharply and the stepper tends to jam on that.

I don't feel like rebuilding the stepper thingie right now so am instead reverting to reverse-engineering the sensor. I've already attached wires to it and it seems to indeed be a two-channel system. Though I haven't really got the sense of all the pins, only two of them seem to have any sensible life in them as can be seen on the following picture:

As you can see the green leads the yellow - two channels being covered by the encoder strip as it moves.

Tuesday, November 10, 2009

Remote sensing

The printer's paper motor runs on 32V. To get the signal from that I'm going to use an optoisolator. But the motor can run both ways and so I need to protect the LEDs inside the optoisolator from the huge reverse voltage.

Now I'm not absolutely certain this is the way, but I went with protecting them using another diode plus adding a big resistor to take care of the reverse current still leaking through.

And this is the resulting circuit. Seems to work fine so far. The optoisolator I'm using is HCPL 2631.

Unfortunately I can't report success yet. I get paper jam errors no matter what I do at the moment. Have to investigate more. Perhaps the stepper is too jumpy. Or too fast. Or too slow. I think I need to get another printer of this kind to get a solid reference and make a comparison.

Monday, November 9, 2009

The fifth wheel

I have a problem. The paper roller of the printer has an encoder wheel attached to it. So the printer uses that to determine how much it has scrolled the paper on. It's all driven by a simple DC motor.

Now as I don't have the roller anymore but I move the printer itself instead. How do I tell the printer board how much it has moved. I basically have three options:

  • Attach a roller to the side of my table and have it roll on something. While it seems simple and straightforward I see several problems. For one making such a mechanical system is actually not that simple. Secondly I want to move the printer around myself, as it needs to move backwards. If the printer board sees it - it'll detect a malfunction and panic. Also the printer logic has some redundant roller moving on itself - its head cleaning cycle for one - I don't want to move for that.
  • The second idea would be to reverse engineer the sensor and feed the printer with fake electrical signals. The problem here is that I have not managed to find a specification for this sensor. And as I'm not familiar with them I don't really know where to start. It seems to have 6 leads. Two are probably for the emitter led, and the others are probably two pairs for two phototransistors. So it's probably a two-channel sensor.
  • The third and the silliest option is to use a separate stepper motor to drive the encoder wheel myself. So I can fake it for the printer properly. And that's what I've done for now. Later on I should try reverse engineering the sensor itself using an oscilloscope. But for now, I went with the silly solution.

Here I used the timing belt of the actual printer's paper motor. But I reassembled it between two aluminium pieces. The stepper motor is the same I got off eBay.

Friday, November 6, 2009

I'm watching you

I need a sensor to determine when the assembly has moved to the beginning. I was thinking of using an optical sensor to do it. Once I've determined the start position, I can just count stepper steps to know where exactly I am in reference to it. To the right is the schematic of the circuit I'm building. I'm using Osram's SFH9315 slotted sensor. It consists of a LED as emitter on one side and a phototransistor as sensor on the other side.

Here's the completed circuit:

Now I just need to figure out how and where to mount it on my table.

And here it is:

Thursday, November 5, 2009

The Force is all around us

I finally got everything machined and connected. Behold, it moves!

It is a bit slow at the moment. Though I can live with this. The motor is specked as having 0.36Nm holding torque. However my drive circuit is pretty primitive and does not squeeze the maximum out of it. I've ordered a driver board that hopefully will get more speed and power. Here's the table in a high resolution photo:

Tuesday, November 3, 2009

Driving a stepper

So I managed to build a circuit to test-run the stepper motor. I used two Allegro A3953 IC-s to drive the two coils of the motor.

The motor is actually a 6-wire motor, ideally driven with a unipolar driver. But as I don't have that I just used halves of the coils and ran it as bipolar.

I got this motor off ebay. It's a 400-stepper, very small, cost me 8€ including shipping.

Vises and vices

I finally got my cross vice (or cross vise for American english). Amazing how these two languages are diverging.

Also I got a few stepper motors I can start playing with now. As I don't really have any experience with them.

I also have a ball screw attached to the rig. I got it a few weeks ago and had the ends machined. Also I got some oldham couplings - that is a way to connect the shaft of the stepper to the shaft of the screw. The black belt to the right is the energy chain.

Monday, October 19, 2009

And the Lord God formed man of the slime of the earth: and breathed into his face the breath of life, and man became a living soul

I finally managed to properly assemble my build platform. The frame is made out of aluminium profile. There's a company around that sells and cuts it to size. Pretty cool stuff to work with. I'd say this is like LEGO for engineers (engineers, not adults:).

At the top left corner you can see a bearing unit. I'm planning on putting the ball screw through it. But at the moment that's still in transit. Plus I need to get its ends machined somewhere.

Saturday, October 10, 2009

Rail, first try

Now that I have drills and stuff I can make some proper holes. And this is the first result. The printing head mounted onto rails.

This video shows it "working". I have yet to construct a platform to mount it to and also I lack the means to propel it back and forth. I'm planning on using a lead screw.

Bench drill

A week ago I tryed to make a hole into a thicker aluminium piece with my makita hand drill. And. I failed spectacularly. The hole was not straight enough so that once I mounted the detail to a motor axel it was just wobbling all over the place.

So I decided to get a bench drill. Most probably a slight overkill but will be useful. Here it is. Optimum's Quantum B14: 350W, 520-2620 RPM.

Friday, October 9, 2009

Tool rack

It could be I'm a tad crazy. But I decided to get a tool panel. Here it is:

Friday, October 2, 2009

Playing with a DC motor

So I got the DC motor yesterday and all the chips to run it with.

Here's my setup with the motor:

The motor is a 4.5-15V up to 22W with a 750:1 gear reduction. But it seems I got the wrong motor. You see I mixed up RPM and RPS in my head for some reason. Haven't worked with motors before so.. But still pretty embarrassing. Don't tell anyone.

I'm using a RECOM R-785.0-0.5 DC/DC converter to make 5V for the logic chips out of the supply voltage (works in wide range so good for my testing).

Motor is run using an Allegro 3953 full-bridge PWM DC motor driver. One thing to note here is that I burned my first chip at motor braking testing, probably because I didn't bother to properly setup the sensing pin. Then again I haven't dared to retry braking using my second and currently only chip. There was some smoke, panic and excitement. Fortunately it seems nothing else burned.

And everything is controlled with an ATMEGA48 microcontroller. I moved on to using its PWM functionality (instead of the inbuilt PWM of the Allegro) to modulate the motor.

Now I've been playing with this motor here to get an idea how it works but found another way to play it. Forgive the pun. Here's a video:

Basically, when doing very high frequency PWM the shaft inside the motor tends to just vibrate. Here's a better melody, a known tune by Beatles:

Wednesday, September 30, 2009

Power supply

Today got my brand new bench power supply I can use for high current/high voltage applications. I have run all my previous electronics projects off simple batteries. However, this project here requires experimentation with high current DC motors.

So the model is MATRIX MPS-3005L-3. It has one fixed output at 5V/3A and two variable outputs at 0-30V/0-5A. It has a big-ass fan at the back that is quite noisy. But I guess that was to be expected. Pretty heavy too - 8kg.

It is clearly Chinese though, as all cheap electronics these days. This can be readily verified from this chinglish:

Thursday, September 24, 2009

It's Christmas Come Early :)

I got some tools I need for this project. It seems so far I have not lived like a man. I didn't even have a hacksaw. I do now :)

Sunday, September 13, 2009

Into pieces

Today I found time to pull it into more pieces. No going back now.

This is the printing rail: It slides on an aluminum pipe, driven by a motor with two leads. Probably pulse modulated then. Positioning information/motion control is provided by a BPW encoder strip.

This is the underside of the printer:

And this is the brain: Paper is driven again using a two-lead motor. Motion/position control is provided by BPW wheel and I'll probably use it at my end application. I'm going to cover up the cartridge/printing heads with some tape to prevent them from drying up. It'll probably be a month or more before I can put life back into it.

Thursday, September 10, 2009

A printer acquired

Welcome to my gray projects. Here I will try to document my activities in trying to make something cool.

The aim at the current project is to build a 3D printer. It will be difficult as fair amount of mechanical engineering is involved - all I'm accustomed to is moving bits around.

So I acquired a printer. I picked the HP F2280. It only has one print head but they are replaceable. This allows for easy and relatively cheap experimentation with bounding agents. When I get there one day.

Here it is: Cost me $60. Will now try to print a test page using Linux and then I will head on to destroying it. This will be fun. Yes.

The aim is to utilize the inkjet printing mechanism, so basically leaving the printing functionality intact. But replacing the ink with adhesive.

It uses cartridges c21 and c22. c21 is the black ink and c22 is the tricolor ink. Both cartridges are installed side by side. Yay! I can do color printing :) There are instructions on how to refill them. This same mechanism can be used to actually replace the ink with something more useful for our purposes.

Printing a page under Linux took a bit of juggling, but finally worked. Then I decided to take my first action, and opened the cover. The scanner side is just a piece with embedded motor, gears and rollers. The timing belt is made from hard plastic.

[0]indrek: envy me :)
[5]logan: oh ok
[5]logan: what am i looking at indrek?
[0]indrek: a hp printer. opened up. ready for surgery.
[1]ns: indrek can you fix printers
[1]ns: could u fix my espon printers indrek
[5]logan: what are you going to do to it?
[0]indrek: terrible things. muahahaha!

Here's where the middle part has been lifted off: