November 22, 2024, 07:34:07 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Troubleshooting Syntax

Started by HalloweenNorth, October 18, 2009, 01:09:58 PM

Previous topic - Next topic

HalloweenNorth

I am having troubles with my Prop-1 and am hoping someone can help...

Here is the run-down on the prop...
I trip the prop with a remote control (so I don't scare the toddlers and ruin halloween for them), Prop-1 takes over and starts a crank on the side of the box simultaneous with music that dies just before the "pop-goes-the-weasel" - kids are confused and think things are dead when an air cannon goes off behind them - they turn, 2 seconds later I use my 28" cylinder to launch jack to about 4', two seconds and then the second 28" cylinder goes bringing jack to full 8' height with arms outstretched.  To prevent crashing about on closing the prop back up, each solenoid will be deactivated with 1 second delays.

I have three solenoids (24vdc), two for lifting the prop and one for the box top.
I have two sound tracks, one pop goes the weasel and a second with scary goblin noises to be used at the time of the second extension of jack (triggered via realy from prop 1)
I have an air cannon (24vdc)
I have only one input - normally open from remote via relay

I have written what I thought would be a simple program, however, when loaded into Prop-1, it seems to just cycle through the first set of instructions, tripping out0 and turning on and off the first relay after an eight second delay...

Here is the syntax:

' {$STAMP BS1}
' {$PBASIC 1.0}
' {$PORT COM1}



          SYMBOL Trigger = PIN7
          SYMBOL Music = PIN0
          SYMBOL Crank = PIN1
          SYMBOL Cannon = PIN2
          SYMBOL BoxOpen = PIN3
          SYMBOL Solenoid1 = PIN4
          SYMBOL Goblinsound = PIN5
          SYMBOL Solenoid2 = PIN6
          DIRS = %01111111        ' make P7 inputs, P6-P0 outputs
          PINS = %00000000        ' all outputs off

          Main:

          IF Trigger = 0 THEN Main

          Music = 1
          Crank = 1
          PAUSE 8000
          Music = 0
          Crank = 0
          Cannon = 1
          PAUSE 1000
          Cannon = 0
          PAUSE 1000
          BoxOpen = 1
          PAUSE 500
          Solenoid1 = 1
          Goblinsound = 1
          PAUSE 3000
          Goblinsound = 0
          Solenoid2 = 1
          PAUSE 8000
          Solenoid2 = 0
          PAUSE 1000
          Solenoid1 = 0
          PAUSE 1000
          BoxOpen = 0
          GOTO Main

Any help would be greatly, greatly appreciated,
Thx

PS, I have tried loading this into two Prop-1s to the same effect...



HalloweenNorth

Should have noted its a jack-in-the-box...

JonnyMac

Nothing sticks out, but the way you've compressed all the code together maybe you're missing something.  My programs always seem to work because I spend a little extra time up front formatting them neatly.  Here's your program reformatted in my style (see "The Elements of PBASIC Style") in the help file for specifics.

Do you have a 24v power supply connected to the Prop-1?  Are the valves and relays you're using safe with the ULN (3 watts or less)?  My version of the program works as intended -- and was tested on LEDs so I know there's no electrical issues with the controller.

Note, too, that we don't recommend using a direct trigger input without debouncing -- I have that built right into my template so it's included in this program.

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


' -----[ Program Description ]---------------------------------------------
'
' Trigger :: Parallax-compatible PIR or N.O. button (mat switch, etc.)
'            -- connect N.O. button between P7.W and P7.R


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


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

SYMBOL  Trigger         = PIN7                  ' SETUP = DN

SYMBOL  Solenoid2       = PIN6                  ' SETUP = DN or out
SYMBOL  GoblinSound     = PIN5
SYMBOL  Solenoid1       = PIN4
SYMBOL  BoxOpen         = PIN3
SYMBOL  Cannon          = PIN2
SYMBOL  Crank           = PIN1
SYMBOL  Music           = PIN0


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

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  timer           = B2


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

Reset:
 PINS = %00000000                              ' clear all
 DIRS = %01111111                              ' P7 input, others outs


' -----[ 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

 Music = IsOn
 Crank = IsOn
 PAUSE 8000

 Music = IsOff
 Crank = IsOff
 Cannon = IsOn
 PAUSE 1000

 Cannon = IsOff
 PAUSE 1000

 BoxOpen = Yes
 PAUSE 500

 Solenoid1 = IsOn
 GoblinSound = IsOn
 PAUSE 3000

 GoblinSound = IsOff
 Solenoid2 = IsOn
 PAUSE 8000

 Solenoid2 = IsOff
 PAUSE 1000

 Solenoid1 = IsOff
 PAUSE 1000

 BoxOpen = No
 GOTO Reset


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


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


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


Jon McPhalen
EFX-TEK Hollywood Office

HalloweenNorth

Thanks Jon, I appreciate you taking the time on this.

I have loaded your code and I get the same effect, out1 and out2 go on immediately (no trigger) and cycle 8 seconds on and off..

Must be the relays, I picked these up off ebay and am running them off of the Prop-1 wall wort,

At least I know it is not the code now and I can start playing with the other parts - thanks

here is the data on the relays:
Manufacturer: UN-Known
Part Number: 611D012
Type: TV-5 / HX-5 power relay
Date Code:
Coil:  12 vdc (270 Ohms)
Configuration: SPDT /  1FormC
Contacts: 16 Amps at 30vdc. or 125vac
Dielectric Strength:
Overall Size: Shown Below
Rated: UL E43149 / CSA LR26550
NTE Replacement: R22-5D16-12 @ $4.69 each

JonnyMac

Do you have the P7 SETUP jumper in the UP position? -- this would cause a false trigger.   The relay specs seem fine.
Jon McPhalen
EFX-TEK Hollywood Office

HalloweenNorth


JonnyMac

Well, I'm lost -- I ran that code on my Prop-1 with LEDs connected to the outputs and it behaves just as the code is written.

You have the relays connected between V+ and the OUTx terminals, right?  Maybe the specs are bogus; running 12v through a 270-ohm coil suggests about 45mA which is well under what the ULN can handle.
Jon McPhalen
EFX-TEK Hollywood Office

HalloweenNorth

Yup, running between V+ and out terminals - and have tried it on a second Prop-1 to the same effect so I doubt its a Prop-1 hardware problem... I will try later this week when I am back home to test the relays and pick up some LEDs to test it,

Will let u know if I figure it out...

HalloweenNorth

It must have been the relays.  I just hooked up my third, and last Prop-1 so as i could start fresh with your syntax, I ran it, tripped the start, worked perfectly...once, then there was a small puff of smoke from the controller and I turned it off - I noticed that the chip was very hot to the touch...Looks like this prop is going to have to wait until next year as i am fresh out of controllers and even if the boss would approve another Halloween purchase, I doubt it would be here in time to set up, sigh...

Anyway, thanks for your help in this,
Kerry

JonnyMac

That is not good -- we design our products not to have problems.

Can you please take a picture (make it big and clear) of your setup with the relays connected as caused the problem; I really want to see what's going on here.
Jon McPhalen
EFX-TEK Hollywood Office

HalloweenNorth

Here it is - and not to worry, I am sure I have crossed wires (literally of figuratively),
K

JonnyMac

Is there a short somewhere?  Do you have a meter that you can check that with?  I looked up the specs on your relays and they are far below what the ULN2803 on the Prop-1 can handle; I'm beginning to suspect that you have relay with a shorted coil.  You should disconnect all the relay wires and measure the resistance between the common (what you connected to V+) and the individual coil control leads -- the should each read about 270 ohms.  If you get one that is dramatically lower than this it could be the culprit.
Jon McPhalen
EFX-TEK Hollywood Office

HalloweenNorth

All reading about 295...

It is possible given the proximity between the relays that, depsite being soldered on, the positive of one contact touched the contact for the negative beside it and shorted...not likely, but possible...


HalloweenNorth

After Halloween I can retry with isolated relays...

JonnyMac

Quote from: HalloweenNorth on October 23, 2009, 04:25:46 PM
All reading about 295...

It is possible given the proximity between the relays that, depsite being soldered on, the positive of one contact touched the contact for the negative beside it and shorted...not likely, but possible...


A direct short on the 12v output side would explain what you're seeing. 
Jon McPhalen
EFX-TEK Hollywood Office