November 22, 2024, 09:56:35 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.


Problem?

Started by cooperfan, September 03, 2007, 09:05:04 PM

Previous topic - Next topic

cooperfan

     Hey Jon!   I'm having trouble getting this to work. You wrote a program (incuded below) for my prop 1 ,that when a trigger is pushed it starts three motors and turns on two lights and starts the sound on the AP-8 then after 15 seconds turns everything off. i have the three motors which run off a 4.5 v power supply each, hooked to the RC-4 card in spots 1,2,3 and two mini spot lights which runs off a 12v power supply into spot 4 on the RC-4. On the prop 1 the motors are hooked to pins 0,1,2 through the serial plugs, and the lights are hooked to pin3. when i push the trigger the motors come on the lights come on and the sound starts. After 15 seconds the first motor stops but the lights and other two motors continue to run. Even if you turn off the power to the prop 1. they only stop if i unplug them. then whe i plug them back up there stoped until i push the trigger again. The lights on the RC-4 go off after 15 seconds but the motors and lights still run? we tried switchig the cyrdom of the one that stops to one that dosen't but it didn't change.here is the program. it seems to work fine by the led lights. I also switched the ULN2803A with a ULN2003A as recomended.

Dean 


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


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


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


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

SYMBOL  Sio             = 7
SYMBOL  Trigger         = PIN6
SYMBOL  Unused5         = PIN5
SYMBOL  LedSpot2        = PIN4
SYMBOL  LedSpot1        = PIN3
SYMBOL  Motor3          = PIN2
SYMBOL  Motor2          = PIN1
SYMBOL  Motor1          = PIN0


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

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0


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


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

Reset:
  PINS = %00000000
  DIRS = %00011111

  SEROUT Sio, OT2400, ("!AP8", %00, "X")        ' clear AP-8


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

Main:
  IF Trigger = IsOff THEN Main

  SEROUT Sio, OT2400, ("!AP8", %00, "P", 0)     ' start AP-8
  PINS = %00011111                              ' everything on
  PAUSE 15000                                   ' hold 15 secs

  GOTO Reset                                    ' all off


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


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


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


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


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


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


' -----[ EEPROM Data ]-----------------------------------------------------



JonnyMac

The Crydom relays we sell are for AC and only work for AC -- if you run DC through them the will not shut down until power is removed, just as you have witnessed.  The reason this happens is because the output side of that relay is a triac and once on, it only goes off when power is gone; this happens 120 times per second with our 60 Hz AC signal from the power lines.

You need to get DC relays for the RC-4 if you want to run DC devices.  We don't carry them, but Mouser Electronics (www.mouser.com) does.  If you're more specific with what you're switching I'll point you to the right relay.  Be warned, though, Crydom DC relays are not cheap.

How much current do the motors and lamps use? -- you might be able to run them from the Prop-1 directly, albieit with an external source and some extra bits (I'll show you how to hook them up).  What we need to ensure is that neither the motors nor the mini spot lights draw more than 200 mA each.
Jon McPhalen
EFX-TEK Hollywood Office

cooperfan

 The mini spots use about 20 milliamps. the Motors aren't marked but they originally used three AA batteries. They are motors from misting fans that were attached to a spray bottle. i'm almost positive there not near 200 mA.

Dean

JonnyMac

Don't guess -- that will get you into trouble.  See if you can find a friend with a meter and measure them.  Remember when measure amps you have to put the meter into the circuit, not across them.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Okay, assuming that your outputs don't draw more than 200 mA each, you can wire up your circuit like this:



Note that I'm not showing and resistors in the LEDs on OUT3..OUT4 -- these are your LED spots that have them built in.  They'll run off the 12v supply that runs the Prop-1.

On OUT0..OUT2 you can connect the motor to an external 6v battery as shown (the ULN drops a little over the volt, so the actual voltage to the motors will be pretty close to 4.5).  You'll need to put a 1N4001 diode (available at RadioShack) across each motor; make sure you connect the cathode (banded) side of the diode to the positive side of the supply.  DO NOT -- under any circumstances -- connect any of the external power supply connections to V+ -- unless you want to let out the blue smoke and order new parts from us....  ;D

Since motors have a bit of inrush I suggest that you sequence them on and off as shown below; the timing is slow enough to let each motor settle and fast enough that you won't sense it happening.

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


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  Trigger         = PIN6
SYMBOL  Unused5         = PIN5
SYMBOL  LedSpot2        = PIN4
SYMBOL  LedSpot1        = PIN3
SYMBOL  Motor3          = PIN2
SYMBOL  Motor2          = PIN1
SYMBOL  Motor1          = PIN0


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

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0


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

SYMBOL  motor           = B2


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

Reset:
  PINS = %00000000
  DIRS = %00011111

  SEROUT Sio, OT2400, ("!!!!!!!AP8", %00, "X")  ' clear AP-8


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

Main:
  IF Trigger = IsOff THEN Main                  ' wait for trigger

  SEROUT Sio, OT2400, ("!AP8", %00, "P", 0)     ' start AP-8

Motors_On:
  FOR motor = 0 TO 2                            ' sequence motors on
    HIGH motor
    PAUSE 10
  NEXT

  PINS = %00011111                              ' everything on
  PAUSE 15000                                   ' hold 15 seconds
  PINS = %00000111                              ' LEDs off

Motors_Off:
  FOR motor = 0 TO 2                            ' sequence motors off
    LOW motor
    PAUSE 10
  NEXT

  GOTO Reset


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


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