November 25, 2024, 01:14:30 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.


Valves

Started by garner0070, September 22, 2014, 11:10:48 AM

Previous topic - Next topic

garner0070

I am looking to possible buy the Prop 1 controller to control a few 24vdc solenoids. Do I need a 24vdc power supply for the Prop 1 controller to operate these coils? I had the ez3 micro kit and I think I had an issue before using the 12vdc power supply that came with the kit to power the valves thru this unit? Any help?
Also if I do use this Prop 1 is the a "standard program" to use to use a PIR sensor input to triger the valve, keep it on for (15-20 seconds) and then turn "off the valve?
I have never used programming like this before so it would be new for me but hopefully would be pretty simple?
Thank you

JackMan

If your solenoids are 24VDC, yes, you would need a 24VDC power supply for the Prop-1. There is no "standard" program for the Prop-1, you would program it to fit your application, that's the beauty of having a true programmable controller. There's always someone here to help with the programming if you need it.

garner0070

Could someone help me with a basic program jsut to see how it would be configured?

Kind of like a monster in a box.
I want to have PIR sensor at P0. Once a victim triggers the sensor I want a valve from OUT 0 to be triggered and run(solenoid energized) for 15 seconds or so. then turn off Solenoid and not be able to trigger the PIR again for 1-2 minutes.
I assume this would be easy but the programming is greek to me.

JonnyMac

I've whipped up a program for you.

A note of clarification: The Prop-1 has eight IO pins; an IO pin can be either an input (e.g., PIR) or an output (Valve), but not both. In our "standard" configuration we use PIN6 as the trigger input, OUT5..OUT0 for outputs, and when needed, P7 for special devices like audio players and IO expanders.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


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

SYMBOL  Sio            = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger        = PIN6                  ' SETUP = DN

SYMBOL  Valve          = PIN0                  ' use V+/OUT0


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IS_ON          = 1                     ' for active-high in/out
SYMBOL  IS_OFF         = 0

SYMBOL  PIR_HOLDOFF    = 60                    ' wait 60s before retrigger
SYMBOL  VALVE_SECS     = 15


' -----[ Variables ]-------------------------------------------------------

SYMBOL  timer          = W5


' -----[ Initialization ]--------------------------------------------------

Reset:
  PINS = %00000000                             ' clear all outputs
  DIRS = %00111111                             ' make P0-P5 outputs

  timer = PIR_HOLDOFF
  GOSUB Wait_Seconds


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

Main:
  timer = 0                                    ' reset timer

Check_Trigger:
  PAUSE 5                                      ' loop pad
  timer = timer + 5 * Trigger                  ' update timer
  IF timer < 100 THEN Check_Trigger            ' wait for 0.1 sec input

  Valve = IS_ON                                ' valve on
  timer = VALVE_SECS                           ' set timer
  GOSUB Wait_Seconds                           ' let timer expire
  Valve = IS_OFF                               ' valve off

  GOTO Reset


' -----[ Subroutines ]-----------------------------------------------------

' Hold program # seconds in timer
' -- value in timer destroyed by routine

Wait_Seconds:
  IF timer = 0 THEN WS_Exit
    PAUSE 1000
    timer = timer - 1
    GOTO Wait_Seconds

WS_Exit:
  RETURN


' -----[ User Data ]-------------------------------------------------------
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

garner0070,
   I forgot to mention also that you need to make sure your solenoids don't draw more current than the ULN outputs of the Prop-1 can handle.

garner0070

thank you for your help. I hope to get the prop 1 in this week and play with it this weekend.
If I wanted to do a seperate prop with another sensor input like P5 and then more valve outputs would it just be a seperate program? I guess the controller can run multiple programs at one time?
My valves are small 4-way valves only 0.4 watt 24vdc coils so I think this unit will be able to handle them.
Thanks again for your help

JonnyMac

September 23, 2014, 03:32:05 PM #6 Last Edit: September 23, 2014, 03:34:42 PM by JonnyMac
QuoteI guess the controller can run multiple programs at one time?

No. One program. For $40, multi-processing is not an option.

We have a product called the HC-8+ that has eight processors which does in fact allow you to do multiple programs. There is a testing lab near me that uses the HC-8+ for life testing of products. With the HC-8+ they are able to run programs that include separate test routines (for each product), as well as an overall manager program that keeps track and reports test progress.

Now... I can write REALLY TRICKY code that can [sort-of] simulate two programs running at once, but it's difficult for others to follow and update.

QuoteMy valves are small 4-way valves only 0.4 watt 24vdc coils so I think this unit will be able to handle them.

The current draw for a 4W solenoid (@24vdc) is about 18mA -- no problem at all. We suggest keeping current draw under 125mA per output.
Jon McPhalen
EFX-TEK Hollywood Office

garner0070

Would someone be able to help modify this program for me? Here is what I want to do.
PIR sensor at P6.
Once a victim is detected.
1. Output 0 on and hold on for 8 seconds
2. Turn off output 0
3. delay for 5 seconds
3. Turn output 1 on and hold on for 8 seconds
4.  Turn output 1 off
5. delay for 5 seconds
6. Turn output 2 on for 8 seconds
7. turn off output 2
8. delay for 1 minute or so and reset for new victim.

Basically what this is going to do is control a coffin.
output 0 open the coffin lid
output 1 springs up the skeleton in the coffin.
output 2 closes the coffin lid.

Is it easier to modify this program or rewrite?

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


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

SYMBOL  Sio            = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger        = PIN6                  ' SETUP = DN

