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

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Ac3T
Newbie
Posts:5
Joined:Thu Aug 30, 2007 8:08 am
Help wanted;Counting from steppermotors (Via sensors)via LPT

Post by Ac3T » Thu Aug 30, 2007 8:57 am

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.

Ac3T
Newbie
Posts:5
Joined:Thu Aug 30, 2007 8:08 am

A crude schematic

Post by Ac3T » Sun Sep 02, 2007 3:58 pm

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]

pebe
Full Member
Posts:33
Joined:Tue Apr 02, 2002 12:19 am
Location:Scotland

Post by pebe » Wed Sep 26, 2007 11:57 am

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

Ac3T
Newbie
Posts:5
Joined:Thu Aug 30, 2007 8:08 am

Post by Ac3T » Wed Sep 26, 2007 1:36 pm

=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(

pebe
Full Member
Posts:33
Joined:Tue Apr 02, 2002 12:19 am
Location:Scotland

Post by pebe » Fri Sep 28, 2007 9:26 pm

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.

Ac3T
Newbie
Posts:5
Joined:Thu Aug 30, 2007 8:08 am

Post by Ac3T » Fri Sep 28, 2007 9:41 pm

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

Post Reply