November 24, 2024, 03:03:26 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


2010 Hellevator Simulator

Started by Ryanm0085, July 25, 2010, 12:36:37 PM

Previous topic - Next topic

Ryanm0085

Alright.  Last years plan started underway, but with all the changes and because it took so long Jonny recommended a new topic so here it is.  I followed my basic plan but made added and took away things.  First i got rid of the VMusic player.  What a piece of crap...So i bought a uMP3 player to give it a shot.  I got rid of the E-stop function on the prop-2 and built it into the power circuit that supplies the prop-2 and DC-16.   The last big change is i added a 12v backup system incase we loose power or something comes unplugged.  We run most of our power off of a 25kw Deisel Generator.  This will allow the elevator to return to the ground and open the doors to allow a safe exit.  I have based this entire project off of real elevators from the size to the actual sequence.  It may seem extreme at times but i think once its done its going to be awesome.  I have taken pictures but haven't had time to put them up.  Once its complete i will take a video off the entire sequence.  The last thing i need help on is the program.  I think i may be able to tackle it, but i was hoping for some help.  I will list my inputs and outputs and a basic idea of what they should do.  If u look not evereything is used.  I just need a basic idea and then i will fill in the rest and fine tune it.  I'm gonna give it a shot and start the program later today, but any help or suggestions would be great...

PROP-2
P0 - NO Trigger
P1 - NO Trigger
P2 - NO Trigger
P3 - Lights On (wired on a relay so when the relay is open, the lights stay on.  When P3 is high, the lights go off)
P4 - Inside Light Toggle (Toggles Black lights and Flourescent Lights)
P5 - Outside Light Toggle (Toggles High Hat and Strobe Light)
P6- Up Solenoid
P7 - Down Solenoid (on a NC relay.  When power is cut the elevator will return down)
P8 – Relief valve
P9 – Up Arrow
P10 – Door Toggle (When high doors will close, when low doors will open)
P13 – uMP3
P14 – uMP3
P15 – serOut

DC-16
P0-P10 are connected to a 7 segment led display.  This is not to important.  If you can show how to get the serout commands I can create sub-routines for the numbers.

On initialization I would like everything to fire about 2 seconds individually to insure everything is working.  Also P7, P10, and P3 should be set high.

Initilization:
Turn Off P10
Flash through P0-P10 on the DC-16.  Fast is fine
Turn Off P3
Fire P4 (2 seconds)
Fire P5 (2 seconds)
Fire P9 (2 seconds)
Turn On P3
Turn On P10
Turn Off P7
Fire P6 (2 seconds)
Turn On P7
Fire P8 (2 seconds)
Start mp3 (1.mp3)

Routine:
When Trigger 0 is pushed:
Turn Off P3
Wait 3 seconds
Turn On P9
Wait 1 second
Turn off P10

When Trigger 1 is pushed:
Immediately Start     2.mp3
Wait 3 Seconds
Turn Off P9
Turn On p10
Turn On P9.dc16
Wait 2 Seconds
Fire P6 for 2 seconds
Turn Off P7
Turn Off P3
Turn On P4
Wait 3 Seconds
Turn On P3
Turn Off P10

Trigger 3 (reset to wait for triiger one):
Turn on P10 and P7
Turn Off P3 and P4
Turn off all dc-16 outputs
Start 1.mp3

This is very basic of what I need.  After this code, I will be able to fine tune and should have no problem adding things where I need them.  Not all the channels were used, but I will add them in once I start fine tuning.  I appreciate all of your help Jon as well as everybody elses.  you guys are great.  .  This should be one bad ass ride once its complete...im very excited... 

JonnyMac

Okay... here we go again!  ;D

Specifics are required, and while you have detailed post, it is lacking in specifics that a programmer (which could have been you after all this time!  ;) ) needs to do the job seem missing.  Let me list some.

Flash through P0-P10 on the DC-16.  Fast is fine

What does flash mean?  What does fast mean?  Keep in mind that once you move past this step the DC-16 outputs will remain static -- you can't do animation on the DC-16 while you're attending to other things.

Fire P4 (2 seconds)
Fire P5 (2 seconds)
Fire P9 (2 seconds)


Does "fire" mean pulse on then off?  Do these items happen in series or simultaneously?

You see where I'm going here -- elevator simulations are tough (I know, I did one for a local haunt last year) so you have to be super detailed with the information.



Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

Hey Jonny, i do appologize for not being more detailed.  im having a problem with this forum.  for some reason when i type it keeps scrolling back up so its making it very hard to type anything long.  I tried to modify my last post but it continues to scroll to the top so im just gonna try and clarify.  Another program for someting else i use uses Fire.  Its just on for 2 seconds and then off...