SYMBOL  Valve          = PIN0                  ' use V+/OUT0


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IS_ON          = 1                     ' for active-high in/out
SYMBOL  IS_OFF         = 0

SYMBOL  PIR_HOLDOFF    = 60                    ' wait 60s before retrigger
SYMBOL  VALVE_SECS     = 15


' -----[ Variables ]-------------------------------------------------------

SYMBOL  timer          = W5


' -----[ Initialization ]--------------------------------------------------

Reset:
  PINS = %00000000                             ' clear all outputs
  DIRS = %00111111                             ' make P0-P5 outputs

  timer = PIR_HOLDOFF
  GOSUB Wait_Seconds


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

Main:
  timer = 0                                    ' reset timer

Check_Trigger:
  PAUSE 5                                      ' loop pad
  timer = timer + 5 * Trigger                  ' update timer
  IF timer < 100 THEN Check_Trigger            ' wait for 0.1 sec input

  Valve = IS_ON                                ' valve on
  timer = VALVE_SECS                           ' set timer
  GOSUB Wait_Seconds                           ' let timer expire
  Valve = IS_OFF                               ' valve off

  GOTO Reset


' -----[ Subroutines ]-----------------------------------------------------

' Hold program # seconds in timer
' -- value in timer destroyed by routine

Wait_Seconds:
  IF timer = 0 THEN WS_Exit
    PAUSE 1000
    timer = timer - 1
    GOTO Wait_Seconds

WS_Exit:
  RETURN


' -----[ User Data ]-------------------------------------------------------

JonnyMac

Is this part of the same project? The requirements have changed, which suggests a different project, which means you've violated our forum guideline #2

Quote2. One topic per thread, please, and give your post an appropriate Subject line so that it can be searched.


I'm going to assume the first part was a test for the second. Please, don't make me put on my moderator hat -- I don't like doing it. Threads are for PROJECTS, not for people. For your next project, start a new thread.

Here's an update that does what you want. I don't understand how you have the pneumatics plumbed, so I just followed the steps verbatim.

' =========================================================================
'
'   File...... ez_coffin.bs1
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated... 06 OCT 2014
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


'  1. Output 0 on and hold on for 8 seconds
'  2. Turn off output 0
'  3. delay for 5 seconds
'  3. Turn output 1 on and hold on for 8 seconds
'  4.  Turn output 1 off
'  5. delay for 5 seconds
'  6. Turn output 2 on for 8 seconds
'  7. turn off output 2
'  8. delay for 1 minute or so and reset for new victim.


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


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

SYMBOL  Sio            = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger        = PIN6                  ' SETUP = DN

SYMBOL  Lid_Close      = PIN2                  ' use V+/OUT2
SYMBOL  Skeleton       = PIN1                  ' use V+/OUT1
SYMBOL  Lid_Open       = PIN0                  ' use V+/OUT0


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IS_ON          = 1                     ' for active-high in/out
SYMBOL  IS_OFF         = 0

SYMBOL  IS_UP          = 1
SYMBOL  IS_DOWN        = 0

SYMBOL  PIR_HOLDOFF    = 60                    ' wait 60s before retrigger


' -----[ Variables ]-------------------------------------------------------

SYMBOL  timer          = W5


' -----[ Initialization ]--------------------------------------------------

Reset:
  PINS = %00000000                             ' clear all outputs
  DIRS = %00111111                             ' make P0-P5 outputs

  timer = PIR_HOLDOFF
  GOSUB Wait_Seconds


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

Main:
  timer = 0                                    ' reset timer

Check_Trigger:
  PAUSE 5                                      ' loop pad
  timer = timer + 5 * Trigger                  ' update timer
  IF timer < 100 THEN Check_Trigger            ' wait for 0.1 sec input

  Lid_Open = IS_ON
  PAUSE 8000

  Lid_Open = IS_OFF
  PAUSE 5000

  Skeleton = IS_UP
  PAUSE 8000

  Skeleton = IS_DOWN
  PAUSE 5000

  Lid_Close = IS_ON
  PAUSE 8000

  GOTO Reset                                   ' everything off



' -----[ Subroutines ]-----------------------------------------------------

' Hold program # seconds in timer
' -- value in timer destroyed by routine

Wait_Seconds:
  IF timer = 0 THEN WS_Exit
    PAUSE 1000
    timer = timer - 1
    GOTO Wait_Seconds

WS_Exit:
  RETURN

Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Jon makes a good point about not knowing how your pneumatics are plumbed. If you are indeed using pneumatics, you're probably gonna need this program changed. For instance, if the valve for the lid turns off after 8 seconds, the lid will be closing as your skeleton tries to rise.

garner0070

Sorry I should have started a new thread. This is a "new" project. I thought I fried my EZ3 timer but I bought a new power supply and it still works. I am going to use the prop1 to control the coffin and skeleton. I have a double solenoid "pressure" center valve so one coil is going to open the lid (output 0) and then when nothing is energized (output 0 off) the pressure holds the lid open then I am going to use the other solenoid on that valve (output 2) to close the lid. Output 1 will be to spring up the skeleton using a different valve in between.
I work for a pneumatics company so that part is easier for me but the programming is like a foreign language.
I had it all hooked up with mechanical switches but that is no fun having to sit at the box and flip switches all night. I think this should work well.
Thank you for your help

JackMan

Typically you want to hold the solenoid open to keep the pressure constant. If you de-energize the solenoid when you still need the lid up, it may leak down before it's ready to be closed.