Overclock.net › Forums › Video Games › PC Gaming › My GMOD Microwave
New Posts  All Forums:Forum Nav:

My GMOD Microwave

post #1 of 17
Thread Starter 

This is a microwave I made in GMod using PHX and WIRE.


I'm going to post pics and an explanation of how the wiring works, and I'll also post the link to the .txt file for advanced duplicator once I get that uploaded to garrysmod.org
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
post #2 of 17
Thread Starter 
Here I've made the invisible visible, and somewhat vice versa.

I used 8 igniters to try and eliminate "safe zones".
I also used a lot of radios in this...
At the back of the box, to the top left, you can see the ranger that I used to detect whether or not the door was shut.


Thruster...


The wireframe model was invisible for the finished product. It has an axis constraint on the glass door.


The internal components... these will all be explained later


and more...
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
post #3 of 17
Thread Starter 
The goal of this project was to make a microwave that behaved like a real microwave would... as shown in the video.

So let's break down the things we want our microwave to do:
  1. You hit a button, and you have your set timer
  2. You hit start, and the microwave turns on. The timer counts down
  3. When the timer hits zero, the microwave turns off, and the timer stops counting
  4. The microwave door must be closed to operate

I also wanted to have a selection of 1-9 seconds for the timer... each with its own independent button.
Each button, activated, has a value of the number on that button... very simple.

So we can also user the "Gate - Timer" tool, which counts in seconds upward, to help us with the countdown. And the math is very basic.

We want:
X - Y = Z

Where X is our desired time setting. Y is the Timer gate (which counts up), and Z is the remaining time left.

(Note that the Screen on the front of the microwave is connected directly to the Subtraction Gate that carries out this expression, and the decimal is dropped off with the "Floor screen value" tick box in the Screen tool settings.)

One thing that you have to know about Wire is that you can connect as many inputs as you want to a single output, but you can only connect one output to each input. So you have to find ways to combine multiple outputs into one value to be used as a single output.

And this is what we had to with the buttons...

Since we can only connect one value to our input (for example, the input being the X value in our subtraction expression), and we want to have more than one time setting for our microwave, we have to combine these buttons to a single value. And it involves even more simple math using the "Gate - Add" tool, where you simply add all of the buttons together.

Now, the "Gate - Add" tool will only accept 8 different inputs, so I used 2 of them since I have 9 buttons that need added together.

So I added buttons 1 through 4 to the first Addition Gate, and 5 through 9 on the second Addition Gate PLUS the sum of the first Addition Gate. So the button value that we press is taken from that second Addition Gate.

When the buttons are not active, they are sending a value of 0. Since you can only hit one button at a time... then you will only get the value of the button you're hitting when you hit it.

