TimWilborne Posted December 25, 2006 Report Posted December 25, 2006 I'm working on some training material and have a nice application for a random number generator. I'm now trying to figure out some real world applications for this. In my programs I'm always looking for predictable operations. What would be an application that would require this unpredictable operation? Thanks TW Quote
jstolaruk Posted December 26, 2006 Report Posted December 26, 2006 (edited) In-process automatic gages that I've done in the past are often required by the customer to have a built in GR&R study so the measuring capability could be verfified. The order of the measured parts is to be randomized hence a RNG comes in handy. Edited December 26, 2006 by jstolaruk Quote
Chris Elston Posted December 26, 2006 Report Posted December 26, 2006 I did a NASCAR pool thingy for work. That's the only time I've ever used a random number picky thingy. http://forums.mrplc.com/index.php?autocom=downloads&showfile=207 Check in the MACROS. Quote
rpraveenkum Posted December 26, 2006 Report Posted December 26, 2006 see link to generate a random number http://computer.howstuffworks.com/question697.htm Quote
TimWilborne Posted December 26, 2006 Author Report Posted December 26, 2006 I already have random number generator code that works great. Someone asked for my Solitaire code I wrote for a Panelview and that made me think to include a random number generator as a training exercise. It is the same code and while I'm not doing the full blown Solitaire I'm going to do a simpler game. I just can't come up with real world applications for it. Jstolaruk's measuring verification is an example but is a bit more complex than what I'm looking for. I would have to write an entire chapter just to explain it's application. Picking Nascar numbers is about as close to real world as I can think of or using a PLC for a slot machine. Was just trying to find a simple need for this unpredictable application in our predictable control world Any other ideas? Thanks TW Quote
jstolaruk Posted December 26, 2006 Report Posted December 26, 2006 Well, this is not an industrial application, its one that I'm going to "commission" at our local sportsmens club and is pretty simple. The game of Trap uses a machine that throws clay targets in random directions. The shooter calls for the target and then the machine uses hydraulics to pivot back and forth between two limit switches for a random amount of time and ends in a new direction for the next shooter. These machines come with relay logic and their reliability is not as good as it should be so I was going to put a smart relay in it, like a ML1000 or Pico controller. I'll need to program a RNG to replace the random time device that is used now. Quote
TimWilborne Posted December 26, 2006 Author Report Posted December 26, 2006 Now that is a cool application Quote
rpraveenkum Posted December 26, 2006 Report Posted December 26, 2006 you can use this code http://www.plctalk.net/qanda/attachment.ph...tachmentid=4974 Quote
TimWilborne Posted December 26, 2006 Author Report Posted December 26, 2006 I have the code, it is easy. I wrote it 5 or so years ago. I'm trying to find real world applications that would use the code for a training manual Thanks TW Quote
IO_Rack Posted December 26, 2006 Report Posted December 26, 2006 How about generating industrial safety tips on the HMI? Kinda like the Windows 'Tip of the day' pop ups. Example: "Did you know.... XX out of XXX people lost a digit when reaching into a running industrial machine." Just a thought. Quote
adamriffe Posted December 26, 2006 Report Posted December 26, 2006 Now that's an Idea! I like that. Quote
TimWilborne Posted December 26, 2006 Author Report Posted December 26, 2006 Good idea IO-Rack, thanks Quote
OkiePC Posted December 26, 2006 Report Posted December 26, 2006 This question arose once before, and someone responded that they used random numbers in a waste processing plant to randomize the setpoint for a tank level to prevent the scum layer from building up in one spot on the tank wall. That was something I never would have thought of as a real industrial application for random numbers. Quote
BobLfoot Posted December 27, 2006 Report Posted December 27, 2006 I can't say more than what follows here TW, but a variant of Random Number Generator code is used in baggage selection when determining what to hand screen and what is auto screened. Quote
Peter Nachtwey Posted December 27, 2006 Report Posted December 27, 2006 I use random numbers to generate noise on simulated feedback signals just so my PIDs work with something closer to real world when testing. I also round or quantize the feedback. I would also use random number generators to generate different size, color or shape of an object that must be sorted. For instance a lumber mill has a sorter that must sort different lengths, widths, thicknesses and grades. I think lumber sorters are excellent projects for advanced programmers but not for beginners. Quote
OZEE Posted December 29, 2006 Report Posted December 29, 2006 There's times I've been convinced that there's some kind of program determining which luggage gets delivered to the right airport at the right time, too! Quote
TimWilborne Posted December 29, 2006 Author Report Posted December 29, 2006 I think Jstolaruk and Peter both have excellent examples but I think all practible examples are too complicated for a basic trainer. I think I will just make this one a fun exercise at the end Thanks TW Quote
TConnolly Posted December 29, 2006 Report Posted December 29, 2006 Have them make a roulette wheel. Quote
Peter Nachtwey Posted December 29, 2006 Report Posted December 29, 2006 Those are the simple ones. For kicks one time I generated a sine wave and then used an FFT to determine te frequency. That was simple. Then I added noise the the sine wave and then used the FFT to determine if I could still pick out the signal. I could. I made the amplitude the of the noise MUCH bigger than the amplitude of the sine wave and I could still pick out the signal. I just just playing around. I wanted to know how space vehicles out beyond Mars could still send messages back to earth with just a small transmitter. Now I know. It can be done but there is a trade of with the data rate. I like to see how much noise I can generate on feedback and still calculate a good signal. The list goes on. I know this is too much for a PLC class but don't you ever wonder how they do that?. I do. Quote
Peter Nachtwey Posted December 30, 2006 Report Posted December 30, 2006 Back on topic. Alaric's idea is good but too simple. How about playing black jack? The trick would be shuffling the cards. Craps would be much easier than black jack but still harder than a roulette wheel Keno would be a little harder than craps. Now TWControls has many options with varying degrees of difficulty. Quote
TimWilborne Posted December 30, 2006 Author Report Posted December 30, 2006 My trainer has 4 lights. Green, Red, Yellow, and blue. Remember the game Simon from back in the 80's? This is my random number generator. For those of you who don't remember it or are too young to have played the game I put it up on my wifes site Simon Game Quote
TERdON Posted December 30, 2006 Report Posted December 30, 2006 This subject that you're interested of is a part of information theory, more specifically channel coding, and the limit you're curious about is called the Shannon limit (after Claude Shannon, who found the theorem describing it). More information is available about the Shannon-Hartley theorem at Wikipedia. Quote
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.