Basically P4 on for 2 seconds then off
Then P5 on for 2 seconds then off
Then P9 on for 2 seconds then off

For the DC-16, i know there is a command that cycles through each channel on and off but i forget what it is called.  Basically i just want it to cycle on and off for maybe 1/2 a second each channel starting with P0 and ending with P10 and then remain off until later in the programming...

Once again im trying to give u all the info but i dunno if its my browser giving me problems or what.  Its rather annoying cause i cant see what i typed.




BigRez

July 26, 2010, 09:38:16 AM #3 Last Edit: July 26, 2010, 10:19:57 AM by bigrez
Just a hint that may help with browser issues... Whenever I'm creating something more than a few sentences, I always type it locally (like in notepad) and then cut-and-paste it into the target page.  It also allows one to spend extra time working on the writeup without fear of losing all that was already typed.

Also, note that there are TWO scrollbars when entering a post... one for the window and one for the textarea where the text is typed.

Patiently waiting to see pics and vid of this creation... sounds like it'll be awesome!

JonnyMac

Do you have all of your hardware together?

When John and I created the AP-16+ the first thing I did while John was working on the PCB layout was create a test program that would allow us to electrically verify the PCB once built.  By running test code before developing application code I didn't spend time chasing hardware errors.

So... first things first.  Make sure that you can "talk" to the DC-16 (use the standard test program), make sure you can start the audio player under control, make sure that you can control all of the other outputs as your application will eventually need.  Proving all the sub-sections separately will save a lot of time in the end; I have had many people tell me "the code you sent doesn't work" only to find later that it was a hardware error.

I don't know about the browser thing; I tend to use Firefox and have had no troubles.
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

thanks bigrez but i have no clue whats causing it.  i did exactly what you said though, typed it in wordpad then pasted it. 

Jonny, i will deff do that.  i never thought about running a test program.  im not sure if ill get to it tonight, but deff tomorrow. i will check communication to the DC-16 and then uMP3 player, as well as all my relays.  your a genius

JonnyMac

Not a genius.... I've just worked my way through more "bugs" than you and have devised ways to shorten/mitigate that process.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

July 26, 2010, 07:59:04 PM #7 Last Edit: July 26, 2010, 10:22:10 PM by bsnut
Quote from: JonnyMac on July 26, 2010, 06:15:13 PM
Not a genius.... I've just worked my way through more "bugs" than you and have devised ways to shorten/mitigate that process.

Working through the bugs is what we programmers do.

Now DC16 issue. How fast are trying run through your numbers? There is two ways to do this; 1: A subroutine needs to be used to access the DC16 while your program is checking other I/O. This means that your program jumps into subroutine and does the 7 segment display code, than back to your main code, and this happens over and over until your main code is done. ; 2: Setup a output to trigger another Prop board (Prop1) to handle the work of the 7 segment display. The Prop1 will work fine, since it has 8 I/O on it and can use the POT command to control the timing or speed of your 7 segment display.

Some control engineers use many boards to make their applications work. When I build a control system I keep it simple.

By the way, I typed this post on my phone. I will love to see your work when you are done.
William Stefan
The Basic Stamp Nut

Ryanm0085

thanks for the info bsnut.  i ran 3 different controllers last year for my skeleton...a Prop-SX, a Prop-2, and a KIT74.  Everything worked great.  I'm not really sure if it would be better to use another controller for the Numbers or not.  I'm not too concerned on the timing of the numbers.  i was just going to slip the sub-routines in when i knew i had a break.  I would like to make it as realistic as possible and im sure thats where using another controller would come into play.  I have an extra Prop-1 laying around so i might just do that.  Once everything is wired to my Prop-2 and DC-16 i will do some test runs and see what happens.  If the timing isn't right, i will try using the Prop-1 for the numbers.

Ryanm0085

Alright i put a test code in for the dc-16 and it cycled through with no problems...then i put the test code for the uMP3 in and that is working as well.  The uMP3 came with a default Baud of 9600.  I think im ready.  i manual toggled all the outputs and everything is working....

JonnyMac

Good; not let's build the program up in discrete stages; it's complicated and, like Rome, won't be built in a day.
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

August 01, 2010, 01:20:11 PM #11 Last Edit: August 01, 2010, 01:22:54 PM by Ryanm0085
Sounds good...let me know if u need any other information...  the layout i gave u at the top of this forum is still the same.  i haven't had to make any changes yet and hopefull i won't have too.  i attached a pic of the main controller board not completed yet.  i have a few pis of it completed but haven't had a chance to upload them yet.


JonnyMac

You should -- and must -- assume that I'm a moron and can't remember what you told me a minute ago, much less a week ago (or longer) ago.  Between product development and other customers my memory of any specific project is exactly nil.