That, of course, is unless you made your buttons Toggle... and I will explain why we don't want that in my next post...
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
post #4 of 17
Dude, that's awesome!
Thing 3
(15 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phemon II X4 955 ASUS M4A785TD-V EVO ASUS 6870 1GB 256-bit GDDR5 G.Skill "Ripjaw" 6GB PC3 12800 
Hard DriveOptical DriveOSMonitor
WD 500GB + WD 80GB DVD-RW Windows 7 Ultimate x64 x2 ASUS VH242 24" Monitors 
KeyboardPowerCaseMouse
Microsoft Ergonomic 4000 700W DangerDen Torture Rack Logitech MX 518 
Mouse PadAudioAudio
Black with wrist pad JVC HA-RX700 Headphones Hercules 2.0 Speakers 
  hide details  
Reply
Thing 3
(15 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phemon II X4 955 ASUS M4A785TD-V EVO ASUS 6870 1GB 256-bit GDDR5 G.Skill "Ripjaw" 6GB PC3 12800 
Hard DriveOptical DriveOSMonitor
WD 500GB + WD 80GB DVD-RW Windows 7 Ultimate x64 x2 ASUS VH242 24" Monitors 
KeyboardPowerCaseMouse
Microsoft Ergonomic 4000 700W DangerDen Torture Rack Logitech MX 518 
Mouse PadAudioAudio
Black with wrist pad JVC HA-RX700 Headphones Hercules 2.0 Speakers 
  hide details  
Reply
post #5 of 17
Thread Starter 
So as I said, we don't want our buttons to act like toggle switches. Imagine you want to run your microwave for 6 seconds, and then the next time you run it, you want to run it for 4 seconds. If these buttons were toggled, you would have to hit the 6 button again to deactivate it before activating the 4 button, or else you would get a value of 10. I've never used a microwave in real life where you had to do that, so these buttons can't be toggled. They must be "momentary" (I guess you would call it that).

However, there is a disadvantage to having these buttons send their intended values momentarily. When you let go of the button, the value returns to zero... and that 0 value is still sent to our X variable in the X - Y = Z equation explained in my last post. So if you hit the number 6... you're going to have this:

6 - (timer) = (timeleft)

however, when you let go of it... that value changes to 0, so it will be...

0 - (timer) = (timeleft)

Which is not good because we want that value to stay at 6 until we decide otherwise.

Therefore, the value must be stored to memory when we hit the button. And I do that using the "Gate - Memory - Ram(32kb)" tool. Now this is a little tricky, but there are 4 inputs to this stick of RAM. There is an AddressRead input and an AddressWrite input, which I have connected to a constant value of 1 (meaning they're always on), a Clock input, and a Data input.

So the two inputs for the ram I focus on are the Clock and the Data. The Data is exactly what it sounds like... it's where we store what we want to store (in this case, our selected value from the buttons). When the Clock is activated (or on, with a value of 1), the RAM is accepting new Data.

My initial hypothesis to getting this RAM to store the data was simple. First, connect the sum of our buttons to the data. If the sum of the buttons are NOT EQUAL TO 0, the Clock must turn on. If the sum of the buttons are EQUAL TO 0, the Clock must turn off.
This way, when you hit the 6 button, the clock turns on and the data is stored. When you let go of that button, the clock is supposed to turn off before the value of 0 gets to the Data input.

However, this is not how it worked out every time. About 1/2 of the time, the 0 value would still get to the Data input before the Clock was turned off. So I had to find a way to get the Clock input to react faster than the Data input. And I will explain that workaround in my next post...
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
post #6 of 17
Can that microwave make my delicious popcorn? haha jk good job.
PILLS HERE!!!!!!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 920 D0 4.2GHZ (4.0 during spring/summer) Foxconn Blood Rage HIS 5870 @ 1.2V 1000/1250 Corsair Dominator 3x2GB DDR3 1600 
Hard DriveOSMonitorPower
Kingston 120GB 80K IOPS SSD 7 Pro x64 (3) Acer 23" 6144 x 1152 BFG EX-1000W 
Case
ABS Black Pearl 
  hide details  
Reply
PILLS HERE!!!!!!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 920 D0 4.2GHZ (4.0 during spring/summer) Foxconn Blood Rage HIS 5870 @ 1.2V 1000/1250 Corsair Dominator 3x2GB DDR3 1600 
Hard DriveOSMonitorPower
Kingston 120GB 80K IOPS SSD 7 Pro x64 (3) Acer 23" 6144 x 1152 BFG EX-1000W 
Case
ABS Black Pearl 
  hide details  
Reply
post #7 of 17
Thread Starter 
Quote:
Originally Posted by //.DK View Post
Can that microwave make my delicious popcorn? haha jk good job.
lol it can explode an explosive barrel... that's like popcorn, right?
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
post #8 of 17
"...He is just not happy.. "

I LOL'd hard.
Project 2K
(15 items)
 
Callisto
(13 items)
 
 
CPUMotherboardGraphicsRAM
I5 3570K P8Z77-V PRO MSI R7970 Corsair Vengeance 8GB 
Hard DriveOptical DriveCoolingOS
840 PRO 128 GBytes LG Blu-Ray Combo Custom WC loop Win7 
MonitorKeyboardPowerCase
Samsung 21.5" LED CM Storm Trigger 650 Watt SeaSonic  Fractal R4 
MouseMouse PadAudio
G700 Rosewill pad Z623 
CPUMotherboardGraphicsRAM
AMD Phenom II X2 550 BE ASUS M4A79XTD EVO 9600 GT 4GB G.Skill 
Hard DriveOptical DriveOSMonitor
250GB Seagate, 1TB WD Lite-ON Win 7 19" viewsonic HDTV 1080i 
KeyboardPowerCaseMouse
Logitech G15 650W Crosair Antec 1200 Logitech G9 
Mouse Pad
Belkin 
  hide details  
Reply
Project 2K
(15 items)
 
Callisto
(13 items)
 
 
CPUMotherboardGraphicsRAM
I5 3570K P8Z77-V PRO MSI R7970 Corsair Vengeance 8GB 
Hard DriveOptical DriveCoolingOS
840 PRO 128 GBytes LG Blu-Ray Combo Custom WC loop Win7 
MonitorKeyboardPowerCase
Samsung 21.5" LED CM Storm Trigger 650 Watt SeaSonic  Fractal R4 
MouseMouse PadAudio
G700 Rosewill pad Z623 
CPUMotherboardGraphicsRAM
AMD Phenom II X2 550 BE ASUS M4A79XTD EVO 9600 GT 4GB G.Skill 
Hard DriveOptical DriveOSMonitor
250GB Seagate, 1TB WD Lite-ON Win 7 19" viewsonic HDTV 1080i 
KeyboardPowerCaseMouse
Logitech G15 650W Crosair Antec 1200 Logitech G9 
Mouse Pad
Belkin 
  hide details  
Reply
post #9 of 17
Thread Starter 
One thing that I have to get out of the way for now is that I've assigned the activated (or on) value of my Clear button as -1, and this is also being added to the sum of buttons. But it's not logical to set a microwave timer to -1... so this gets a little complicated.

I've got another gate that detects if the sum of the buttons are GREATER THAN 0 (if it's true, this gate outputs a value of 1, if not, it outputs 0). And I have a Multiplication gate set up like so:

A x B = C

Where A is the sum of the buttons, B is the output of this "Greater Than" gate, and C is basically going to be the sum of the buttons as long as they are greater than 0. That way, when I hit the clear button, which is going to output -1 to the Addition gate, the Clock to the RAM is still activated (because remember... that the gate we assigned to the Clock was that if the sum was NOT EQUAL to 0, the Clock would be activated), and the value will be 0... which is what we want the clear button to do: reset our value to zero.

But we still need to get the Clock to the RAM to respond quicker than the Data. The simple solution to this is by putting a delay on the Data... which I'm about to explain.

I did this using another Timer. This is not the same one that we use in the Subtraction expression for the countdown.
So these timers have two inputs: Run and Reset. They're both very simple. Whenever the Run input is receiving any value that is greater than 0, it runs... counting in seconds upward. Whenever the Run input is receiving a value of 0, it stops. Also, whenever the Reset value receives an input of 1, the timer resets back to 0.

So basically I have another gate that checks if the sum of all buttons being pressed are GREATER THAN 0. If this is true, it outputs a value of 1. And I connect this to the Run input on the timer. This way, the timer runs as long as we're holding a button down. When we let go, the timer stops.
But I also need it to reset this timer to 0 when I let go of the button. So I make another gate that says if the sum of our buttons are EQUAL TO ZERO, this returns a value of 1 and I connect that to the Reset input of this Timer.
So when I hit a button now, the timer starts. When I let go, the timer stops and resets to 0.

And here is where the best part is.

I create another gate that says if this Timer is GREATER THAN OR EQUAL to a constant value of 0.05, it outputs a value of 1. If not, it outputs 0.

And then I create another Multiplication Gate that multiplies this "greater than or equal to" gate with the Multiplication Gate described above. And THIS is what I have connected into the Data input on the RAM.

So here is a breakdown of what happens so far... so think fast.

We hit our 6 button. This Timer starts and at the same time, the Clock to the RAM turns on. And for the next 0.05 seconds, the Data received by the RAM will be 0. Our button value is greater than 0, so it's multiplied by 1 to stay at 6, but is still multiplied by 0 further down the line. Once that timer hits 0.05 seconds, our value of 6 is multiplied by 1 instead of 0, and our value of 6 gets into the Data to the RAM.
We let go of our button. The timer stops, resets, and the Clock to the RAM is turned off all at the same time before the 0 value (which is the sum of the buttons once we let go of that button) doesn't get into the Data before the Clock is turned off.

And now, even though the sum of the buttons is 0, we have our RAM outputting a value of 6.

Edit: You can even see a side-effect of this sometimes when I hit a button... the screen will flash to 0 really quick before going to our selected value.

What we do with that value might be apparent...
Until next time...
Edited by dglkn - 6/3/08 at 7:27pm
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
X2 5000+ Black Edition Asus M2N-SLI Deluxe DIAMOND ATI Radeon HD3850 256Mb G-SKILL 2GB (2 x 1GB) DDR2 800MHz Dual Channel 
Hard DriveOptical DriveOSMonitor
Seagate Barracuda 7200.10 250MB SATA 3.0Gb/s SAMSUNG 20X DVD±R DVD Burner SATA Model SH-S Windows XP Pro SP2 Dual 17" CRT Monitors 
KeyboardPowerCaseMouse
Standard USB Media Keyboard Ultra X2 750W Modular Ultra Aluminus Mid-Tower HP 5-Button Optical 
Mouse Pad
Standard Optical 
  hide details  
Reply
post #10 of 17
that is awesome.
Lurking Ninja
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 D0 3849B203 4.0GHz/1.164 Evga X58 Classified E759/Koolance X58/BIX 120 TRI SLI GTX 285s.** 6GB 3x2 OCZ Gold 1600mhz 
Hard DriveOptical DriveOSMonitor
2x WD3200AAKS (RAID0), 1tb AALS Samsumg Wrigtmaster Sb 204/182 Windows 7 Ultimate X64 Gateway HD2401 24" 
KeyboardPowerCaseMouse
Logitech G15 V1 Corsair HX1000W Modded Rocketfish Logitech MX Revolution 
Mouse Pad
soft cotton? 
  hide details  
Reply
Lurking Ninja
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7 920 D0 3849B203 4.0GHz/1.164 Evga X58 Classified E759/Koolance X58/BIX 120 TRI SLI GTX 285s.** 6GB 3x2 OCZ Gold 1600mhz 
Hard DriveOptical DriveOSMonitor
2x WD3200AAKS (RAID0), 1tb AALS Samsumg Wrigtmaster Sb 204/182 Windows 7 Ultimate X64 Gateway HD2401 24" 
KeyboardPowerCaseMouse
Logitech G15 V1 Corsair HX1000W Modded Rocketfish Logitech MX Revolution 
Mouse Pad
soft cotton? 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: PC Gaming
Overclock.net › Forums › Video Games › PC Gaming › My GMOD Microwave