controlling a flat bed scanner

Thread Starter

rogerw

Joined Dec 28, 2007
17
Im am starting a project that will use a flat bed scanner to make a transfer table for my model trains. Here is a picture of a train transfer table.

The flat bed scanner has a parallel port on it and I need some way to talk to the port from a pc. I am not sure if I should use the scanner as is or just use parts from the scanner (stepper motor ,ic chips) to make the table. Here are some pictures of the stepper and circuit card I have to work with.




So first off any thoughts on controlling the parallel port.
Thanks in advance Roger
 

SgtWookie

Joined Jul 17, 2007
22,230
Hi Roger,
Interesting project! :)

I suggest that you'd be better off to get away from the parallel port idea. The scanner was designed to scan objects, not control a train transfer table. However, it's a bonanza of parts that should work well with your project.

See if you can find data on the stepper motor, or the ICs used to control it.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Thanks for the reply Sgt. I was thinking that if I just used the part of the scanner that positions the scanner head and not worry about the rest of the scanner operations it might be easy. If I go with the parts that are available on the scanner should I just work from the stepper motor and work backwards? I have tryed to search for info on that stepper and am coming up with little. Where is a good site to get specs on these? Thanks Roger
 

SgtWookie

Joined Jul 17, 2007
22,230
Hi again Roger,

Yeah, I did a good bit of searching and came up with next to nothing myself. Seems like that manufacturer is either out of business or got absorbed into another company.

But let's just go with what you have for now.

Looking between your board and your stepper motor, I can see that the motor has five leads that connect to the board in the upper right corner:
Red, Orn, Yel, Brn, Blk
One of these leads is common to the rest of them. By disconnecting that connector and measuring the resistance between all of them, you will discover that one of the leads has half of the resistance to the other leads than the rest of them do. That is where the stepper motor gets it's supply voltage. Right now, it looks like the red wire is the common, as the large resistor seems like it might be connected to it - but I can't tell for certain with the photos you've supplied. The value of the large resistor is 42 Ohms, 5% tolerance (Yellow = 4, Red = 2, Blk = 0 (number of zeroes in the 3rd position) and the gold is the tolerance.)

You have a unipolar stepper motor, which is the easiest to work with. Even when it eventually fails, it won't be hard to find a suitable replacement.

The four individual coils in the stepper motor are energized in sequence by grounding via the ULN2803 IC, just to the left of the resistor. This IC contains eight Darlington transistor pairs and associated diodes for supplying power to inductive loads, such as motors and relays. The four thick traces indicate to me that is what section of the IC is being used to drive the motor. Since this is a surface mount device, you might opt to replace it with a DIP unit, which is easier for a casual hobbiest to work with - however, you could attack it with a soldering iron, solder wick and flux, perhaps scrounging it anyway ;)

The controlling inputs to the ULN2803 come from what looks like a microprocessor, and I can't read the markings on it. That's really not much of a consequence, because its' program would not really be applicable to your current project.

Trying to leave the board as-is and connecting it to a computer will complicate things considerably. Your transfer table will have to have proximity sensors for when the tracks are in alignment, and limit switches to prevent the transfer table from overrunning the ends of the table. These might be microswitches, optical sensors, Hall-effect devices, etc - that you would all have to interface into the computer, sense, and control using a program. You'd be better off using a dedicated microcontroller, such as a Basic Stamp or a PIC. PIC microcontrollers are extremely attractive due to their wide variety of options and very low cost; a few bucks each. Basic Stamps are fairly popular, but are considerably more expensive. There are myriad more options, but I suggest sticking with one of those two, as there are several folks on the board here that use one of those two.

Right now, you have the basic hardware in the stepper motor, the ULN2803 driver IC, the power supply from the scanner, and hints as to the current required in the big 42 Ohm resistor - looks like its 2 Watt. Measuring the voltage on both sides of the resistor (power on the supply, of course) will help us zero in on the current requirements of your stepper motor. As long as you keep the current through the motor equal to or less than what that resistor has allowed, you won't shorten the life of the motor.

After the current is determined, you decide on what types of sensors to use to locate the transfer table, what kind of inputs to control the table you wish, then you'll need to decide on a microcontroller and write a program to move the table.

It's not as hard as it sounds. Really. :)
 

SgtWookie

Joined Jul 17, 2007
22,230
Here's a couple of images that'll help you determine which stepper wire is what.

When using an Ohmmeter to check resistance between the various wires, if one of them is not common, your resistance will be higher, because you will be reading through two coils in series:



But once you find the common wire, you'll be reading through only a single coil:



Whatever your lowest reading is, that in conjunction with the 42 Ohm resistor and the voltage you read on the 42 Ohm resistor will tell us the voltage and current rating of the stepper motor.
 

SgtWookie

Joined Jul 17, 2007
22,230
The chip that says EliteMT on it is a dynamic RAM, 256K x 16 bits DRAM EDO in page mode. Save it if you can, might come in useful in future projects. ESD precautions apply. Datasheet for it is here:
http://www.alldatasheet.com/datasheet-pdf/pdf/84054/ESMT/M11B416256A-35J.html

