Control scheme idea
Started by Tsukasa, Aug 26 2004 11:11 AM
123 replies to this topic
#26
Posted Wed Mar 7, 2007 11:19 PM
Thanks, guys, for the great discussion. Yeah, it makes a lot of sense to me that the PPM type scheme would be better at avoiding timing issues.
Good point, supercat, about the two modes of the potentiometer. The Atari paddles use resistance mode. Clearly, they're prone to jitter. I'm always in favor of using the simplest and cheapest possible technology that will get the job done so if pots is it then pots it is.
It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.
Good point, supercat, about the two modes of the potentiometer. The Atari paddles use resistance mode. Clearly, they're prone to jitter. I'm always in favor of using the simplest and cheapest possible technology that will get the job done so if pots is it then pots it is.
It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.
#27
Posted Wed Mar 7, 2007 11:45 PM
BigO, on Wed Mar 7, 2007 9:19 PM, said:
Good point, supercat, about the two modes of the potentiometer. The Atari paddles use resistance mode. Clearly, they're prone to jitter. I'm always in favor of using the simplest and cheapest possible technology that will get the job done so if pots is it then pots it is.
It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.
It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.
Edited by A.J. Franzman, Wed Mar 7, 2007 11:47 PM.
#28
Posted Thu Mar 8, 2007 12:18 AM
[quote name='A.J. Franzman' date='Wed Mar 7, 2007 11:45 PM' post='1252388']It occured to me to try a cap to clean up the paddle jitters in the standard controller but couldn't work out in my head what effect this would have on the linearity of the control and I've already cleaned all three of my sets anyway.[/quote]Been there, done that! What you'd be doing is adding capacitance to a different part of the timing circuit, which already has an existing capacitor inside the console. Not only does this conflict not improve the jitter situation, it makes the effective range of the pot even smaller (maybe a LOT smaller, depending on what capacitance value you use.)[/quote]
In measurement schemes where the voltage on the resistor does not change during a measurements, adding a cap will often reduce jitter without any ill effects. In measurement schemes where the voltage on the resistor is changed during a measurement, adding a cap will often cause bad things to happen and is unlikely to reduce jitter in any case.
What's needed if you want a good jitter-free pot solution is a device with a high-impedance input that can then simulate a variable resistance. A microcontroller producing a pulse-period-modulated signal (that switches between high and floating--not between high and low!) is probably the easiest way to achieve it, though there are ways to produce similar effects with a reasonable number of discrete components.
In measurement schemes where the voltage on the resistor does not change during a measurements, adding a cap will often reduce jitter without any ill effects. In measurement schemes where the voltage on the resistor is changed during a measurement, adding a cap will often cause bad things to happen and is unlikely to reduce jitter in any case.
What's needed if you want a good jitter-free pot solution is a device with a high-impedance input that can then simulate a variable resistance. A microcontroller producing a pulse-period-modulated signal (that switches between high and floating--not between high and low!) is probably the easiest way to achieve it, though there are ways to produce similar effects with a reasonable number of discrete components.
#29
Posted Thu Mar 8, 2007 10:34 PM
supercat, switching between zero resistance and hi-z was was one of my earliest inclinations but I thought I'd first try zero resistance and max resistance as that more closely modeled the pot (in my mind anyway).
I reckon though that switching between a short circuit (minimum charge time on the internal cap) and hi-z (cap never charges) would be more effective.
In other words:
switching between [charge-as-fast-as-possible] and [charge-not-at-all]
vs.
switching between [charge-as-fast-as-possible] and [charge-slower-than-as-fast-as-possible]
In terms of the discrete component approach, FET? Or just a reg'lar old transistor switching the connection on and off, driven into/out of saturation by a variable frequency input? I'm not much good with analog stuff, but am definitely up for simpler+cheaper=better.
In my more digitally inclined mind, I want to think tri-state buffer...alternate between hi-z and 0.
I reckon though that switching between a short circuit (minimum charge time on the internal cap) and hi-z (cap never charges) would be more effective.
In other words:
switching between [charge-as-fast-as-possible] and [charge-not-at-all]
vs.
switching between [charge-as-fast-as-possible] and [charge-slower-than-as-fast-as-possible]
In terms of the discrete component approach, FET? Or just a reg'lar old transistor switching the connection on and off, driven into/out of saturation by a variable frequency input? I'm not much good with analog stuff, but am definitely up for simpler+cheaper=better.
In my more digitally inclined mind, I want to think tri-state buffer...alternate between hi-z and 0.
Edited by BigO, Sun Aug 12, 2007 9:15 PM.
#30
Posted Fri Mar 9, 2007 1:10 AM
BigO, on Thu Mar 8, 2007 8:34 PM, said:
supercat, switching between zero resistance and hi-z was was one of my earliest inclinations but I thought I'd first try zero resistance and max resistance as that more closely modeled the pot (in my mind anyway).
I reckon though that switching between a short circuit (minimum charge time on the internal cap) and hi-z (cap never charges) would be more effective.
In other words:
switching between [charge-as-fast-as-possible] and [charge-not-at-all]
vs.
switching between [charge-as-fast-as-possible] and [charge-slower-than-as-fast-as-possible]
I reckon though that switching between a short circuit (minimum charge time on the internal cap) and hi-z (cap never charges) would be more effective.
In other words:
switching between [charge-as-fast-as-possible] and [charge-not-at-all]
vs.
switching between [charge-as-fast-as-possible] and [charge-slower-than-as-fast-as-possible]
I just measured the lowest resistance (full clockwise) of nine pairs of paddles that I have here, and the single lowest resistance pot measured 35 ohms. Several others measured between 55 and 60, and the rest were all in the range of 60-200 ohms. So, depending on the timing needs of your circuit, I would start with a minimum of a 56 ohm resistor for the "charge" value, and just maybe take it as low as 33 ohms if needed.
Edited by A.J. Franzman, Fri Mar 9, 2007 1:30 AM.
#31
Posted Fri Mar 9, 2007 8:25 AM
A.J. Franzman, on Fri Mar 9, 2007 1:10 AM, said:
If you're not synching up your charge pulses to the console, you will want some resistance in there. Otherwise, sooner or later you're going to be trying to charge the cap at the same time the console is trying to discharge it. If the console has no built-in current limiting this would be effectively connecting +5V directly to ground, which is known to be a Bad Thing and will likely let the magic smoke out of something.
The 2600 has a built-in resistor which goes in series with the paddle, so there's no danger of damage there.
The resistor should be selected so that the combination of the resistance in the controller and and one in the console take about 200-400 pulses to charge the cap. If the pulses cannot be made short enough for that to work, some other approach may be required.
#32
Posted Fri Mar 9, 2007 12:27 PM
supercat, on Fri Mar 9, 2007 2:25 PM, said:
The 2600 has a built-in resistor which goes in series with the paddle, so there's no danger of damage there.
It wouldn't be a bad idea to add a small resistor just to be safe.
-Chris
#33
Posted Fri Mar 9, 2007 3:23 PM
cwilkson, on Fri Mar 9, 2007 11:27 AM, said:
supercat, on Fri Mar 9, 2007 2:25 PM, said:
The 2600 has a built-in resistor which goes in series with the paddle, so there's no danger of damage there.
It wouldn't be a bad idea to add a small resistor just to be safe.
-Chris
Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not. Good to know. Of all things in a 2600 that I'd want to let the smoke out of, the TIA would be pretty far down my list. There's no protection on those pins in the TIA hardware? It must be considered nearly impossible then for a potentiometer to actually supply a zero resistance.
I note that the Keyboard controller pulls pins 5 and 9 high through 4.7K resistors to pin 7, but shorts 5 or 9 to any one of 1,2,3,4 depending on keypresses. With 5 and 9 both being inputs to the TIA, that would mean that 1,2,3,4 (pa0, 1, 2, 3 of the 6532 RIOT), configured as outputs, are pulsing the rows (or columns, whichever) of the key matrix.
Pressing the * key shorts pin 5 to pin 4. Pin 4 is presumably alternating between 0 and 5 volts. So, when pin 4 is high and I press *, would that effectively be the same as shorting pin 5 to pin 7 in the scenario discussed earlier where pin 7 is supplying 5 volts? Or is the RIOT port not quite that assertive?
I guess it's all academic, really . . . just trying to bolster my gut-level understanding of this animal. I probably should take any deeper discussion over to a separate topic.
(I can say with certainty that my console can withstand a dead short between pins 5 and 7 while playing a paddle game with no ill effects.
Edited by BigO, Fri Mar 9, 2007 5:27 PM.
#34
Posted Fri Mar 9, 2007 10:25 PM
BigO, on Fri Mar 9, 2007 9:23 PM, said:
Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not. Good to know. Of all things in a 2600 that I'd want to let the smoke out of, the TIA would be pretty far down my list. There's no protection on those pins in the TIA hardware? It must be considered nearly impossible then for a potentiometer to actually supply a zero resistance.
No, there's no protection inside the TIA. It's a nice, big healthy transistor on pins 37-40, so it might not blow up. Then again, that might make it *more* likely to explode (/quickly burn out). Being beefy makes it a really strong pull down, with lots of current sinking capability. So it *will* get hot if the software asks that pin to be low for any extended period while it's shorted to VCC. Over time, that could lead to failure.
Quote
Pressing the * key shorts pin 5 to pin 4. Pin 4 is presumably alternating between 0 and 5 volts. So, when pin 4 is high and I press *, would that effectively be the same as shorting pin 5 to pin 7 in the scenario discussed earlier where pin 7 is supplying 5 volts? Or is the RIOT port not quite that assertive?
First, 4 is shorted to 5 which is connected to pin 7 *through the resistor*. At no time is pin 7 (=VCC) shorted to any other pin through switches. At best, it's connected through two 4.7k resistors in parallel (~2.4k effective). Second, I don't have my data for the RIOT here, but my guess is that the RIOT isn't that beefy. It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)
Quote
(I can say with certainty that my console can withstand a dead short between pins 5 and 7 while playing a paddle game with no ill effects.
)
-Chris
#35
Posted Fri Mar 9, 2007 11:18 PM
BigO, on Fri Mar 9, 2007 3:23 PM, said:
Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not.
If there isn't a resistor internal to the 2600, then one will be required externally. Not just to protect the TIA, but also to produce proper operation. The goal of the circuit is to charge the cap about 1/200 of the way with each pulse. With no resistor or other current-limiting circuit, the cap would probably charge too quickly.
If the circuit is supposed to have similar behavior on the 2600 and 2600A, it may be necessary to use a current-limiter circuit instead of a mere resistor. I'd suggest something like this:
. +V . ,-R2-+ . | R1 . | | . | E .PWM--R3--+---B . C----- PaddleThe transistor should be a small PNP type (2N3904 or equivalent). As a guess, I would suggest R1=100ohm, R2=1K, and adjust R3 as needed. The PWM should be low to charge and high to not charge.
#36
Posted Sat Mar 10, 2007 12:18 AM
cwilkson, on Fri Mar 9, 2007 9:25 PM, said:
Couple of things.
First, 4 is shorted to 5 which is connected to pin 7 *through the resistor*. At no time is pin 7 (=VCC) shorted to any other pin through switches. At best, it's connected through two 4.7k resistors in parallel (~2.4k effective). Second, I don't have my data for the RIOT here, but my guess is that the RIOT isn't that beefy. It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)GASP! Your poor TIA!!!
-Chris
First, 4 is shorted to 5 which is connected to pin 7 *through the resistor*. At no time is pin 7 (=VCC) shorted to any other pin through switches. At best, it's connected through two 4.7k resistors in parallel (~2.4k effective). Second, I don't have my data for the RIOT here, but my guess is that the RIOT isn't that beefy. It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)
Quote
(I can say with certainty that my console can withstand a dead short between pins 5 and 7 while playing a paddle game with no ill effects.
)
-Chris
The 5 to 7 short was only in reference to the earlier discussion about the circuitry to emulate a paddle controller, not the keyboard controller scenario.
I was just saying that if the RIOT supplies 5 volts on pin 4 which is shorted to pin 5 via the * key, that might effectively be the same as shorting 5 to 7 in the earlier discussion. But, I guess you must understand that because you addressed that concern regarding the RIOT's pull up capability.
I'm convinced, a current limiting mechanism of some flavor will be in order if I try to emulate the paddle controller signal with active hardware.
I believe the TIA has forgiven me for my miswiring episode as it still permits me to play Circus with my standard paddle controller and with my prototype homebrew potentiometer based controller.
#37
Posted Sat Mar 10, 2007 12:49 AM
supercat, on Fri Mar 9, 2007 10:18 PM, said:
BigO, on Fri Mar 9, 2007 3:23 PM, said:
Ah, I see in the schematics (AtariAge archives) that the CX-2600 does have the resistors and the CX-2600A does not.
If there isn't a resistor internal to the 2600, then one will be required externally. Not just to protect the TIA, but also to produce proper operation. The goal of the circuit is to charge the cap about 1/200 of the way with each pulse. With no resistor or other current-limiting circuit, the cap would probably charge too quickly.
If the circuit is supposed to have similar behavior on the 2600 and 2600A, it may be necessary to use a current-limiter circuit instead of a mere resistor. I'd suggest something like this:
. +V . ,-R2-+ . | R1 . | | . | E .PWM--R3--+---B . C----- PaddleThe transistor should be a small PNP type (2N3904 or equivalent). As a guess, I would suggest R1=100ohm, R2=1K, and adjust R3 as needed. The PWM should be low to charge and high to not charge.
Thanks. Duly noted and now available for my future reference. (Thankfully, I won't have to rely solely on my memory.)
Since my circuit will have to have calibration capability anyway to do the centering and physical to screen position correlation, I think that same adjustment should by its nature compensate for the variation in behavior between the two internal resistor scenarios. On that basis, I was thinking a fixed resistor might suffice for protection. The same conventional paddle controllers will work on either 2600 or 2600A so the minimum resistance of the potentiometer itself seems to be sufficient protection for the TIA on the 2600A.
I take it "low to charge" means to apply a suitably small resistance between pins 5,7 and/or 5,9 and "high to not charge" means to leave the 5-7 and 5-9 connection open (or highest possible resistance). I believe I'm track.
Cool. Now all I have to do is finish my mechanical version, write my first game then acquire the necessary equipment to work on this excuse-to-play-with-microcontrollers project...say, since my wife's ~$13K long-arm quilting machine just arrived yesterday, now might be a judicious time to spend a few bucks on my own hobbies.
#38
Posted Tue Mar 13, 2007 12:04 AM
Another, mostly academic thought I had that caused me to look into the internals of the 2600 was related to keypad input.
I thought maybe the two "paddle" inputs in one connector port could be used to create an expanded version of a keypad with more keys. I was thinking of pulsing multiple rows or columns simultaneously, but have each of those simultaneously actuated groups connected through a different valued resistor so that the different, let's say rows, could be discerned by using the same method that the paddle controller scheme uses to determine a potentiometer position.
There are twelve keys in the standard keyboard controller. Eight of those are arranged in two columns of four each. One column is attached to pin 9 and is pulled high through a resistor fed 5 volts by pin 7. Currently, when one of those four keys (2, 5, 8 or 0) is pressed, pin 9 is pulled low when the appropriate row line goes low (Pins 1, 2, 3, 4 of the DB-9).
Instead of the 4700 ohm resistor, I was thinking a 1 meg resistor could be used for the pullup. Then, instead of one button per Row/Column intersection, you could have maybe 5 buttons. One would be the "zero ohm" as currently set up. The other 4 could be of incrementally higher values of a range that would be experimentally determined to produce reliably detectable keypresses on a variety of consoles. As an example, the buttons could use: 100K, 220K, 470K, 680K resistors.
The smallest values possible might be best so that the cap charges quickly. Experimentation would be needed to determine the best values. It might be possible to have more buttons, depending on the reliability of detection across consoles and speed with which the keys could be read.
If I actually some immediate application for this, I'd be inclined to shoot for the 5 per intersection number as a starting point. That'd be what, 44 buttons? Probably better than the keyboard on that Tomy Tutor I had for a while.
One column uses pin 6 of the DB-9 which is a standard digital input so only supports 4 buttons.
Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.
Like I said, just musing. Haven't tried to work out any kinks or sink the idea entirely. Thought I'd toss it out here in case it was useful to anybody or might spark any actual good ideas for someone.
I thought maybe the two "paddle" inputs in one connector port could be used to create an expanded version of a keypad with more keys. I was thinking of pulsing multiple rows or columns simultaneously, but have each of those simultaneously actuated groups connected through a different valued resistor so that the different, let's say rows, could be discerned by using the same method that the paddle controller scheme uses to determine a potentiometer position.
There are twelve keys in the standard keyboard controller. Eight of those are arranged in two columns of four each. One column is attached to pin 9 and is pulled high through a resistor fed 5 volts by pin 7. Currently, when one of those four keys (2, 5, 8 or 0) is pressed, pin 9 is pulled low when the appropriate row line goes low (Pins 1, 2, 3, 4 of the DB-9).
Instead of the 4700 ohm resistor, I was thinking a 1 meg resistor could be used for the pullup. Then, instead of one button per Row/Column intersection, you could have maybe 5 buttons. One would be the "zero ohm" as currently set up. The other 4 could be of incrementally higher values of a range that would be experimentally determined to produce reliably detectable keypresses on a variety of consoles. As an example, the buttons could use: 100K, 220K, 470K, 680K resistors.
The smallest values possible might be best so that the cap charges quickly. Experimentation would be needed to determine the best values. It might be possible to have more buttons, depending on the reliability of detection across consoles and speed with which the keys could be read.
If I actually some immediate application for this, I'd be inclined to shoot for the 5 per intersection number as a starting point. That'd be what, 44 buttons? Probably better than the keyboard on that Tomy Tutor I had for a while.
One column uses pin 6 of the DB-9 which is a standard digital input so only supports 4 buttons.
Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.
Like I said, just musing. Haven't tried to work out any kinks or sink the idea entirely. Thought I'd toss it out here in case it was useful to anybody or might spark any actual good ideas for someone.
#39
Posted Wed Mar 14, 2007 10:33 PM
BigO, on Tue Mar 13, 2007 1:04 AM, said:
Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.
Using a small micro, it would be possible to send data to the 2600 at a rate of about 74 cycles/byte:
; Y should equal 128; X should equal the transmission length (last byte index+1). SWCHA.0 should start out being the opposite state from X.0 lp: stx SWCHA ; Trigger micro to start transmission nop 0 dex lp: cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol sta buffer,x stx SWCHA dex bpl lpNot the fastest thing in the world, but entirely reasonable.
#40
Posted Fri Mar 16, 2007 12:02 PM
supercat, on Wed Mar 14, 2007 9:33 PM, said:
BigO, on Tue Mar 13, 2007 1:04 AM, said:
Probably reading serial data would be a better keyboard interface. This seemed possible with run-of-the mill 2600 port reading techniques, though also might be really slow.
Using a small micro, it would be possible to send data to the 2600 at a rate of about 74 cycles/byte:
; Y should equal 128; X should equal the transmission length (last byte index+1). SWCHA.0 should start out being the opposite state from X.0 lp: stx SWCHA; Trigger micro to start transmission nop 0 dex lp: cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol cpy INPT5 rol sta buffer,x stx SWCHA dex bpl lpNot the fastest thing in the world, but entirely reasonable.
Hmm. Yeah, not so bad. I wonder how the overall time to report a single keypress would compare to my original modified keypad scheme. Reading the modified, passive component keypad would be a lot like reading the two paddle controllers (well, except the pulsing of the rows, and well, I guess it's not quite the same after all).
#41
Posted Fri Apr 6, 2007 6:49 PM
...has anyone progressed further with using PWM/PFM/PPM to simulate a paddle? I was thinking a nice solution would be to use a 556 timer (or two 555 timers) as outlined in the attached PDF to generate PWM from a variable voltage - what do you think? what value resistor and capacitor would work best? (the only thing I'm not sure about is just how variable the voltage could be - looking at spec sheets, the control voltage pin on 555/556's seem to offer a very narrow range) thanks for any ideas!
Attached Files
Edited by Grover, Fri Apr 6, 2007 6:50 PM.
#42
Posted Fri Apr 6, 2007 8:44 PM
cwilkson, on Fri Mar 9, 2007 11:25 PM, said:
It's an NMOS chip, and it's meant to be driving a bus. So it probably has somewhat weak pullups. (but strong pull downs!)
Speaking of NMOS, I do know that the 6507 most emphatically does not like having a CMOS chip trying to force an address pin high (oops). My poor 2600jr needs a new 6507 since the one that's in there won't let A7 rise above about a volt. Even adding a pullup resistor to it won't help.
#43
Posted Fri Apr 6, 2007 9:20 PM
Grover, on Fri Apr 6, 2007 7:49 PM, said:
...has anyone progressed further with using PWM/PFM/PPM to simulate a paddle? I was thinking a nice solution would be to use a 556 timer (or two 555 timers) as outlined in the attached PDF to generate PWM from a variable voltage - what do you think? what value resistor and capacitor would work best? (the only thing I'm not sure about is just how variable the voltage could be - looking at spec sheets, the control voltage pin on 555/556's seem to offer a very narrow range) thanks for any ideas!
First of all, for good performance you should use the pot to generate a DC VOLTAGE rather than a resistance. In other words, wire the two ends of the pot to +5 and ground (possibly extending one or both ends of the pot with resistors, but with both ends of the pot remaining at constant DC voltages in any case).
Beyond that, there are a number of approaches that may work better. I haven't had a chance yet to find out what the threshold voltage is for the 2600's paddle inputs, but something like this may work
The chip is an LM311 which grounds its output when its "+" input is higher than the "-". When the Atari 2600 paddle pin is grounded, the LM311's "-" input will be lower than the "+", so the comparator will ground the output. Thus, only the 1M resistor near the right side of the circuit will charge the 2600's cap.
When the cap voltage reaches the voltage on the pot, then the comparator output will switch off, allowing the 1K resistor to pull up the Atari's paddle input. This should cause it to switch in fairly short order.
The time required for the paddle input to switch after it is released should thus be the time required for the 1M resistor to charge up to the pot voltage, plus the time for the 1K resistor to charge from there to the TIA switching threshold.
Other chips may be somewhat better suited to the task, but the LM311 should be widely available. The cap near the "+" input is non-critical and could be omitted altogether, but it may slightly reduce jitter when used with really dirty paddles. I'd suggest something small, on the other of a 0.001uF or so.
If you build the circuit and the end of the paddle nearest ground doesn't move the player far enough, it may be necessary to reduce the 1K resistor, though I wouldn't go beyond 470 ohms (if the circuit doesn't work with 470 ohms, it will need to be redesigned). If the player doesn't move far enough the other way but the pot's full range of motion is usable, it may be necessary to reduce the 1M resistor attached to the pot. It the player stalls at some position short of full motion (e.g. turning the pot 2/3 of the way moves the player 3/4 of the way across the screen, but further turning has no additional effect) it may be necessary to increase the 1M resistor attached to the joystick port.
BTW, the 1M pot was chosen because that's what the Atari 2600 uses. If some other value is more convenient, feel free to substitute. Change the resistor that's attached to the pot appropriately in that case.
Edited by supercat, Fri Apr 6, 2007 9:27 PM.
#44
Posted Fri Apr 6, 2007 11:18 PM
supercat, on Sat Apr 7, 2007 3:20 AM, said:
Grover, on Fri Apr 6, 2007 7:49 PM, said:
...has anyone progressed further with using PWM/PFM/PPM to simulate a paddle? I was thinking a nice solution would be to use a 556 timer (or two 555 timers) as outlined in the attached PDF to generate PWM from a variable voltage - what do you think? what value resistor and capacitor would work best? (the only thing I'm not sure about is just how variable the voltage could be - looking at spec sheets, the control voltage pin on 555/556's seem to offer a very narrow range) thanks for any ideas!
First of all, for good performance you should use the pot to generate a DC VOLTAGE rather than a resistance. In other words, wire the two ends of the pot to +5 and ground (possibly extending one or both ends of the pot with resistors, but with both ends of the pot remaining at constant DC voltages in any case).
Beyond that, there are a number of approaches that may work better. I haven't had a chance yet to find out what the threshold voltage is for the 2600's paddle inputs, but something like this may work
The chip is an LM311 which grounds its output when its "+" input is higher than the "-". When the Atari 2600 paddle pin is grounded, the LM311's "-" input will be lower than the "+", so the comparator will ground the output. Thus, only the 1M resistor near the right side of the circuit will charge the 2600's cap.
When the cap voltage reaches the voltage on the pot, then the comparator output will switch off, allowing the 1K resistor to pull up the Atari's paddle input. This should cause it to switch in fairly short order.
The time required for the paddle input to switch after it is released should thus be the time required for the 1M resistor to charge up to the pot voltage, plus the time for the 1K resistor to charge from there to the TIA switching threshold.
Other chips may be somewhat better suited to the task, but the LM311 should be widely available. The cap near the "+" input is non-critical and could be omitted altogether, but it may slightly reduce jitter when used with really dirty paddles. I'd suggest something small, on the other of a 0.001uF or so.
If you build the circuit and the end of the paddle nearest ground doesn't move the player far enough, it may be necessary to reduce the 1K resistor, though I wouldn't go beyond 470 ohms (if the circuit doesn't work with 470 ohms, it will need to be redesigned). If the player doesn't move far enough the other way but the pot's full range of motion is usable, it may be necessary to reduce the 1M resistor attached to the pot. It the player stalls at some position short of full motion (e.g. turning the pot 2/3 of the way moves the player 3/4 of the way across the screen, but further turning has no additional effect) it may be necessary to increase the 1M resistor attached to the joystick port.
BTW, the 1M pot was chosen because that's what the Atari 2600 uses. If some other value is more convenient, feel free to substitute. Change the resistor that's attached to the pot appropriately in that case.
Actually, the pot in Grover's circuit IS generating a DC voltage to control the pulse width of the 555 oneshot. Ok, can't analyze further right now...so I'll pose a question. It's been a while since this thread had any updates and my mind has been swiss-cheesed by work since then. So...what was the original purpose of all this? I think it's worthwhile to summarize this, to guide the discussion a little. Seems to be going in circles, but again I only looked through for 30 seconds or so. Anybody wanna sum up for me? Ok, gotta go.
-Chris
#45
Posted Fri Apr 6, 2007 11:33 PM
cwilkson, on Sat Apr 7, 2007 12:18 AM, said:
Actually, the pot in Grover's circuit IS generating a DC voltage to control the pulse width of the 555 oneshot.
Yes, but the voltages on the ends of the pot are not constant, and vary with the pot setting.
A dirty potentiometer will generally behave like a clean potentiometer with a randomly-varying resistance in series with the wiper. In Grover's circuit, the wiper resistance will greatly affect the measured value; 10K of random resistance would be an annoying amount of jitter, and 100K would render things completely useless. In the circuit I posted, 100K of random wiper resistance would probably be only barely detectable, and a meg of random resistance would still only have slight effect.
Quote
Ok, can't analyze further right now...so I'll pose a question. It's been a while since this thread had any updates and my mind has been swiss-cheesed by work since then. So...what was the original purpose of all this? I think it's worthwhile to summarize this, to guide the discussion a little. Seems to be going in circles, but again I only looked through for 30 seconds or so. Anybody wanna sum up for me? Ok, gotta go.
The basic idea is to produce circuit for a paddle control that will work well even if the pot becomes dirty.
#46
Posted Sat Apr 7, 2007 1:54 AM
Grover, on Fri Apr 6, 2007 7:49 PM, said:
...has anyone progressed further with using PWM/PFM/PPM to simulate a paddle? I was thinking a nice solution would be to use a 556 timer (or two 555 timers) as outlined in the attached PDF to generate PWM from a variable voltage - what do you think? what value resistor and capacitor would work best? (the only thing I'm not sure about is just how variable the voltage could be - looking at spec sheets, the control voltage pin on 555/556's seem to offer a very narrow range) thanks for any ideas!
supercat, on Fri Apr 6, 2007 8:20 PM, said:
First of all, for good performance you should use the pot to generate a DC VOLTAGE rather than a resistance. In other words, wire the two ends of the pot to +5 and ground (possibly extending one or both ends of the pot with resistors, but with both ends of the pot remaining at constant DC voltages in any case).
Beyond that, there are a number of approaches that may work better. I haven't had a chance yet to find out what the threshold voltage is for the 2600's paddle inputs, but something like this may work
attachment
Beyond that, there are a number of approaches that may work better. I haven't had a chance yet to find out what the threshold voltage is for the 2600's paddle inputs, but something like this may work
Edited by A.J. Franzman, Sun Apr 8, 2007 1:05 AM.
#47
Posted Sat Apr 7, 2007 8:37 PM
OK, I built supercat's circuit from post #43 using an NTE922M, and a 1nF (102) cap on the non-inverting input and it doesn't work. EDIT: Actually, it does, with a slight correction. Please skip ahead to post #58!
As drawn, I could barely get the paddle to come partway onto the bottom of the screen in Video Olympics Game 1. Even at this stage, jitter was still evident (using my only assembled paddle with a jittery pot). Changing the resistor on the comparator's output from 1k to 220 ohms made some improvement, allowing the paddle to travel about 1/5 of the way up the screen, with about the same degree of jitter. Leaving that resistor in place and changing the diode from a silicon diode to a germanium diode (0.3 V forward drop instead of 0.6 V) allowed the paddle to travel all the way up the screen, but jitter became extremely severe -- the paddle could jump the entire screen height at once, and I could not get it to rest anywhere in the middle. Leaving the germanium diode in place and restoring the resistor to 1k, I could not get the paddle onscreen at all.
As drawn, I could barely get the paddle to come partway onto the bottom of the screen in Video Olympics Game 1. Even at this stage, jitter was still evident (using my only assembled paddle with a jittery pot). Changing the resistor on the comparator's output from 1k to 220 ohms made some improvement, allowing the paddle to travel about 1/5 of the way up the screen, with about the same degree of jitter. Leaving that resistor in place and changing the diode from a silicon diode to a germanium diode (0.3 V forward drop instead of 0.6 V) allowed the paddle to travel all the way up the screen, but jitter became extremely severe -- the paddle could jump the entire screen height at once, and I could not get it to rest anywhere in the middle. Leaving the germanium diode in place and restoring the resistor to 1k, I could not get the paddle onscreen at all.
Edited by A.J. Franzman, Sun Apr 8, 2007 12:52 AM.
#48
Posted Sat Apr 7, 2007 9:48 PM
A.J. Franzman, on Sat Apr 7, 2007 9:37 PM, said:
As drawn, I could barely get the paddle to come partway onto the bottom of the screen in Video Olympics Game 1. Even at this stage, jitter was still evident (using my only assembled paddle with a jittery pot). Changing the resistor on the comparator's output from 1k to 220 ohms made some improvement, allowing the paddle to travel about 1/5 of the way up the screen, with about the same degree of jitter. Leaving that resistor in place and changing the diode from a silicon diode to a germanium diode (0.3 V forward drop instead of 0.6 V) allowed the paddle to travel all the way up the screen, but jitter became extremely severe -- the paddle could jump the entire screen height at once, and I could not get it to rest anywhere in the middle. Leaving the germanium diode in place and restoring the resistor to 1k, I could not get the paddle onscreen at all.
I'll have to check the data sheet for that part. Perhaps the TIA paddle inputs switch at a higher voltage than I'd thought. By "jitter", do you mean jitter just when moving the pot, or jitter even when the pot is motionless?
Germanium diodes tend to be rather leaky, and could thus prevent the 1meg resistor near the right side of the circuit from operating.
I'll look up the specs on the NTE922M and see if I can figure anything.
#49
Posted Sat Apr 7, 2007 10:11 PM
A.J. Franzman, on Sat Apr 7, 2007 9:37 PM, said:
OK, I built supercat's circuit from post #43 using an NTE922M, and a 1nF (102) cap on the non-inverting input and it doesn't work.
Looking at the NTE's data sheet, I couldn't see whether the input voltage range extends to ground when using a single +5 supply. (Admittedly, I'm not quite positive of the LM311's range, but I think it extended to ground but not to VDD).
I'll probably have to test out my 2600 with a scope to see where I erred in my assumptions.
#50
Posted Sat Apr 7, 2007 10:28 PM
I mulled this problem over a bit during dinner, and here's what I have:
Is this correct?
I thought a comparator was effectively the opposite of that, and with something like a digital logic output: if the "+" input is above the "-" input, the ouput should be high, and if the "+" input is below the "-" input, the output should be low.
If this is correct, A) the 1k resistor to V+ is unnecessary, and B) as designed, the circuit is operating the oppposite of what you wanted.
EDIT: Checked the datasheet, and I see this comparator has a TTL-style open-collector output, but the operation still seems to be opposite of what you described. In that case, swapping the "+" and "-" inputs should fix it.
supercat, on Fri Apr 6, 2007 8:20 PM, said:
The chip is an LM311 which grounds its output when its "+" input is higher than the "-". When the Atari 2600 paddle pin is grounded, the LM311's "-" input will be lower than the "+", so the comparator will ground the output. Thus, only the 1M resistor near the right side of the circuit will charge the 2600's cap.
I thought a comparator was effectively the opposite of that, and with something like a digital logic output: if the "+" input is above the "-" input, the ouput should be high, and if the "+" input is below the "-" input, the output should be low.
If this is correct, A) the 1k resistor to V+ is unnecessary, and B) as designed, the circuit is operating the oppposite of what you wanted.
EDIT: Checked the datasheet, and I see this comparator has a TTL-style open-collector output, but the operation still seems to be opposite of what you described. In that case, swapping the "+" and "-" inputs should fix it.
Edited by A.J. Franzman, Sat Apr 7, 2007 10:35 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users