So... now that you have your hardware working, give me the details for the FIRST PART of the program that we can put in.  Once that's working, we'll move on to the next section.  I fear that if we try to do it all at once that someone will get lost in the minutiae. 

As I stated once before, elevator simulations are really tough, and I can say that with some authority having programmed one last year.  With that one, though, I had the hardware in front of me -- I don't with you.
Jon McPhalen
EFX-TEK Hollywood Office

Ryanm0085

Okay no problem...im not really looking for the "exact program" meaning i just need a program that will make everything work...then i can go through and fine tune and add things where they need to be.  Right now i have a Prop-2 connected to a DC-16 on P15.  P14 will be the TX pin and P13 the RX pin for the uMP3 player.  The uMP3 is set at a baud rate of 9600.  The mp3 will be simply names one.mp3 and two.mp3.  For safety reasons, some of my circuits use NC relays so when i cut 12v power, they will turn 110v lights on.  I will note which ones are NC.

PROP-2
P0 - Input 1 (Elevator Call Button)
P1 - Input 2 (Floor Select Button)
P2 - Input 3 (Reset Button)
P3 - Elevator Lights (NC Contacts. Lights are on when no signal sent)
P4 - Elevator Light Toggle (Toggles between flourescent lights and black lights)
P5 - Outside Light Toggle (Toggles between high hats and strobe lights)
P6 - Air Bags Up
P7 - Air Bags Down (NC Contact.  Valve is always open with no signal sent)
P8 - Relief Valve
P9 - Up Arrow
P10 - Door Toggle (On a circuit so when no signal, the door is open.  When a signal is sent, the door will close)
P13 - uMP3 RX
P14 - uMP3 TX
P15 - Sio

DC-16
P0 - 10 are connected to a led segment.  This is not critical.  If you can show me how to get a signal to it, i can handle the rest.


On initialization, i would like everything to toggle on and off for a second to insure everything is working before the main program.

On Initialization:
Set P3 and P7 HIGH (This will shut off the lights and close the down solenoid)
The DC-16 should "Zip" through all outputs for one second each
Set P3 LOW (Should turn on the light relay because it is on NC Circuit)
Set P4 HIGH for one second, then LOW (Toggles between Flourescent and Black Lights)
Set P5 HIGH for one second, then LOW (Toggles between High Hats and strobes)
Set P10 HIGH (Closes the Door)
Set P3 HIGH  (Turns off the Elevator Lights)
Set P9 High for one second, then LOW (Test Up Arrow)
Set P6 HIGH for one second, then LOW (Opens up solenoid then closes)
Set P7 LOW for one second, then HIGH (Opens Down solenoid then closes. On NC contacts)
Then start one.mp3

Trigger 1 when pushed:
Wait 2 seconds
P9 HIGH (Up arrow on)
P3 LOW (Turns Lights on)
wait 2 seconds
P10 LOW (Opens door)
P9, P3, & P2 on the DC16 HIGH
wait for Trigger 2

Trigger 2 when pushed:
Instantly Start two.mp3
P9 LOW (turns off Up arrow)
wait 2 seconds
P10 HIGH (closes door)
wait 2 seconds
P6 HIGH for 2 seconds then LOW(Lifts Elevator Up)
P7 LOW for 2 seconds then HIGH (Drops elevator down)
P4 & P5 HIGH (toggles black lights and stroble lights on)
wait 4 seconds
P10 LOW
wait for Trigger 3

Trigger 3 (Reset) when pushed:
Clear DC-16
LOW P3, P4 & P5 (Turns elevator lights off and toggles highhats on)
HIGH P10 (Closes the door)
Start one.mp3
wait for trigger 1

The is just a quick routine.  Once i get the basics i will modify it and time it exactly to what i need.  I tried to be as specific as possible.  To explain the use of NC contacts on P3, P7, and P10, i have an E-stop hooked up so when pushed, it will drop the 12v Power to the PROP-2, stopping the sequence.  This will allow the Lights(P3) to come back on, the door(P10) to open and the elevator to drop back down(P7).  Just a safety feature.  I hooked relays up to those PINS.  Any more questions please ask.  For the DC-16, I am just looking for an example really in the code.  Then i can get it to run the numbers how i need it, but mainly just to see how to get the signal out to it. 









bsnut

I would like to help you and Jon would like too. As former  full-time amusement park maintenance electrician, we did this type thing all the time writing programs and wiring haunts for Halloween.

I can write this program in few hours over this weekend when I will have some spare time. The details that I need as a programmer are missing. Let's start with the questions.

1. Are the relays connected to the OUT's TB on the prop2?
2. When you say HIGH for one of your relays, are you turning on the relay?
William Stefan
The Basic Stamp Nut