I neglected to add before that the ULN2803 was designed to be controlled via TTL-level input signals. ULN2804 IC's are designed for control by CMOS. The basic difference between the two is the resistance in the inputs. You COULD use the ULN2803 with CMOS signals, but you would need to add about 7K Ohms more resistance in series to each input to reduce the current from the CMOS device.

I can't make out the symbols on the top of the microcontroller. Some of those have flash memory that can be erased and re-programmed. If you post what it reads, we might be able to find a datasheet for it - but then again, it might have a "house number" label, and it wouldn't cross-reference to anything.

Working with SMD's isn't all that bad; if you have a laserprinter and a toaster oven ;) Tom Gootee has a page that shows how to make PCB's using a laserprinter.

The small IC next to the power leads on the left that reads "7805" is a +5V regulator IC. Those are always handy to have.

I can't read the part number on the small IC that's labeled "WM".

The cylindrical orange objects near the big 42 Ohm resistor are diodes. Try to not get them too warm when de-soldering.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Sgt I did the ohm meter on the stepper motor leads and you are right 55ohm on red to all others and 110 between all others. Can I control the stepper with the uln2803 if I use the ttl signal from a computer. I had built a card many years ago (15 or so) that would read reed switches and report back to the pc using the bus on a card slot of the computer. It was primitive but worked.

could I hook up the uln2803 inputs the same way To the bus?

Also I came across some more steppers. whats your thoughts on these


I believe this is what controlled the the first one but not certain.

Thanks Roger
 

SgtWookie

Joined Jul 17, 2007
22,230
Sgt I did the ohm meter on the stepper motor leads and you are right 55ohm on red to all others and 110 between all others.
OK, so far so good. Did you manage to measure the voltage on that 42 Ohm resistor, or is powering it up no longer an option?

If you can no longer turn on the power, see if one side of that 42 Ohm resistor has a trace that leads back to the 7805 regulator IC, or at least try to determine what was supplying it with power. Your stepper coils are 55 Ohms each, the resistor is 42 Ohms in series with that, for a total of 97 Ohms. If you can determine what the voltage was, then we can easily figure out the current rating of the motor. Since the resistor appears to be 2 Watts, and it's 42 Ohms, the maximum voltage across the resistor would've been about 9.16; and the max voltage across the motor and resistor in combination would've been around 21V. With a higher voltage, the resistor would eventually burn up.

Can I control the stepper with the uln2803 if I use the ttl signal from a computer. I had built a card many years ago (15 or so) that would read reed switches and report back to the pc using the bus on a card slot of the computer. It was primitive but worked. Could I hook up the uln2803 inputs the same way to the bus?
Well, to be more correct - you could drive the stepper motor using the ULN2803, and you could control the ULN2803 using inputs from the bus. ;) The question is, do you still have a working computer that your card will fit in?

It looks like that's an ISA bus card, and ISA bus slots haven't been available in most computers for a number of years now. Reason being is the ISA bus is limited to around 10MHz - and current computers are using bus speeds of 500MHz and higher. Leaving legacy ISA bus slots in current-design PCs would be like using a Ferarri to tow an elephant. :eek:

Also I came across some more steppers. whats your thoughts on these
Great! They have documentation on them :)
I believe this is what controlled the the first one but not certain.
The SLA7020 is a nice chopper driver for unipolar stepper motors. You could use that IC to drive a wide variety of stepper motors, if you know the ratings of the stepper motors and follow the recommendations on the datasheet.

You can download a datasheet from:
http://www.alldatasheet.com
Just plug in SLA7020 for the part number, and click the button.
When it shows the icon below "Datasheet", click the icon.
You'll still need to click the "Download datasheet" on the next page.
Then you save the datasheet using the File/Save in Adobe Acrobat.

Yeah, it's a pain - they want to make sure you see the advertisements. But you get the datasheet without having to pay a subscription fee.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
I should be able to power up again, will check on that. Sadly I do still have my old xt around ( hey I paid 2 thousand dollars for it back in 88 hard to throw out something that expensive :D) I used it for experimenting with back in the days. Good point about the old ISA bus no sense working with the older bus. Should I keep this tread going or should I start a new one on steppers? This tread has pretty much lost the scanner part of it. Im new here and not sure what is best. And lastly if I dont respond to fast, im not ignoring anybody just trying to learn as I go along and do my home work so I can learn. Again thanks Roger
 

SgtWookie

Joined Jul 17, 2007
22,230
I still have my 1st computer; a TRS-80 Model I that I bought in 1978 for $630. :eek: By the time I got done outfitting it with upgrades (numeric keypad, 16K RAM, 16K ROM, expansion interface, 32K RAM for the interface, three 5 1/4" FDD's, dot-matrix printer) I'd spent around $2500 on it. :rolleyes: That was about 6 months' worth of after-tax pay when I was on active duty. I know what you mean about not wanting to throw out something that expensive.

I'm not worried about response time, neither should anyone else be. If they are, they're in the wrong place ;)

While you COULD continue on and try to develop something with your now-ancient computer, you will soon run into the fate of all such ancient electronics; failure of a part that is made of unobtanium. Unobtianium is not always unobtainable, but usually comes at great expense after many, many hours of research, and the failure of one unobtanium component prompts neighboring unobtanium components to fail in a similarly expensive and time-consuming manner.

