Jump to content
IGNORED

Control scheme idea


Tsukasa

Recommended Posts

i'm no hardware geek but i think controllers should be the next frontier for homebrews. i always thought games like star raiders or raiders of the lost ark that used both controller ports for one player games showed a new pathway. i think it would be fun to make a tank type game that used the stick for motion and the paddle for turret control...or something like that. we've all got star raiders touch pads/ computer keypads/ kids controllers, wouldnt it be nice to see a new game for them?

Link to comment
Share on other sites

I have a prototype of an analog joystick for the 2600 working. It still needs some improvements but it works fairly well. It makes Marble Craze a blast to play. After I finish Wolfenstein for neotokeo, I will finish the design for the analog stick. Patience... ;)

 

Cheers!

Link to comment
Share on other sites

  • 2 years later...

Does anyone happen to know the maximum resolution that the 2600 can read from an analog input such as a paddle controller?

 

I understand generally how the 2600 reads this information: it does an A/D conversion by timing how long the capacitor takes to charge (as determined by the potentiometer setting). I assume the resolution is a property of the number of bits in the counter that times the charge cycle, but not quite sure how to put this information together.

 

It might help if I phrase the question a different way:

If, in place of a potentiometer, I were to use a bazillion position rotary switch with a different resistance level attached to each of the positions, how many discrete positions could the 2600 detect?

 

Partly, it's just a general knowledge or academic type question, but I may apply the knowledge to a controller that I'd like to build at some point.

 

On a related note, does anyone have any thoughts about the effectiveness of using a PWM signal to simulate the variable resistance ordinarily presented by the potentiometer in a paddle controller?

Link to comment
Share on other sites

Does anyone happen to know the maximum resolution that the 2600 can read from an analog input such as a paddle controller?

 

The 2600 could probably read a paddle controller with 12 bits of resolution if it wasn't doing anything else. In practical terms, the resolution is more likely to be somewhere around 6-8 bits.

 

I don't really see any purpose to designing an analog joystick controller that would be operated using the 2600 paddle inputs unless one really wants to play Marble Craze. Otherwise it would make far more sense to design a controller which used a small microcontroller to turn the joystick positions, button status readings, etc. into digital data and send that serially. Such a controller could even be constructed to share the right joystick port with the AtariVox.

Link to comment
Share on other sites

On a related note, does anyone have any thoughts about the effectiveness of using a PWM signal to simulate the variable resistance ordinarily presented by the potentiometer in a paddle controller?

 

What you need is not a PWM signal, but something a bit different. The 2600 paddle port contains a capacitor, a threshhold comparator, and a dumping circuit. To take a reading, the 2600 turns on the dumping circuit, lets it discharge the cap (leave it on for a couple scan lines or so), and then turns it off. If a paddle controller is connected, the capacitor will charge through the variable resistance. When it reaches a threshhold, the corresponding INPTx bit of the TIA will switch. The time required to reach the threshhold depends upon the resistance.

 

If you want to simulate a paddle, you need the ability to pull the pin moderately weakly to a low voltage that isn't ground (not sure how high it can be, but I'd suggest 0.7 volts) or to +5, and you need to sense whether the pin is being externally pulled low. You then need a timer which will be held in reset when the pin is pulled low and will pull the pin high when it expires.

Link to comment
Share on other sites

On a related note, does anyone have any thoughts about the effectiveness of using a PWM signal to simulate the variable resistance ordinarily presented by the potentiometer in a paddle controller?

You could make this work. If you connect a resistor from the port to the PWM signal. The R/C forms an integrator (low pass filter) which averages the PWM voltage over time. You just need to make sure that the average voltage is above the detector's trip point or it will never trip. The farther above, the shorter the delay.

 

But I think if you're going to go to all this trouble, you might as well just set a timer on the external digital signal and yank the capacitor voltage when the timer expires. This is probably easier both in hardware and software.

 

-Chris

Link to comment
Share on other sites

supercat, thanks for the feedback.

 

"PWM" might be misleading in that I most commonly see it used in the context of power delivery and this is indeed somewhat different. I guess what I'm proposing would amount to some some oddball sort of current limiting.

 

But, I think we're talking about basically the same concept. My plan was to pull pin 9 up to the level supplied by pin 7 (+5v I believe) through a 1 Meg resistor to mimic the potentiometer at its maximum resistance.

 

