analog to quadrature converter?

Yes, with such a scheme, the input data just isn't there. I am looking for a responsive feel for a pong video game.

Reply to
Mad Scientist Jr
Loading thread data ...

my bad , sorry... wont do it again... i will give back to everyone in the form of a cheap pong paddle for the people.

Reply to
Mad Scientist Jr

Yes that is exactly what I need, but the problem is they only go up to

36 cycles / rev. I am looking for more like 256, and it has to work with available power (5v 0.5 mA)
Reply to
Mad Scientist Jr

You mean the little optical sensor like inside an older mouse? I have thought of that but how hard is it to wire up? Do you need to know electronics?

Reply to
Mad Scientist Jr

Yup on all counts... I would have hacked the mouse but again I don't know what kind of input/output the mouse gives. Also I want to stick to the ke72 keyboard input. My goal is to read 4 or more paddles and make a cheap and easily built PC 'pong' game interface. Because quadrature at the resolution I need is so data intensive, and for 4+ paddles that might overload the keyboard bus, I am thinking rather than quadrature, just get some off the shelf DAC converters that just read potentiomoters and send absolute values - for 4 paddles that is 36 inputs (8 bits + 1 fire button each). Any idea where to find one? I am going for Cheap and Easy.

signals to just two of the 72 'switch' inputs and polling them in your PC software?

J> >

Reply to
Mad Scientist Jr

--
Good luck!  He wants a disk diameter of about an inch with 255 holes
in it.

That means that if the holes are 1/16" in from the circumference
they\'ll have to have a diameter of 0.0054" for a mark-to-space ratio
of 1.

I don\'t think he\'s going to find that anywhere for cheap.
Reply to
John Fields

Is THAT all you want to do?

You're making a very hard solution to an easy problem.

Video game steering wheels use a pair of infrared transmitter/receivers (so you can tell direction) and a disk with holes in it. Been working fine since I entered the industry as an engineer in the mid 80's.

You can have as high a resolution as you want by increasing the number of holes in the disk as well as the diameter of the disk. Working on below:

Sens1 Sens2.

You modify your program code so if sens1 detects a hole before sens2 then it interprets it as turning right. If sens2 detects a hole before sens1 then it interprets it as turning left.

--
Conor

The child is grown, the dream is gone.
I have become comfortably numb. - Pink Floyd
Reply to
Conor

John Fields skrev:

count 7 bits down from msb, (i.e bit1 on an 8bit converter) output that as channel-A, count 8 bits down from msb, (i.e bit0 on a

8bit converter) ex-or that with channel-A and out put as channel-B

fd fe ff 00 01 02 03

__ __ __ __ bit0 __| |__| |__| |__| |_ _____ _____ bit1 _____| |_____| |_

__ __ __ __ bit0^bit1 = Ch-B __| | |_____| | |____ _____ _____ bit1 = Ch-A _____| |_____| |_

very simple but Channel-A will have glitches so without addition processing it probably won't work in practice...

-Lasse

Reply to
langwadt

See if you can find an old 1980's/early 90's arcade car racing game such as Outrun, Atari GP etc. Ask the people there if they can let you look at the other side of the steering wheel. Your solution is right there.

--
Conor

The child is grown, the dream is gone.
I have become comfortably numb. - Pink Floyd
Reply to
Conor

The display is 640 pixels wide, and the smallest unit of movement is 4 pixels, which is about 160 discrete positions. By my estimate about

10/16 of a revolution of the knob should move the paddle completely across the screen. If 10/16 of X = 160, then X = 255 pulses per revolution necessary resolution.

I would like to give the player the ability to tweak the knob ever so gently and move the minimum distance (4 pixels, or 1/160 of the screen) or in one fell swoop cross the entire screen in 10/16 of a turn.

Well I figured if I can find a 8-bit A/D converter module that I can plug an Atari paddle into, it will send 8 bits + 1 for fire button per paddle, which means one KE72 can support 8 paddles, which is fine with me.

That's why I am leaning towards the A/D converter, and sending an absolute value. At any given time when the PC gets around to reading the inputs, they will be accurate (as long as the A/D converter is)

Well I am pretty handy with a soldering iron, and I have coded in everything from 8-bit assembly to C to VB.NET, so I can handle the programming part. Maybe I am being foolhardy but what the hell, this is fun and I like Pong

Well I might need 8 or more. As many as possible. I might want to make a foos-pong table! The pair of infrared transmitter/receivers sounds good to me. If I can get a completed circuit where I only have to solder the 4 leads from 2 switches, that is easy. I hear they are cheap ($1) too. Same with the A/D converter - if I can get a complete circuit (or can build one from plans) all I have to do is solder the potentionometer to 2 leads, and the 8 switches to the other 16 (or 9 if they share a ground), and voila

By the way thanks for your help everyone

Reply to
Mad Scientist Jr

John Fields skrev:

snip

but why bother with absulute position and problems when pot after a full turn goes from max to min, when all you need is deltas, i.e. pick two adjecent bits and convert to gray code....

-Lasse

Reply to
langwadt

or, you do it the professional way, with two optical patterns that interfere 256 times per rotation due to moire effects...

Charlie

Reply to
Charlie Edmondson