This is why I suggest using something like a PIC microcontroller, as they are ridiculously inexpensive and extremely compact for the power and functionality you get.

Instead of starting a new thread, you might consider changing the title of this thread to reflect it's changing nature. How about:
"Stepper motor control of a model RR transfer table."

Otherwise, we'd have to constantly refer back to this thread to get the background info on your components.
 

SgtWookie

Joined Jul 17, 2007
22,230
can I change the title or do I need a mod to change it?
Actually - I can't answer that question, as I've never tried it!

However, see if you can edit your very first post in the thread, and change it there. If you can't change it there, then a moderator would have to do it.
 

SgtWookie

Joined Jul 17, 2007
22,230
Sgt I dont know if it worked just hope I dont get baned my first week:)
LOL!!!

No, it didn't seem to work; the new title actually wound up being inside the 1st post of the thread. Well, if the mods see fit to change the title of the thread, they'll do it ;)

Meanwhile, we're getting off the topic now... pretty soon they'll change the thread topic to changing the topic of a thread, and then we'll be REALLY confused. :rolleyes:

While you're thinking about stepper motors - have you considered how you'll couple the motor power to the transfer table? Is the transfer table in the photo the one that you constructed, or is it in the planning stages, or...?

Getting your transfer table perfectly aligned is going to be tricky, to say the least. If you don't get the track alignment within a couple of thousands of an inch, you'll literally wind up with a train wreck.

Using a stepper motor to turn a piece of threaded rod would be a good way to provide very precise positioning, and at the same time it would be nearly impossible for an engine to disturb the alignment, considering the mechanical advantage, if the threaded rod were of a sufficient diameter and properly supported using precision bearings. If you used, for example, 1/4x20 TPI threaded brass rod (around $4 for a 3' length online) coupled to a stepper motor that was 1.8º per step, you would have a resolution of 0.00025", or 4,000 steps per inch (this assumes your rod support bearings and your threaded nut attached to the table are pre-loaded for zero lash). Half-stepping the motor would make it run more smoothly and quietly, and provide you with 8,000 steps per inch.

Some typical control sequences for stepper motors are
Normal stepping (a "1" indicates an energized coil, "0" indicates a deenergized coil)
1234 (coil lead wires)
1000
0100
0010
0001
(repeat)
Full stepping (uses twice the current of Normal stepping, has about twice the power of Normal stepping for heavy loads, rapid changes in speed and higher top speeds, but twice the heat)
1234
1100
0110
0011
1001
(repeat)

Half stepping (more precise positioning, averages 1 1/2 times "normal" current)
1234
1000
1100
0100
0110
0010
0011
0001
1001
(repeat)

More to chew on, right? ;)
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
No Sgt that is not my transfer table just wanted to show what they look like. The building of the table is still another project. I havnt gave to much consideration on weather to use the rubber belt from the scanner or go with a threaded rod. the rod sounds like a good idea though. Would it be possible to use some thing like a elevator type system? Using two windings, when the track gets close to where it needs to be(maybe 1/4 to 1/2 inch), trip a micro switch that would open one of the windings and do smaller steps until micro switch #2 is triped and stops completely. I am trying to reread what you said about the windings above. I may have that backwards as far as half stepping and full stepping.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Hey Sgt not related to this project but wanted to show you how the trains we played with as kids are not the same anymore. Now the hot stuff for 10 15 years is DCC digital computer control. Every loco has a chip in it and you can run a hundred trains on the same track at once independantly. Here is a model loco in HO.
 

SgtWookie

Joined Jul 17, 2007
22,230
Yes, I've been on-and-off again picking up a model railroading magazine and persusing it. Pretty interesting, all of the advances that have been made over the years. :)

Now that you jogged my memory, I received my very first train set Christmas of 1957, a Lionel "O27" gauge steam engine with smoke in 2-6-4 configuration, a tender, several freight cars and a dull red caboose. There were just enough sections of track to make an oval around the base of the Christmas tree. :) Over the years, pieces got added here and there; first more track sections and a couple of manual switches, more cars, and in my young teen years when we moved to a house with a larger basement, I wound up with 17 freight cars, a 2nd 2-6-4 steam engine that had whistle in the tender, a diesel freight loco that I used for a switching engine, and a double "A" diesel loco with a half-dozen passenger cars including a dining car, several electric switches, and had the whole thing laid out on three 4x8 sheets of plywood in a corner of the basement. Still have that stuff up north at my folks' place; I don't have a basement here and O27 takes up a lot of room. I don't really have the time or space to fiddle with all of that stuff nowadays.
 

beenthere

Joined Apr 20, 2004
15,819
This is jumping in a bit late in the thread, but I wonder if a gearhead DC motor and some microswitches wouldn't do the transfer table thing with a bit less elaboration. Take a look at the stuff here - http://www.sciplus.com/ - and see what you think.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Thanks beenthere , its never to late to jump in. With a dc motor will it have some run on after power is shut of? Im not sure if it can be controlled as precise as a stepper
 
Top