RARusk Posted August 30, 2012 Share Posted August 30, 2012 Objective The objective of this topic is to bring together information regarding rotary encoder usage for the game "Tempest 2000" (Atari Jaguar). Although the game is nearly twenty years old it is still considered one of the best home versions of the popular arcade game "Tempest" and usage of rotary encoders is the best way to truly replicate the arcade experience at home. This topic can also be used to bring together new information on encoders as well as chips that can be used as clean-up circuits for optical units. This topic can also be used to show off homebrew encoder setups, like mine for example: A Brief History During the late stages of development the programmer, Jeff Minter, was approached by someone from Atari who told him to make an Atari 2600 style paddle controller work with "Tempest 2000". He did make it work but it was so late in the development cycle that he did not have a chance to fine tune the programming. He did, however, leave the code in the game but made it accessible through a secret menu. Activation and Implementation To activate the option to use a rotary encoder you need to hook up two joypads to the Jaguar. Then you need to go the Options Menu and press Pause on both Joypad 1 and 2 at the same time. A new option, called Controller Type, should now appear. This will allow you to choose between using a joypad or rotary controller. When playing with a rotary controller you also need to use a Joypad in the opposite Joyport. The Joypad is used for the following: --Selecting choices in the Options Menu. --Navigation in the ring-based bonus stage. --Selecting your initials when achieving a high score. Quadrature Signals What Minter did was to allow the game to accept quadrature signals. A simplistic explanation: The rotary encoder outputs two square wave signals (called A and B) that are 90 degrees out of phase (hence the term quadrature). In software, these signals are compared to a table to determine direction. How fast the signals change determines speed. Joypad Schematic You cannot just hook up an encoder to the Jaguar - you need to interface it with a joypad first. Although one could make a custom PCB most people find it easier to just hack a plug into an existing joypad. The Jaguar's joypad uses what could be called a grid system. When a button is pressed two of the lines "light up" which tells the Jaguar which button is being pressed. This is a gross oversimplification and may not be totally accurate but it is the easiest way to visualize how the joypad works. In addition, the joypad uses what is known as "negative logic". Normally, when you close a switch, a line can go HIGH. In the Jaguar, however, everything is already considered HIGH so, when you close a switch, both intersecting lines go LOW - reverse of what happens in most joypads. For the sake of this topic I am focusing on Padport 4 (column for Left/Right), Padport 11 (row for Right), and Padport 12 (row for Left). Mechanical Encoder Hookup A definition of a mechanical encoder (from WikiPedia): "A metal disc containing a set of concentric rings of openings is fixed to an insulating disc, which is rigidly fixed to the shaft. A row of sliding contacts is fixed to a stationary object so that each contact wipes against the metal disc at a different distance from the shaft. As the disc rotates with the shaft, some of the contacts touch metal, while others fall in the gaps where the metal has been cut out. The metal sheet is connected to a source of electric current, and each contact is connected to a separate electrical sensor." These types of encoders have three connectors; A, B, Common/Ground. Common is usually the center connector. Hooking up one of these encoders to the joypad is pretty easy. The left connector (A) goes to to Padport 12, the right connector (B) goes to Padport 11, and center (Common) goes to Padport 4. Note how Common is not used here. When looking at the grid you can see that Padport 4 is "common" to both Padport 11 and 12. So hooking up Padport 4 to the center connector allows this type of encoder to work. One downside to using this type of encoder is that, because of the physical contact inside the unit, the feel is not as smooth and that it can wear out faster than an optical based unit. Another downside is that many mechanical encoders do not have the resolution to allow for proper play. Low resolutions (detents) means that your shooter will move slowly around the playfield and you will have to spin the encoder much faster to compensate. However, depending on manufacturer, you can acquire mechanical encoders with a high number of detents thus providing good enough resolution for comfortable play. Optical Encoder Hookup A definition of an optical encoder (from WikiPedia): "The optical encoder's disc is made of glass or plastic with transparent and opaque areas. A light source and photo detector array reads the optical pattern that results from the disc's position at any one time." Because there is no physical contact necessary to create the quadrature signals an optical encoder has much more smoothness in feel and responsiveness than a mechanical encoder. It is, however, a little tougher to hook up to the Jaguar, especially if the encoder is taken from another device like a game controller or editing board. For starters, an optical encoder needs voltage and ground to operate. Thankfully, the Jaguar has the right voltage, +5VDC, to run the encoder. Some optical encoders have A and B channels marked. But, if taken from another device, you will have to poke around the encoder circuitry. Thankfully, you can get the signals, as well as find ground and voltage, at the connector that connects the encoder with the rest of the device it was taken from. However, there are usually several pins on the connector and you will have to find which ones are the A and B channels. As for finding A and B you can hook up the voltage and ground to the encoder and use a multimeter to find the signals, which should alternate between five volts and zero, when the encoder is gently turned. Another method, if you do not have access to a multimeter, is to connect a wire to either Padport 11 or 12 and place it on one of the connectors, start up a game in T2K, and gently spin the encoder. If the shooter twitches in place then you have found one of the channels. If not then move the wire to another pin and twist the encoder again. Once both channels have been found then hook them both up and spin the encoder while playing a game of T2K to make sure that the shooter moves in the correct direction. If the shooter moves in the reverse direction of your spin then you need to switch wires. It should be noted that, as an interesting design choice (which would also apply to mechanical encoders too), you could put in a switch that would reverse A and B. This would make an interesting challenge by basically playing the game backwards. It is very important to note that you cannot hook up Padport 4 to the encoder. The game won't work if you try to hook up Padport 4 to anything on it. Even though you can't use Padport 4 the game will still work with the encoder once A and B are properly hooked up. One negative to using an optical encoder - most of them usually have just a little too much resolution. When in the main menu of the game barely touching the encoder will cause the cursor to go rapidly up and down the list. But, in general gameplay, the encoder operates very well. Because of the electrical characteristics of the A and B channels and the fact that you cannot hook up Padport 4 to the encoder, there are a couple of bugs that manifest themselves during the course of the game. Bugs The first bug concerns the camera controls. There are three different camera views: Default, Locked, and Close-Up. During play the camera will automatically go into Close-Up view. If you press any of the other camera buttons it will go into that view but, when you let go of the button, it will simply go back into Close-Up. The second bug concerns the ring-based bonus stage. You use the Joypad in the other Joyport to control yourself through the rings (using the D-Pad to go in all four directions). The bug manifests itself in that you can go up, down, and right but not left. This will prevent you from taking advantage of the stage. To clear up these bugs a clean-up circuit is required. Clean-Up Circuit The circuit consists of a single chip that contains two high-speed CMOS based Single Position Single Throw (SPST) switches. To illustrate how to hook it up to the encoder I will use the chip that I used for this purpose, the ISL43120: 1 - Padport 4 (Column - Left/Right) 2 - +5VDC 3 - Optical Encoder (A) 4 - Padport 12 (Row - Left) 5 - Padport 4 (Column - Left/Right) 6 - Ground 7 - Optical Encoder (B) 8 - Padport 11 (Row - Right) The A and B channels operate the actuators that close the switches. For example, when Pin 7 (B) goes HIGH then the switch closes and Pin 1 (Padport 4) and Pin 8 (Padport 11) go LOW - exactly what the Jaguar needs for error free operation. As a result this chip removes the bugs out of the optical encoder setup. Although the ISL43120 works very well it is not recommended because it is an extremely small surface mount chip - not suitable for beginners. A Dual Inline Pin (DIP) chip, the 74HC4066, was recommended as a replacement for the ISL43120. I was unable to find the 74HC4066 but was able to find a similar chip, the MC14066, which worked fine with the encoder. During research I also found another potential replacement, the MAX323. There are probably plenty of other chips of this type that can be used as clean-up circuits. A DIP type chip is much larger and can be used with sockets which makes it much easier to use for beginners. Thanks to the large size of the Jaguar Joypad you can probably fit one of these DIP chips inside the Joypad but it is generally recommended that it be used inside the encoder unit. Optical Encoder Notes In the ring-based bonus stage if you touch the encoder in any way you can zoom either to the far right or left very quickly. This may prevent you from flying through the rings as the Joypad controls are a bit sluggish during this stage. Additional Contributions --Tyrant --Zerosquare 1 Quote Link to comment Share on other sites More sharing options...
Tyrant Posted August 30, 2012 Share Posted August 30, 2012 Interesting post. However, I've got a couple of minor quibbles for accuracy's sake. First off, you say mechanical encoders are generally too slow (low resolution), but that depends on the make and model of the encoder. The ones generally used are the original 2600 pads, which have just 16 steps (4 cycles) and are very slow indeed, and ones with 36 steps (9 cycles) which give a much better feel. Secondly, you use the word "detents" to describe the number of steps (resolution) of mechanical encoders. While I am not a linguist, I have generally found that mechanical encoders tend to come in two varieties, those which have a little resistance between each step, and those which spin freely. The ones which have that feedback resistance are referred to as "detented". The controllers I made and sold have 36 detents per spin, as I believe do the ones made by Jonathan Ascough, while the ones made by Chaos Reigns used smooth ones with no tactile feedback between steps. I may however be wrong about that as I don't own any of those guys controllers myself. Also, your "Bugs" section is misleading, and implies that you have created a clever work-around for a flaw in the design of the controller circuit. In fact you have simply connected everything badly and it should really be "this is why you shouldn't do this". The Jaguar controller has four common lines, which are polled in sequence during normal gameplay. By directly connecting any of the pins to +5v or to ground, you are effectively locking an entire column of buttons to either on or off. It should be pretty obvious that in the matrix setup you illustrated, if you bypass the diodes and resistors and just connect things straight to the power and ground rails (via your optical encoder) you're going to get some pretty odd results. Otherwise that's a moderately useful post. 3 Quote Link to comment Share on other sites More sharing options...
RARusk Posted August 30, 2012 Author Share Posted August 30, 2012 Well, this topic was designed as a "one stop area" for information about this subject starting with my own knowledge and experiences with this with others adding new information and correcting errors. Since my focus was on optical encoders my knowledge on mechanical units was minimal and based on my limited experiences with them. As for hooking up the optical encoder I did not bypass any resistor or diode in the joypad. Even though I do have some degree of technical knowledge I didn't realize that I was locking down a column which was causing the problems. As for "Bugs", you're probably right in that it should've been called something else but it was the first thing that came to mind when I wrote this and I went with it. I do appreciate the feedback and would like to see this topic grow with additional information, especially on mechanical encoders and other electronic info. Unfortunately I am not able to go back and edit my initial post with this new information and corrections. One idea that just came to mind is that if enough information is put forth then I could put it together into a text document and host it at GameFAQs just like all of my other guides and link it back here. At least with a text document I could easily revise and improve upon it at a moments notice. Quote Link to comment Share on other sites More sharing options...
Hyper_Eye Posted August 30, 2012 Share Posted August 30, 2012 If you intend to maintain a post with growing information you can request that it be made editable to you. Simple report the post and in the report state you are requesting that it be made editable followed by an explanation of why that would be beneficial to the thread. 2 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted August 30, 2012 Share Posted August 30, 2012 The controllers I made and sold have 36 detents per spin, as I believe do the ones made by Jonathan Ascough, while the ones made by Chaos Reigns used smooth ones with no tactile feedback between steps. I may however be wrong about that as I don't own any of those guys controllers myself. I owned all three and you are correct. Most people I've spoken to who have used either your pad or JA's with detents and also used the CR, tend to prefer the smoother and slightly more responsive CR. A detented encoder can be modified though as OMF suggested at e-Jagfest last year: open it up, remove the little metal ball, make sure it's clean inside but still greased up and put it back together (will need some glue probably) - it can feel a little scratchy if you remove too much of the juice, but the smooth spinning is worth it I think, especially with the encoders I bought - they had too much resistance when turning. Luckily, Gaztee tracked some of the free-spinning encoders down and sent me a few for modifying the pads I bought at AC2012 2 Quote Link to comment Share on other sites More sharing options...
Tyrant Posted August 30, 2012 Share Posted August 30, 2012 That's interesting. Back when I was making them, the only other ones anyone had were JediJeff optical controllers which were incredibly hyper-sensitive, and hacked 2600 controllers, which were the other way. I had the choice between detented and smooth, and went with detents because it made the menus and bonus stages easier to navigate (I didn't know about the second pad trick for bonus stages at that point). 1 Quote Link to comment Share on other sites More sharing options...
RARusk Posted August 31, 2012 Author Share Posted August 31, 2012 If you intend to maintain a post with growing information you can request that it be made editable to you. Simple report the post and in the report state you are requesting that it be made editable followed by an explanation of why that would be beneficial to the thread. Didn't know you could do this. Thanks for the info. I'll wait a bit to let more useful information come forth before I go and revise the post. Quote Link to comment Share on other sites More sharing options...
RARusk Posted August 31, 2012 Author Share Posted August 31, 2012 That's interesting. Back when I was making them, the only other ones anyone had were JediJeff optical controllers which were incredibly hyper-sensitive, and hacked 2600 controllers, which were the other way. I had the choice between detented and smooth, and went with detents because it made the menus and bonus stages easier to navigate (I didn't know about the second pad trick for bonus stages at that point). Yeah, opticals tend to be a bit sensitive. But I wonder, does anybody make an optical encoder with removable spoke wheels which would allow you to basically adjust their sensitivity? I don't think I've seen any but would be nice if they exist. One day I would like to try my hand at making a full scale arcade controller for T2K using either a Slik-Stik or an actual Tempest rotary controller if I am lucky to score one. Quote Link to comment Share on other sites More sharing options...
Tyrant Posted August 31, 2012 Share Posted August 31, 2012 You would have to do more than just remove spokes, you'd have to widen the others to compensate, and widen the space between the sensors too, otherwise the 4 steps in each cycle would be different sizes and you'd get a very odd output with some pulses longer than others even when spun at a constant speed. 1 Quote Link to comment Share on other sites More sharing options...
danny_galaga Posted September 1, 2012 Share Posted September 1, 2012 You would have to do more than just remove spokes, you'd have to widen the others to compensate, and widen the space between the sensors too, otherwise the 4 steps in each cycle would be different sizes and you'd get a very odd output with some pulses longer than others even when spun at a constant speed. I think he means where you could take out the encoder wheel and swap it for another wheel with a different number of spokes/slots. Quote Link to comment Share on other sites More sharing options...
Tyrant Posted September 2, 2012 Share Posted September 2, 2012 I considered that, but as I said in my earlier post, just widening the spokes/gaps (which must be equal width) isn't enough. You would also have to re-locate the optical sensors, since they have to be the correct distance apart relative to the size of the spokes. Typically in an optical encoder the two sensors are very close together, often in the same integrated package (making them impossible to separate), and if you were to widen the spokes without adjusting the sensors, you would find that the two square waves would shift sideways relative to each other so that the transitions on both lines occur much closer together, with long periods in between where both outputs are in the same state. 3 Quote Link to comment Share on other sites More sharing options...
RARusk Posted September 3, 2012 Author Share Posted September 3, 2012 So an adjustable encoder (either mechanical or optical) isn't possible then. It was an interesting question to ask at least. And, based on what you said earlier Tyrant, 36 detents would be considered the "sweet spot" in regards to mechanical encoders, yes? If that is the case is there a way to find out what the optical equivalent of that would be? That way one could look for a specific kind of optical encoder that would fall into the "sweet spot" and you wouldn't have as much of a sensitivity issue. I was also doing some surfing around on the subject of T2K and encoders and found a couple of interesting things: First was this: This is a Powermate Jogwheel for computers. Somebody mentioned using this for MAME. But, with some rewiring (removing the USB cable and putting in another cable), this could be useful, and cool, for the Jag. Second, somebody managed to make a rotary encoder for the PlayStation version of "Tempest". Interesting idea but I would rather prefer to use a PS1 mouse as an interface and use my rotary setup instead. I think I already have a PS1 mouse but I should find another just to hack up for this purpose. Quote Link to comment Share on other sites More sharing options...
danny_galaga Posted September 3, 2012 Share Posted September 3, 2012 So an adjustable encoder (either mechanical or optical) isn't possible then. It was an interesting question to ask at least. Well, it IS possible, just that you have to do it yourself. If you check out forums for those 'battlebot' guys, you'll find info on the subject. They often make their own set ups, including making their own encoder wheels. Haven't looked recently, but I can imagine a set up where you have the opto-coupling on a slide, so that if you change one wheel for another (more or less slots = bigger or smaller diameter) you can then adjust the coupler to suit. But there probably isn't something like that commercially available... Quote Link to comment Share on other sites More sharing options...
Tyrant Posted September 3, 2012 Share Posted September 3, 2012 36 steps / 9 cycles was at the time the highest I could find available. I think it gives a pretty good control, but I'd say anywhere from nine up to about 20 cycles would be acceptable. But that's just a guess. The guys from Reboot have done some sensitivity testing, and their upcoming rotary game will have a sensitivity adjustment in software. It should be possible to patch Tempest to have a similar adjustment. 3 Quote Link to comment Share on other sites More sharing options...
RARusk Posted January 28, 2013 Author Share Posted January 28, 2013 I went to a used computer shop today and encountered a "DJ Hero" turntable. And I got to thinking that it would be an interesting alternative for playing T2K. You wouldn't really be able to use the buttons on the turntable for firing and jumping because of where they're placed so they would have to be off to the side. But it would be kind of cool nevertheless. Maybe one of these days I'll get one just to hack up and see. 2 Quote Link to comment Share on other sites More sharing options...
Guitari Posted February 9, 2013 Share Posted February 9, 2013 Hi guys, I've been looking at this vid http://www.youtube.com/watch?v=JMKRKZeEwaA with regards to doing the rotary mod.. But when it gets to where to hook the wires up to things get a little sketchy. the chap seems to talk through it quite quick and I just cant see exactly where EVERYTHING is soldered to. Could this thread have some nice close up photos of the controller's board, the encoder and the switch please? All the best Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 9, 2013 Share Posted February 9, 2013 this is super easy to follow: http://www.jagware.org/index.php?showtopic=930 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 9, 2013 Share Posted February 9, 2013 An interesting Wii arcade stick to Jaguar rotary hack, here's a video: http://youtu.be/fg--lWg7ZpQ The sticks can be had on eBay UK for £6 delivered, I've grabbed a few, I like the look of this. 5 Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 9, 2013 Share Posted February 9, 2013 An interesting Wii arcade stick to Jaguar rotary hack What a neat controller modiification that is. Quote Link to comment Share on other sites More sharing options...
Guitari Posted February 9, 2013 Share Posted February 9, 2013 this is super easy to follow: http://www.jagware.o...p?showtopic=930 Thanks sh3-rg, I shall do my best to follow this photo.. I should be ok with the switch (I did get a DPDT) and with soldering to the encoder. It's soldering to circuit boards that always worries me! As far as I can see from the photo there are 12 solder points in a row on the board, right to left, ground goes to point 1, blue to point 2 and red to point 11 - or it could be point 12, I'm not sure! Quote Link to comment Share on other sites More sharing options...
Guitari Posted February 9, 2013 Share Posted February 9, 2013 Ignore that - it helps if I actually read stuff I'm provided with! The thread says second from the left (or 11th from the right then!) Quote Link to comment Share on other sites More sharing options...
danny_galaga Posted February 13, 2013 Share Posted February 13, 2013 An interesting Wii arcade stick to Jaguar rotary hack, here's a video: http://youtu.be/fg--lWg7ZpQ The sticks can be had on eBay UK for £6 delivered, I've grabbed a few, I like the look of this. Meh, you STILL end up with a left-handed rotary controller Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 13, 2013 Share Posted February 13, 2013 Meh, you STILL end up with a left-handed rotary controller ta-da! The vast majority of controllers, be them pads, arcades sticks or whatever, are set out that way, but some people just can't spin with their left hands. 2 Quote Link to comment Share on other sites More sharing options...
danny_galaga Posted February 14, 2013 Share Posted February 14, 2013 ta-da! The vast majority of controllers, be them pads, arcades sticks or whatever, are set out that way, but some people just can't spin with their left hands. That's why I make my controllers right handed (",) Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 15, 2013 Share Posted February 15, 2013 That's why I make my controllers right handed (",) Like this one: Uses the guide mentioned above & zero's for switching. Originally made use of the existing switch but removed it as I thought it was glitchy, then used that big silver thing. Only later realised it was something else that was the problem but it was too late to revert (will make use of it for the next one). Spinner on right is quite nice :-) 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.