Speaking here of the Right paddle controller, shorting pin 7 to 9 is equivalent to the potentiometer at minimimum resistance (zero). My reasoning was that I'd use a transistor or analog switch IC (or something) to bypass the 1 Meg resistor (short across it) in a pulsing, PWM'esque manner. I reasoned that this would affect the charge rate of the capacitor by altering the power that is delivered to the capacitor in the same manner that a PWM voltage is to deliver variable effective power to a motor.

 

I have no clue what frequency would be appropriate or if it would even work at all. I figure if I alternate between the min and max resistances at some frequency and a variable duration, I might be able to simulate the presence of a pot. (It's for a more sophisticated version of the purely mechanical controller that I'm tinkering with now.)

 

It strikes me as being similar to an analog tachometer circuit in that the console's internal capacitor converts the pulses to a DC level. But, I figured there might be problems with ripple at certain frequencies so thought a purely variable frequency model might be a bad plan.

 

Have I clarified my proposal at all?

Link to comment
Share on other sites

On a related note, does anyone have any thoughts about the effectiveness of using a PWM signal to simulate the variable resistance ordinarily presented by the potentiometer in a paddle controller?

You could make this work. If you connect a resistor from the port to the PWM signal. The R/C forms an integrator (low pass filter) which averages the PWM voltage over time. You just need to make sure that the average voltage is above the detector's trip point or it will never trip. The farther above, the shorter the delay.

 

But I think if you're going to go to all this trouble, you might as well just set a timer on the external digital signal and yank the capacitor voltage when the timer expires. This is probably easier both in hardware and software.

 

-Chris

 