Well, he can speak for himself but as I read it, all he means with ratiometrically, is that if the ADC's reference is wired to the same supply that feeds the potentiometer, then your ADC counts will always be nicely arranged in a kind of 0-100% range. It's unlikely you'd wire it otherwise, so this is 'stating the obvious.' If you did wire them up differently, so that a change in one that didn't affect the other, it would cause the ADC counts to mean something different than you might expect.

Vcc has both more precise meanings (in other words, it may refer to a very specific voltage) and a more generic meaning. In this case, he just means that you would use the Vcc voltage of the PIC's digital section supply for the ADC's reference voltage -- he said this because microcontrollers that have ADCs not infrequently will allow you to use a different voltage for the ADC reference. Some don't, though.

You don't need a lot of electronics knowledge to wire PICs. But... like anything... there is a learning curve. You also need a way to program them -- some software and some hardware.

On the one hand, some of your posts on this thread make it seem like you have gotten fairly far along the road to getting something up and running and it sounds like some custom stuff, so that implies you've already "been there, done that" in some sense. But now, with the above questions, I'm realizing that's not so true. After looking at the KE72, I see more about how you are proceeding. You are an IBM PC programmer type, not an embedded programmer, and you are hooking up various interfaces onto your bus and writing code for them on the PC.

I haven't thought about your problem deeply, but you've mentioned 5V and 0.5mA available. This is not much. What particular inputs on the KE72 are you using? Are you hooking up your 'quadrature' A and B signals to just two of the 72 'switch' inputs and polling them in your PC software?

Frankly, if I were thinking about something like this I probably would have used a mouse and modified it for the purpose at hand. They already generate a fairly decent number of pulses per revolution in the area (and above, I think) of what you are thinking about. (Would be easy to verify.)

Yes. It sounds as though you don't have any embedded programming experience. This will be another learning curve for you.

Jon

Reply to
Jonathan Kirwan

--- You're flopping around wasting our time because you have no target and no clue about how to get there.

If you can settle down and decide on what it is you want, we can probably help you. I suggest though, that you give the folks over at rec.games.video.arcade.collecting a try, since some of them might already have exactly what you're looking for.

-- John Fields Professional Circuit Designer

Reply to
John Fields

--
My strategy would be a little different in that I\'d do an 8 bit ADC
on the input signal, store it to the "new" register (rnew) and then
compare it with what was in the "old" (rold) register.  If the
magnitude of rnew was greater than the magnitude of rold,  I\'d set
"I" (an I/O), start a timer, wait until it timed out, then set "Q"
(another I/O), and then start another couple of timers which would
reset "I" and then, a little later, reset "Q".  That would provide
the external quadrature decoder with all the informaton it would
need to, say, count up one cycle.

For this application, that would move the Pong paddle 1/255th of its
travel in one direction. 

However, if the magnitude of the contents of rnew was less than that
of rold, then the same timing sequence would occur, but "Q" would
lead "I", and the quadrature decoder would move the paddle in the
other direction.

Now, once the direction of the paddle movement had been determined
and handed off to the quadrature detector, the value in rnew would
be moved to rold, rnew would wait for a new input from the ADC, and
the cycle would begin anew.

However, if the magnitudes of rnew and rold were to remain the same,
sample for sample, because the output voltage from the pot didn\'t
change, the quadrature detector would not be updated and the
location of the paddle wouldn\'t change.
Reply to
John Fields

Okay.

We have:

(>=4) Paddles with at least a resolution of 256/revolution.

Let's drill down in this specification. How many visual positions can the paddle have in the display? Is it 256 distinct positions? Do you want to access all the available display positions with 3/4 turn? Or

1/4 turn or ?? How much angle of turn per new position, in other words?

You also have a KE72 PCI board. It accepts 72 closure inputs (high impedance left open is one state and low-impedance closure for the other state) which should basically be treated as switches. This means all this operates under Windows with Windows drivers for the PCI device. You will be programming in some Windows language.

It is getting hard to consider monitoring various inputs that may be changing very fast, so with four paddles and maybe each spinning hard by some operator, you can easily see things going awry real quick. You would like this to look and feel good, no matter what.

Cheap and easy, too.

You have little or no experience in designing and wiring up hobby electronics and no experience as an embedded programmer. You don't have any programming tools for microcontrollers, hardware or software, and no experience using them.

Using a mouse sounds about right, except that you'd need four, but you don't know where to start in getting that to work for you.

Is that about where things are at?

Jon

Reply to
Jonathan Kirwan

Not a ton...a good book on PICs should cover the basic electronics. If you're the kind that likes to tinker with projects -- sounds like you are -- you should probably just build this circuit with the PIC. Even if you end up not using it on your project, PICs can be used to homebrew millions of different types of devices and for hobby inventors its a really killer skill to have.

--
|\\/|  /|  |2  |<
mehaase(at)sas(dot)upenn(dot)edu
Reply to
Mark Haase

--
Yup, but still not cheap.
Reply to
John Fields

--
???

I don\'t see how you came up with absolute position when the thing is
an incremental encoder and all that\'s being detected is deltas.
That is, the difference between one pot position and the next. as
for the rollover error from min to max or from max to min R, that
will cause the paddle to jump backward or forward 1/255th of its
total travel when the jump is made. Hardly noticeable, I think.
Reply to
John Fields

Yep.

Opto sensor has +ve, -ve, output.

--
Conor

The child is grown, the dream is gone.
I have become comfortably numb. - Pink Floyd
Reply to
Conor

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.