controlling a flat bed scanner

SgtWookie

Joined Jul 17, 2007
22,230
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.
They have some interesting stuff over there :) (Favorites -> Add...)

Well, I'd been doing more thinking about it since my first suggestion of multiple switches/sensors for each track alignment, etc... and actually, all that would really be unnecessary if a stepper motor driven by a threaded rod were used; a microcontroller could easily keep track of the number of steps the motor had taken and "remember" where the rails lined up after it had been "taught" where they were. Mainly, it would just need limit switches at both ends to establish reference points.
 

SgtWookie

Joined Jul 17, 2007
22,230
sounds interesting Sgt. When you say microcontroller are you talking about a pic or what?
Yes; a PIC is a particular brand that falls in the generic class of "microcontroller."

Microcontrollers/microprocessors (also uC, uP) nowadays are really pretty amazing. Most of them are considerably more powerful than my ancient Radio Shack TRS-80 was when I first bought it. And for many functions, like the one we're contemplating here, it's a very compact and power-efficient way to take care of your project.

Using a PC for such a task would be like using a battleship to swat a fly. Sure, you could do it - but the overhead costs would be absurd and the reliability abysmal, particularly in the long term. For this case, the PC is best used as a general purpose R&D tool. You can "teach" a uC to "sleep" and save power; yet be alert in a millisecond. You can't really do that with a PC.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Sgt can you point me in the direction of some pic's to look at. I see some at mouser for about 10-15 dollars. What should I look for (memory, 8/16 bit) and any special brand you like. Sounds like they would be fun to play with and learn on. I do want to research pc's some more . Been reading up on the pci bus. sounds like it will be around for a while . I have more electronics that I want to incorporate into the layout like a bar code scanner to track the locations of trains or even individual cars. Then you have to have those crossing gates and what ever. Thanks Roger
 

KMoffett

Joined Dec 19, 2007
2,918
rogerw,

I'd like to suggest a PICAXE, for a microcontroller that might work for you. I'm sure others can suggest their favorate microcontroller, with supporting justification, but I've found this series to be easy to learn and use. It was designed for use in elementary and high school classes.

http://www.rev-ed.co.uk/picaxe/

They come in many sizes for 8-pin to 40-pin, are relatively cheap (as low as $3), are programmed in BASIC, have a free program editor, only require a serial cable to program from a PC, have lots of documentation, and have a very active user forum (some are model RR'ers).

I'm just a happy user. :D

Ken
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Thanks Ken, I will do my home work and read about them. It sounds like it is what im looking for. Thanks Roger
 

SgtWookie

Joined Jul 17, 2007
22,230
Here's a link to Microchip's page for stepper motor applicaton recommendations:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2125&param=en026706
Microchip's home page:
http://www.microchip.com

Microchip is the manufacturer of the PIC line of microcontrollers. Some of their devices are less than a buck. Some of them are OTP (one time program), others you can program multiple times. Some require a programming module (board) and others you can program with a very simple interface via RS232. Some have a built-in shunt regulator, which for you could be very handy if you want to power it directly from the tracks without building a separate power supply. Some have built-in PWM controls, ADC converters, the list is endless. It can be bewildering at first.

Try to keep your requirements in mind; that will help you weed out those that won't be really appropriate for your application.
Right now, your minimum requirements are:
1) Four control (output) lines to control the direction and step of the motor.
2) Two sense (input) lines for the end-of-travel limit switches
3) Optionally, a sense (input) line to positively detect that the stepper motor is rotating.
4) EEprom memory (to store the current step count; provides "memory" for current location of the table)
5) Easy programming interface

There are several ways to program these uC's; in Assembly Language, C, or PIC Basic. While Assembly language might initially seem intimidating, there are only 33 or so instructions that you have to learn, and you can maximize the utilization of your program storage.

I suggest you start off reading the brochures they have made available online.

Perhaps some knowledgeable PIC users will chime in here. I don't have any of these units, but I've heard many raving about them.
I have a couple of Parallax Inc Basic Stamps (BS2e, BS2sx), but those are many times the cost of the PIC units.

I think you'll find yourself quite impressed at the capabilities of these little uC's. With a few additional components, you could likely teach them to read barcodes and keep track of your rolling stock ;)

[eta]
I guess I shouldn't try to write a novel; there have been several exchanges between you and another board reader from when I started writing and actually posted this reply ;) PICAXE is a product of Microchip and is in the PIC line of uC's. Read all of the docs you'd like. You can order them directly from the Microchip website, and many other places as well.
 

KMoffett

Joined Dec 19, 2007
2,918
On the Picaxe web page, on the left side, check the link to a list of DISTRIBUTORS. There several throughout the world. I started with the "08M", an 8 pin chip with 1 input,1 output pin, and 3 combo input/output pins. Really good general purpose chip for small tasks. The next up is the 14M with more inputs and outputs and more functions. Then there are chip up to 40 pins with more speed, I/O's, and functions. The download-able manuals on the website are good for the beginner in micro controllers. And there is a link on the web page to the Picaxe forum (with archives) to give you a feel of what people are doing with these.

Ken
 

SgtWookie

Joined Jul 17, 2007
22,230
Roger,
Before selecting a uC, I'd suggest that the question of the current required by your stepper motor(s) be resolved.

At last report, the windings of the motor were 55 Ohms each, and the current limiting resistor is 42 Ohms. Did you manage to determine what the supply voltage was to the 42 Ohm resistor? Was it 5V?
The Darlington pairs driver IC would drop about 0.6V to 0.7V when conducting, so that has to be subtracted from the supply. If the supply is 5V, then figure 4.4V across the total of (42+55) 97 Ohms.
Current = Voltage / Resistance
I = E/R
I = 4.4V/97 Ohms
I = 45 mA (approx; rounded down)
Calculating backwards to determine the motor's voltage:
E = I x R
E = 45mA x 55 Ohms
E = 2.475 V
Somehow, I think your supply is higher - or else I've made a mistake somewhere. Without rounding the 45mA result value downward, I wind up with close to 2.5V for the final result.
 

Thread Starter

rogerw

Joined Dec 28, 2007
17
Sgt sorry been away from the keyboard all day. I cant get a good reading off of the resistor. Im reading 17.5 volts on one side and 16.5 on the other side. I cut the ribbon cable feeding the scanner part not sure if that had anything to do with readings or not. If I dont use that stepper for now and use the last one I showed you from the panasonic printer, will that work out better? I have the data sheet on that one.
 
Top