Thanks, Chris. (If it seems I was repeating you or ignoring you at all it's just that our replies overlapped.)

 

Between you and supercat, you've given me a clearer picture.

 

I think it would in fact be simpler to follow the more directly timer oriented methodology both of you have suggested.

[Edit] Then again, I'm not sure how I'd be able to know when the Atari was going to read and synchronize with that. Now I'm back to the concept of a sufficiently high frequency, variable duration switching to hopefully get the cap charged in a manner similar to what an analog pot would do.

 

If I get around to the project, I'll try these things and post back here with any interesting results.

Edited by BigO
Link to comment
Share on other sites

I think it would in fact be simpler to follow the more directly timer oriented methodology both of you have suggested.

[Edit] Then again, I'm not sure how I'd be able to know when the Atari was going to read and synchronize with that. Now I'm back to the concept of a sufficiently high frequency, variable duration switching to hopefully get the cap charged in a manner similar to what an analog pot would do.

 

When the "dumping" circuit is switched on, the pin will be pulled pretty well to ground. What you need to do when you're not trying to pull the pin all the way up is pull it moderately weakly to some voltage between ground and the 2600's switching point. When you're able to pull the pin up somewhat, you should run the timer; when it's stuck at ground, you should reset the timer.

 

If you're trying to do two or four paddles at once, you only need one circuit to detect the "dumper" since it's switched on and off for all ports simultaneously.

Link to comment
Share on other sites

Create an analog joystick for the 2600 that uses the paddles movements for x and y axis'.

This would be great for space shooters.

 

I prefer the analog joystick model to the digital "Atari" joystick. I was just thinking of this same thing the other day while looking at the array of analog joysticks in a thrift store. If I remember correctly, the typical analog joystick doesn't have a 1 Megohm delta between the min and max resistance as the paddle controllers do.

 

I've found recently while analyzing the paddles for a project of my own that the when the player is in the center of the screen, the paddle controller is nowhere near the center of its travel. On Circus and Breakout and the games don't use anywhere near the full range of rotation of the potentiometer. Basically, the paddle controller doesn't bump against mechanical limits because of the unused slop on either end of the range. The player maxes out long before the controller does.

 

Circus uses about 90 degrees of rotation. The resistance delta is about 270K but is not at all centered around the 500K center of the pot. I can't find my notes now, but the game-used range was skewed quite a bit toward the counter-clockwise travel limit of the pot (I want to say about 70K on the bottom end of the range). Breakout was fairly close to Circus in its usage of the potentiometer, but Casino was way different. I think it required nearly the full 1 Meg/330 degree delta.

 

This effectively requires variable gain and variable centering to implement the full range of on-screen motion across different games.

 

I said all of that because I had hopes of making an analog joystick that could double as a paddle controller (effectively it would be the Player 0 and Player 1 paddles or the player 2 and Player 3 paddles acting together. In designing a different sort of controller, I came up with a way to implement both the variable gain and centering in a fairly simple mechanism. It hadn't occured to me until just now that it might be scaled down to work in a joystick.

 

I have a preliminary design in my head for an electronically more sophisticated unit (I was discussing in another thread) that would make all of the adjustments much simpler to do as you switch between games with differing requirements. That concept would be more easily applied to the joystick model than my mechanical model.

 

If new games made use to the entire range or at least roughly centered the motion, it wouldn't be a big deal to replace the potentiometers in a regular old PC joystick to get the necessary resistance change within the limited range of motion afforded by the joystick form factor. I'm running something like a 7.2 Meg pot in my controller and haven't acheived the full 1 Meg delta in my limited (<60) degrees of rotation. I think I'm maxed at about 500K delta, but it's all still pretty sloppy and in an exploratory, proof of concept stage.

Edited by BigO
Link to comment
Share on other sites

I have a preliminary design in my head for an electronically more sophisticated unit (I was discussing in another thread) that would make all of the adjustments much simpler to do as you switch from game to game.

 

The right approach is almost certainly to use a small microcontroller to manage things. This will avoid many of the "jitter" issues that always seem to plague paddles, and also allow good control of centering and range. Non-microcontroller approaches may work, but would most likely be more complicated.

Link to comment
Share on other sites

I have a preliminary design in my head for an electronically more sophisticated unit (I was discussing in another thread) that would make all of the adjustments much simpler to do as you switch from game to game.

 

The right approach is almost certainly to use a small microcontroller to manage things. This will avoid many of the "jitter" issues that always seem to plague paddles, and also allow good control of centering and range. Non-microcontroller approaches may work, but would most likely be more complicated.

 

Yes, sir, I completely agree. Hence the topic on the other thread where you were assisting me.

My current project, however, is designed to be constructed with simple hand tools by someone with basic mechanical skills. I admit it was more of a mental challenge for me to come up with a workable mechanical design.

Edited by BigO
Link to comment
Share on other sites

With analog comes calibration....

 

Which is why the Atari's don't use the full range of the paddle. By picking a conservative range of values, they ensure that the game will be playable on any machine. Your 'offset' is going to be different for each machine.

 

Don't forget the the capacitors in these machines are 25+ ears old... they are most definitely going to vary!

Link to comment
Share on other sites

With analog comes calibration....

[...]

Your 'offset' is going to be different for each machine.

 

Oh, most definitely. This is complicated further by the usable range differing from game to game. I think I have a fairly simple method to make the needed adjustments in an electronic implementation. Of course it often seems easy until it comes time to implement.

 

In my mechanical implementation, I can't just slop at the ends of the potentiometer rotation as the device has a restricted range of motion and needs to correlate its absolute orientation to the absolute position of the player on the screen. So, I have to control both the centering and the total travel of the potentiometer.

 

The centering adjustment is done by setting the controller to its physically centered position and centering the player on the screen by rotating the potentiometer housing in its mounting.

 

The overall range of motion is adjusted by adjusting another part of the mechanism which governs how many degrees the potentiometer rotates relative to the user interface of the controller as it moves through its full range of motion.

 

The ratio of motion, (potentiometer:mechanical user interface) ranges from 1:1 to theoretically 0:1. But, I doubt that I'll need to ever even approach that 0:1 for actual game play. The finished design may limit that adjustment so as to prevent the appearance that the device isn't working at all. (On the other hand, allowing that 0:1 position would obviate the need to lock the controller in place for the centering portion of the adjustment.)

 

Because the range of motion of my controller is relatively small, I had to use a higher value potentiometer to match the 1 Megohm delta afforded by the standard ~330 degree paddle controllers.

Link to comment
Share on other sites

BTW, another thing you might consider would be to use fixed-pulse-width period modulation as an alternative to pulse timing. If the port is pulled up with a 1K resistor, 2% of the time, that will be seen by the 2600 as a 50K resistor. To avoid jitter, the high pulse should probably be one microsecond or less. Further, the port should be switched between active high and floating (or else it should drive a transistor that is switched likewise). If these constraints are observed, it should be possible to control things reasonably effectively without having to sync up to the 2600's timing.

Link to comment
Share on other sites

BTW, another thing you might consider would be to use fixed-pulse-width period modulation as an alternative to pulse timing. If the port is pulled up with a 1K resistor, 2% of the time, that will be seen by the 2600 as a 50K resistor. To avoid jitter, the high pulse should probably be one microsecond or less. Further, the port should be switched between active high and floating (or else it should drive a transistor that is switched likewise). If these constraints are observed, it should be possible to control things reasonably effectively without having to sync up to the 2600's timing.

 

 

"fixed-pulse-width period modulation": does that mean that the duty cycle within the pulse remains constant, say 50%, and the period of the waveform is increased and decreased? And that would be in contrast to a constant frequency/period waveform with a variable duty cycle?

Thanks for the one microsecond estimate. I had no clue where a reasonable starting point would be in tinkering with this.

 

I think we're essentially on the same page, which gives me a whole lot more confidence that such a scheme might actually be workable. :)

 

To eliminate the jitter issue completely, I would probably need to consider sensing the controller position with an absolute position encoder or an incremental encoder with detection of a "home" position (to keep the system aware of the actual physical position of the controller), whichever is cheaper and/or easier to implement. They're probably becoming more common than potentiometers these days anyway.

Link to comment
Share on other sites

"fixed-pulse-width period modulation"

AKA "pulse frequency modulation" (PFM) instead of pulse width modulation (PWM). PFM duty cycle varies with frequency, but the duration of the "on" pulse is fixed (frequency/duty change is by duration of the "off" period only).

 

In standard PWM, total cycle time is constant but "on" and "off" times vary inversely.

Edited by A.J. Franzman
Link to comment
Share on other sites

AKA "pulse frequency modulation" (PFM) instead of pulse width modulation (PWM). PFM duty cycle varies with frequency, but the duration of the "on" pulse is fixed (frequency/duty change is by duration of the "off" period only).

 

In standard PWM, total cycle time is constant but "on" and "off" times vary inversely.

 

Pulse-period modulation isn't quite the same as frequency modulation.

 

In pulse-width modulation, if the period is 1ms, values of 10%, 20%, and 30% would be represented by pulse widths of 100us, 200us, and 300us.

 

In frequency modulation, if the pulse width is 100us, values of 10%, 20%, and 30% would be represented by frequencies of 1kHz, 2kHz, and 3kHz.

 

Using period modulation, there is no "full-scale" value but rather a non-zero minimum value. If the pulse width is 1us, then values 10x, 20x, and 30x the minimum would correspond to periods of 10us, 20us, and 30us (frequencies of 100kHz, 50kHz, and 33.3kHz).

 

Period modulation is unusual, but it's called for in this application to achieve a linear control response.

Link to comment
Share on other sites

To eliminate the jitter issue completely, I would probably need to consider sensing the controller position with an absolute position encoder or an incremental encoder with detection of a "home" position...

 

Pots are fine, if you know how to use them well.

 

There are two ways of reading pots: resistance mode, and ratiometric mode. In resistance mode, one end of the pot is left unconnected and the system measures the resistance between the wiper and the other end. In ratiometric mode, a voltage is applied between the two ends of the pot and the system measures the voltage at the wiper.

 

The biggest cause of jitter in a typical pot is variation in the wiper resistance. When reading pots in resistance mode, the wiper resistance will be added to the measured value; if it's inconsistent, it will cause 'jitter'.

 

When reading pots in voltage mode, however, if the pot is driving a high-impedance input, wiper resistance is largely a non-factor; its effect can be reduced further by adding a capacitor between the wiper and ground. Adding such a cap to a resistance-mode pot circuit won't help things, but with a voltage-mode circuit it will clean them up very nicely.

 

My recommendation would be to use a potentiometer in voltage mode and feed the output of the pot into a microcontroller's ADC pin. Depending upon the value of the pot, you might need to add a high-impedance op amp but if you use a 100K or smaller pot you should be fine (don't go below 1K, though).

Link to comment
Share on other sites

Pulse-period modulation isn't quite the same as frequency modulation.

 

In frequency modulation, if the pulse width is 100us, values of 10%, 20%, and 30% would be represented by frequencies of 1kHz, 2kHz, and 3kHz.

 

Using period modulation, there is no "full-scale" value but rather a non-zero minimum value. If the pulse width is 1us, then values 10x, 20x, and 30x the minimum would correspond to periods of 10us, 20us, and 30us (frequencies of 100kHz, 50kHz, and 33.3kHz).

 

Period modulation is unusual, but it's called for in this application to achieve a linear control response.

Po-tay-to, po-tah-to. Both methods involve a fixed "on" time and variable "off" time -- the difference is in semantics and mathematics. PPM is essentially looking at PFM from a different viewpoint.

 

But I agree that due to the charging curve of the capacitance, using a PPM-type scheme will probably give the better results.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...