November 21, 2024, 05:49:05 PM

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.


Prop2 and soleniod

Started by time2dive, March 26, 2009, 04:45:36 AM

Previous topic - Next topic

time2dive

I am trying to have a Prop2 run multiple items....
I am using a Prop2 Trainer to monitor the outputs at this time.
The first thing that it does is start the VM2 (that is working)

The next thing that it supposed to do is open and close some doors via a solenoid.  I have ground from the 24vdc power supply going to ground on the Prop2 and OUT5 going to the minus lead of the solenoid, the +24vdc goes to the hot side of the solenoid.
When the output of OUT5 goes low the solenoid activates,when it goes high it does not deactivate.  (which is the current problem)
The LED on P5 of the trainer does activate and deactivate with the program

This also will flash some LEDs on OUT4.  This is run from a 12vdc supply.  Ground of the 12vdc power supply going to ground of the Prop2, OUT 4 going to the ground of the LEDs and +12vdc going to the hot side of the LEDs.  The LEDs do flash when they are supposed to flash.
OUT1 will eventually control a fog machine via a relay board.

Here are my questions and problems
1. Is there a problem running two different DC power supplies and a Prop2
2. Why won't the solenoid deactivate? do I need a diode in the OUT5 lead?
3. DO I have the switch in 1 or 2?  It does not appear to make a difference.

Here is the program that I am using.

' =========================================================================
'
'  ' =========================================================================
'
'   File...... Tim01--Doors From Hell.BS2
'   Purpose...
'   Author.... Timothy Ewing
'   E-mail.... time2dive@hawaii.rr.com
'   Started... 15 Feb 09
'   Updated...
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Doors from Hell controller
' output pneumatic solenoid
' output vMusic
' output light
' output fog machine


' -----[ I/O Definitions ]-------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------

Sio               PIN     15                      ' no ULN / SETUP = UP
Trigger         PIN     14                      ' no ULN / SETUP = DN
TX                PIN     13                      ' no ULN / SETUP = UP
RX                PIN     12                      ' no ULN / SETUP = UP

'
'
'
' Note: The P1T button is used to simulate the PIR sensor in this demo.




Pir                PIN     6                    ' PIR sensor
doors           PIN     5                    ' doors is connected to P5 to simulate pneumatic solenoid
lights            PIN     4                    ' lights are connected to P4
fog               PIN     1                    ' output to a relay to control a fog machine
' -----[ Constants ]-------------------------------------------------------

IsOn            CON     1
IsOff           CON     0
t9600         CON  84
open        CON  $8000
baud        CON  open + t9600


' -----[ Program Code ]----------------------------------------------------

PAUSE 4000                                      'allow VMusic2 to initialize

