Page 1 of 1

Help wanted;Counting from steppermotors (Via sensors)via LPT

Posted: Thu Aug 30, 2007 8:57 am
by Ac3T
Hi folks, I'm kind of a nubi at QB, although I've had it for years and years, I've never done anything quite as complex as I'm going to do.

Me and a good friend of mine had the idea of makin our very own NC-cutter or whatever it's called in english. The machine that can cut circular, angular holes and cut sideways etc.

I haven't, at the writing moment, made any working 'model' so to speak, but that part's quite easy. There's nothing to it really. Sure it takes a while to figure out a working constellation, but that goes for pretty much everything anywhere, right?

My problem; Since it's going to be equipped with multiple sensors onto &H379, or "889", as many of you know, it's the adress for LPT1's 5-bit input ports.

The problem that I'm going to have is that I need to be able to count tree bits simultaneous, yet keep them separated into three diffrent values (X, Y and Z, as in later on, coordinates). These needs to be readable throughout the entire program (Especially from within subs).

The simplest thing is really to use multiple ports, but it's slightly overkill, and at the same time not plausible since it's not easy to get ahold of / configuring old ISA- cards and getting it all to work, least of all, not for an old PII 233 MHz, and possible another motherboard incase it's going up in smoke...

I know this can be done, just not how, and that's where you guys come in =0)
I'm sorry, but I don't have any money to pay you, but I promise that I'll share everything (Schematics and codes) in case you're interrested...
I also would like to have a form of input method for new "programs".

It would really be kind of a drag if one had to manually input every coordinate everytime one needed something new drilled or so.


I was thinking; Best case, some CAD->CAM, but coordinates from a plain ASCII- file would due just fine.

As I said, I've never bothered learning / using advanced counters in & out of Subs, or opening files for input / output before, and I really need help with this.
I don't know if this thing's ever going to see the light of day due to these problems, but if it does, it's possible there's money in it too...

Not professionally, but private perhaps... Who knows, right?

At the very least, we'll (Or rather I) put the credits & Greets for those who've helped us.

What has to be built:
3-Axis control, using Driver- chip's with atleast 3 bit's to control them, possible one more for high / low speed.
Like Enable, Direction, Half / full- step, and 'externally' (Not in driver- chip) maybe a variable strobe (Square wave pulse-giver).


Some kind of control- matrix so that I can swith between the 3 axis. Most likely the input's on the Drivers are going to be latched (As in a short, 1-bit memory).

There might be even more output's for like additional axis (Like tilt & turn), but most likely switching speeds on the cutting-spindle (Thinking some kind of solenoid- driven gearbox at the moment, later issue though).


Geez... There's a ton of stuff that can, and can't be done here.
I think it's worth mentioning that this does not have to be extremely sophisticated in any way, just as long as it works.
So...? Any thoughts anyone..? :shock:
Yes, I'm nuts, but that my excuse, what's yours =0)
It's a funny project. Hard, but funny. Really straightens out your noodles


Bye 4 now from Sweden.
Yes, that green banana- shaped country, packed with wooden horses and Elks :P

For those who've noticed, I've changed the subject- content, sorry.

A crude schematic

Posted: Sun Sep 02, 2007 3:58 pm
by Ac3T
Made a very simple schematic, and any additional thoughts and ideas are most welcome.

Image

It's a bit crude though, and I'm not quite sure if I remembered the 3 to 8- decoders right...
Oh, yeah, saw something I've forgotten to write in the description:
The "Pulse generator" is a series of resistors that is switched by a CMOS '4066' circuit for diffrent stepping speeds.

And... *Sigh* Another thing:
I'd have to put in another 3-8 or something on the enabling- thingie for the &- circuits, else I'd end up controlling all of them.
[/img]

Posted: Wed Sep 26, 2007 11:57 am
by pebe
Hi again A3CT,
You have padded out your requirements more in this forum. A concept for the whole project is now beginning to come together.

pebe

Posted: Wed Sep 26, 2007 1:36 pm
by Ac3T
=0)
Well, I'm seriously considering to reconsider my schematic above.

I've had this idea to use another circuit, namingly the "UPD 71055
(8255A)" which has 3 x 8 bit's switch or however you want to put it, it's a programable peripheral interface- circuit.

So, the 8 bit's can be diverted to either of the tree set's of output- port's just by a two-bit input.

Another fine thing about this circuit, is that it's bi-directional, but I'm a bit skittish about using that function... I don't know how to change the direction for one, then its's the thing with the totem pole- output or wth it's called in english... The thingie that, if not being careful, could burn up the output's of, say, 2 paralell output's.

I hate (Swedish) litterature, since we adopt and then rape some english words, sprinkle with some messed up translations, and then we print it in the form of books or similar, and presto - There you are, totally clueless when the need is dire =0(

Posted: Fri Sep 28, 2007 9:26 pm
by pebe
It's time to close in your options a bit, rather than go round and round the problem. If you have decided to go the QuickBasic route then presumably you will be using the parallel LPT ports in some way. You need to start setting some parameters 'in stone'.

Why not firmly establish just what controls you need, and whether lines are required simultaneously on 2 or more motors? Only then can you get down to the nitty-gritty of deciding what other chips, if any, you need to do it.

Posted: Fri Sep 28, 2007 9:41 pm
by Ac3T
Hehe... Well, mostly I added that as an complement to the above schematic, I wasn't really thinking of the sensor- inputs... But merly thinking in general that it would be awsome to use it for other purposes... I don't know if I said so (Senile at 32... Beat that if you can... =0), but I'm building an home- alarm alongside the NC- project, hence my thoughts and ideas about that 8255A- circuit.

I'm still a firm believer about your ideas:
"If you did that then every time you went through the loop and Sensor1 was high, CountVariable would increase – about 1 million in one second!

You need to wait till the end of the pulse before increasing the count each time. Like this. I’ve also added count up or down depending on whether ‘dir’ is 0 or 1. I’ve left the blank lines to make easier reading.

DO
status=INP(889) ‘get the status register
‘the next 3 lines identify the state of register bits 3, 4, & 5
sensor1=status AND 8
sensor2=status AND 16
sensor3= status AND 32

....." Etc