November 21, 2024, 03:45:03 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.


Flame Cannon with safety

Started by fearfair, October 18, 2016, 03:10:34 PM

Previous topic - Next topic

fearfair

I need help with the following program.

Input0:    Arming toggle switch
Input1:    Fire Button

Output0:  Ignitor
Output1:  solenoid

These are flame cannons that we use outdoors, obviously.  They use an oil furnace igniter to create a spark and then a solenoid valve to turn the propane on and off.  The functionality should be that the arming switch has to be on to operate; then when the fire button is depressed the ignitor is turned on and remains on, then the solenoid is turned on, then the igniter turns off and the solenoid stays on until the fire button is released. I can't do this with any sort of boobox, etc. because they all have fixed show times and in this case the solenoid should turn off as soon as the button is released.

Thank you so much for the help with the air quality monitor program. 

JackMan

Need a bit more info. How long do you need the ignitor on before the solenoid is energized? How long does the ignitor stay on after the solenoid is energized?

fearfair

Quote from: JackMan on October 18, 2016, 03:35:10 PM
Need a bit more info. How long do you need the ignitor on before the solenoid is energized? How long does the ignitor stay on after the solenoid is energized?

One second each.

JackMan

Also forgot to mention that I have no idea how your ignitor operates, I'm assuming you'll need a relay to energize it.

JonnyMac

October 18, 2016, 05:45:34 PM #4 Last Edit: October 18, 2016, 05:50:53 PM by JonnyMac
Safety is always a very big concern which forces me to add this warning before my idea about an implementation strategy.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Okay... I would strongly suggest you add a lamp that shows the device is armed. When the arming time passed, this lamp will come on. After the fire sequence, it will flash to remind you to kill the arming switch. Also note that if the arming switch is opened at any time in the process, the code does a suitable abort.

Here's my idea. I did run it on a Prop-1 with a v2 Trainer installed, with a toggle switch connected to P7 and a N.O. button to P6.

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

' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
' OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
' FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.

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


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


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

SYMBOL  ArmSw           = PIN7                  ' SETUP = DN
SYMBOL  FireBtn         = PIN6                  ' SETUP = DN

SYMBOL  ArmedLed        = PIN2                  ' P2 or V+/OUT2
SYMBOL  Valve           = PIN1                  ' use V+/OUT1
SYMBOL  Ignitor         = PIN0                  ' use V+/OUT0


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

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  IsOn            = 1                     ' active-high I/O
SYMBOL  IsOff           = 0


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

SYMBOL  timer           = W5


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

Reset:
  PINS = %00000000                              ' all off
  DIRS = %00000111                              ' P2..P0 are outputs

  timer = 0


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

Check_Armed:
  PAUSE 10
  timer = timer + 10 * ArmSw                    ' update arming timer
  IF timer < 1000 THEN Check_Armed              ' armed for 1s

  ArmedLed = IsOn                               ' alert user
  timer = 0

Check_Fire:
  PAUSE 10
  IF ArmSw = IsOff THEN Reset                   ' kill if disarmed
  timer = timer + 10 * FireBtn                  ' updat fire timer
  IF timer < 100 THEN Check_Fire

  Ignitor = IsOn
  PAUSE 100                                     ' give ignitor time to light
  Valve = IsOn
  PAUSE 100
  Ignitor = IsOff

Fire_On:
  PAUSE 25
  IF ArmSw = IsOff THEN Fire_Off                ' abort if Arm switch off
  IF FireBtn = IsOn THEN Fire_On                ' run will Fire button pressed

Fire_Off:                                       ' kill the flame
  Ignitor = IsOff
  Valve = IsOff
  timer = 0

Disarm:                                         ' disarm device
  ArmedLed = 1 - ArmedLed                       ' toggle Armed LED
  PAUSE 100
  timer = timer + 100
  IF ArmSw = IsOn THEN Fire_Off                 ' force arm switch to be off
  IF FireBtn = IsOn THEN Fire_Off               ' force fire button to be open
  IF timer < 1000 THEN Disarm

  GOTO Reset


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


' -------------------------------------------------------------------------


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

fearfair


Jeff Haas

Jon - What's this v2 Trainer?  Does it replace the pot with an additional external connector?

JonnyMac

It's the current Trainer; P6 and P7 are available, there is a button for P6 (as before), and a jumper to connect the POT to P7.
Jon McPhalen
EFX-TEK Hollywood Office