Main:
  IF (Pir = IsOff) THEN Main                                    ' wait for PIR activity
  SEROUT 13, baud, ["VSV $00", 13]                      'set volume full (in hex), ' insert carriage return
  SEROUT 13, baud, ["VPF letmeout.mp3", 13]      'play x.mp3, insert carriage return
  PAUSE 3000                                                         ' hold for 3 seconds          3 seconds
  HIGH doors                                    ' doors open
  PAUSE 500                                     ' hold for 1/2 second
  LOW doors                                     ' doors closed
  PAUSE 500                                     ' hold for 1/2 second
  HIGH doors                                    ' doors open
  PAUSE 500                                     ' hold for 1/2 second
  LOW doors                                     ' doors closed
  PAUSE 500                                     ' hold for 1/2 second
  HIGH doors                                    ' doors open
  PAUSE 500                                     ' hold for 1/2 second
  LOW doors                                     ' doors closed                5.5 seconds
  PAUSE 5000                                    ' hold for 5 seconds          10.5 seconds
  HIGH doors                                    ' doors open
  PAUSE 300                                     ' hold for .3 second
  LOW doors                                     ' doors closed
  PAUSE 300                                     ' hold for .3 second
  HIGH doors                                    ' doors open
  PAUSE 300                                     ' hold for .3 second
  LOW doors                                     ' doors closed
  PAUSE 300                                     ' hold for .3 second
  HIGH doors                                    ' doors open
  PAUSE 300                                     ' hold for .3 second
  LOW doors                                     ' doors closed
  PAUSE 300                                     ' hold for .3 second
  HIGH doors                                    ' doors open
  PAUSE 300                                     ' hold for .3 second         12.6 seconds
  LOW doors                                     ' doors closed
  PAUSE 3000                                    ' hold for 3 seconds         15.6 seconds
  HIGH doors                                    ' doors open
  PAUSE 700                                     ' hold for .7 second
  LOW doors                                     ' doors closed
  PAUSE 700                                     ' hold for .7 second
  HIGH doors                                    ' doors open
  PAUSE 700                                     ' hold for .7 second
  LOW doors                                     ' doors closed
  PAUSE 700                                     ' hold for .7 second
  HIGH doors                                    ' doors open
  PAUSE 700                                     ' hold for .7 second         19.1 seconds
  LOW doors                                     ' doors closed
  PAUSE 4400                                    ' hold for 4.4 seconds       23.5 seconds
  HIGH doors                                    ' doors open
  PAUSE 500                                     ' hold for 1/2 second
  LOW doors                                     ' doors closed
  PAUSE 500                                     ' hold for 1/2 second
  HIGH doors                                    ' doors open
  HIGH lights                                   ' lights on
  PAUSE 500                                     ' hold for 1/2 second
  LOW doors                                     ' doors closed
  PAUSE 500                                     ' hold for 1/2 second
  HIGH doors                                    ' doors open
  PAUSE 500                                     ' hold for 1/2 second
  LOW doors                                     ' doors closed               26 seconds
  LOW lights                                    ' Lights off
  PAUSE 2000                                    ' hold FOr 2 seconds         28 seconds
  HIGH lights                                   ' Lights on
  HIGH doors                                    ' doors open
  PAUSE 700                                     ' hold for .7 seconds
  LOW doors                                     ' doors closed
  PAUSE 500                                     ' hold for .5 seconds
  HIGH doors                                    ' doors open
  PAUSE 700                                     ' hold for .7 seconds
  LOW doors                                     ' doors closed
  PAUSE 500                                     ' hold for .5 seconds
  HIGH doors                                    ' doors open
  PAUSE 700                                     ' hold for .7 seconds        30.9 seconds
  LOW doors                                     ' doors closed
  LOW lights                                    ' Lights off
  PAUSE 1000
  HIGH lights                                   ' Lights on for 1.5 seconds
  PAUSE 1500
  LOW lights                                    ' Lights off for 1 second
  PAUSE 1000
  HIGH lights                                   ' Lights on for 1.5 seconds
  PAUSE 1500
  LOW lights                                    ' Lights off for 1 second
  PAUSE 1000
  HIGH lights                                   ' Lights on for 1.5 seconds
  PAUSE 1500
  LOW lights                                    ' Lights off for 1 second
  HIGH fog                                      ' Fog machine on for 2.5 seconds
  PAUSE 1000
  HIGH lights                                   ' Lights on for 1.5 seconds
  PAUSE 1500
  LOW lights
  LOW fog                                       ' Fog machine off
  PAUSE 20000                                   ' hold for 20 seconds
  GOTO Main                                     ' back TO main



Tim

JonnyMac

If the LEDs are working correctly then it's not a programming thing, it's an electrical thing.  You need to make darned sure that you DON'T connect the positive side of the 24v supply to the Prop-2; the only thing it should connect to is the "hot" side of the solenoids.  The ULN can switch ground for you if you have a reference (you do by connecting to the GND terminal).

Do you have some sort of latching solenoid?
Jon McPhalen
EFX-TEK Hollywood Office

time2dive

The  solenoid came out of last years working prop,  I am upgrading that prop with a Prop2, so it is a standard solenoid.
Am I correct in assuming that there should not be a problem with using two different voltage power supplies 0ne 12vdc and one 24vdc with the prop 2.  I am tying the grounds together at the ground terminal and using the Prop2 to supply switched grounds to the LEDs and the solenoid.

I noticed that the LEDs  lights turn on when I turn on the Prop2.  They work properly when I run the program.  The LEDS lights  also will turn on and remain for a while even with all power off and removed.....I am assuming that those big filter capacitors are supplying power to the LEDs lights until they discharge.

Tim

time2dive

I still do not know why the solenoid hangs up with the external power supply.  I found out that the solenoid will run off of 12vdc just fine and decided to run it through the Prop2 V+ and switched ground of the OUT terminal.  LED lights and solenoid both work fine using the Prop2 V+ and the switched grounds of the OUT terminals.

Am I correct in assuming that to control a fog machine I will need an RC-4 and relays.   I should use the normally open contacts of the RC-4 across a fog machine  remote switch?