Sunday, October 08, 2006


Full XYZ Stepper control

I modified the printer-port control, and managed to get a total of 12 out lines (with a little special programming) running from that port.

3 of the 4 new Out lines are inverted, and have to be positive in software to be off on the port; nevertheless, it ran a stepper just fine after I compensated for that.

In short, we now have a simple way to run all 3 steppers via almost-direct printer interface. Heck, if we found a way to use the serial IO and printer Input lines, we might not even need a PIC for first generation prototypes. DC motors could probably be driven too if position sensors are attached to the input lines.

This comment has been removed by a blog administrator.
Good going!
How are you managing this in software?

Input through a parallel port isn't likely to be useful unless you're running DOS. Timesharing will steal timeslices from you and leave you wondering why you're missing pulses all the time.
Unless I'm mistaken, running the steppers is outbound only. You could run into some 'lag' or 'jerkyness', but I don't expect you'd lose any distance, and wouldn't get much impact on performance with a good machine that's not busy doing other crap.

Running the extruder/heating element on the other hand, could be more problematic. I've got my eyes on a PCI card that gives something like 72 IO ports, but I'm still worried about the heating element control (i've read enough problems with keeping the temperature consistant, lag on the pc will just compound that!)

You could turn on/off the heat with the pc, but I'd still put the temperature control on a dedicated chip outside the pc.
A simple analog circuit could be used for temperature control, just a comparator driving that big transistor.
How are you managing this in software?

I'm using a dll called inpout32.dll running through vb6 (c++, why do you mock me?) You can find it online with a google search, it works with plenty of languages.

I'm unsure on what the actual speed limit is through this, but I have personally tested it to roughly 3000 pulses per second w/o problems. I believe it is interrupt driven, meaning as long as you use high-precision timers in your code, it should be lag-free.

I know it's possible to get input using the same dll, but haven't tested it yet. There may very well be some frequency limits in there that need to be found, especially if testing hall-effect sensors on servo motors. A single output should be able to be PWM'ed at 3000hz or more.

You could turn on/off the heat with the pc, but I'd still put the temperature control on a dedicated chip outside the pc.

The serial port is still free in this configuration, which has ~4 inputs and a couple output lines, if driven at a low level. If the extruder and heater rate can be PWM'ed that way, it might just barely work.

Again, I'm really just pondering this as an easy way to repstrap, and not having to contend (at least in the beginning) with the downsides of using PIC's.

Any other ideas or possible problems I might be missing or haven't conveyed properly?
You can find it online with a google search, it works with plenty of languages.

The security hole that DLL operates through is going to be closed Real Soon Now(tm).

The upper limit is 300,000 polls per second. This is a hard limit of the IBM PC architecture, be it 8088 or Pentium IV.

It's not interrupt-driven unless you're using the interrupt line on the parallel port, which is unlikely when using it direct -- where would it go? which routine would it inform, about what?

The only other way to use the parallel port on Windows, besides writing your own printer driver, is to use it as a standard Centronics port, i.e. opening the file "LPT1".

Which'd take a bit more digital hardware, but is actually what I'd reccomend. Any OS can use the parallel port as a character device -- it IS a character device -- and the underlying logic could be kept the same instead of having to be rewritten from scratch wherever you go.

Lastly, developing for Windows, in a Windows-only language, with a Windows-only library, is about as far from universal as it is possible to get.
Could try...

Microsoft Robotics Studio 2006 (beta)...

It's free! :-D
Thx for the info Tylerm.
For the record, I'd never professionally code something in VB6, it was just a test with a language I'm comfortable with.

Using lpt port as a character device would be an interesting idea, too.
No problem. That's true enough; for experimenting, I still use QBasic sometimes!

You can see timing diagrams etc. for a standard centronics port here. Using it as centronics will give you eight data lines, and a strobe line that tells when data is transmitted so you can capture it with flip flops.

You could use four lines for multiplexing and four as data lines, or if you wanted to get really fancy, you could interface it to an i8255 chip and get 24 outputs...
Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]