November 23, 2024, 10:24:55 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Strange behavior

Started by davisgraveyard, September 19, 2011, 11:01:36 AM

Previous topic - Next topic

davisgraveyard

I have a prop1 that I have been using for years for a series of  effects.  It triggers from an audio source on a video which then plays footsteps and then lights 12V UV LED's that light up footsteps and then finally rattles a gate.   The very last line of the code looks something like this

FOR i=1 TO 10
HIGH 0
PAUSE 100
LOW 0
PAUSE 100
NEXT

I am moving a 12VDC solenoid back and forth.

The wires on the solenoid are on V+ and OUT0.  Doesn't really matter which way the wires go but one way pushes the solenoid and the other pulls it.  I think in our case pushing works better. 

So I dusted off this effect and replaced the AP-8 and Amplifier in the box with a AP-16.  I modified the code to work with the AP-16 and tested it and it works fine.  But now for some reason the solenoid won't work.

Spent hours testing this to see what broke.  Here is the weird thing.  I put a meter to OUT0 and V+ and when the code executes I can see the 10 12V pulses.   I have put a LED light on the output and the light flashes.   But when I attached the solenoid nothing happens.

I automatically think well it has to be that the power supply for some reason isn't rated with enough amps even though it has worked in the past with no problem.   So I manually touch the wires to the V+ and GND and the solenoid works fine.

What is wrong???














JonnyMac

Trigger the AP-16+ manually and then touch the valve wires to V+ and GND -- the AP-16+ doesn't draw much current when idle, but that does go up when it's playing.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

What it sounds like to me it is power supply issue here. I would try powering the AP-16+ from different power supply and power the Prop-1 from another one. This should take care of your problem, which is not enough amps from the original power supply.

Jon is right. When the AP-16+ is idle it doesn't draw a lot of amps. But, when does its thing it draws a lot more amps causing your solenoid not to work.
William Stefan
The Basic Stamp Nut

davisgraveyard

I thought maybe you had something so I wired a separate power supply to the Prop1 which I think was a 500ma 12VDC.   I was able to touch the solenoid wires to the V+ and GND of the PROP1 and the solenoid moved.  But when the code executes nothing happens?

Just to be clear here is my setup

Prop1
DC-16
AP-16
Audio Relay Circuit

The Prop1 has the solenoid wired to V+ and OUT0.   There is a serial jumper on P7 that talks to both the DC-16 and AP-16.  The trigger is connected to P6 and to the Audio Relay Circuit. 

I am using a single 2A 12VDC power supply that I wired to barrel ends for all 4 cards.  The DC-16 has 7 12V UV LED lights attached to OUT0-7

Like I have said it all works fine except the solenoid just doesn't move.  But it used to before the AP-16 which doesn't play audio when the solenoid moves?

And here is the code...

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


'-----[ I/O Definitions ]-------------------------------------------------
SYMBOL Trigger          = PIN6              'Trigger pin
SYMBOL Sio              = 7                 'serial I/O

'-----[ Constants ]-------------------------------------------------------
SYMBOL IsOn             = 1
SYMBOL IsOff            = 0

'-----[ Variables ]-------------------------------------------------------
SYMBOL i                = B0

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

' reset the devices
SEROUT Sio, OT2400, ("!!!!!AP16",%11,"X","!DC16",%11,"X")

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

'Wait for a trigger
Main:
DIRS = %10111111

IF Trigger = IsOff THEN Main

Force_Release:
IF Trigger = IsOn THEN Force_Release

'make some step sounds first
FOR i = 1 TO 7
   SEROUT Sio, OT2400, ("!AP16",%11,"PS",0,1)
   PAUSE 1000
NEXT

'light up the last 7 steps
FOR i = 0 TO 6
   SEROUT Sio, OT2400, ("!AP16",%11,"PS",0,1)
   SEROUT Sio, OT2400, ("!DC16",%11,"P",i,1)
   PAUSE 1000
   SEROUT Sio, OT2400, ("!DC16",%11,"P",i,0)
NEXT

PAUSE 1000
'rattle the solenoid
FOR i=1 TO 10
  HIGH 0
  PAUSE 100
  LOW 0
  PAUSE 100
NEXT

GOTO main

END




JackMan

Not sure if this is the same timing for the solenoid that worked for you in the past but try a longer PAUSE, say 200ms and see if it makes a difference. Maybe the solenoid is a little stiff and needs a longer pulse to activate. If an LED works when the code executes and you have enough power, then the problem has to be with the solenoid or the pulse length.

bsnut

September 19, 2011, 08:10:18 PM #5 Last Edit: September 19, 2011, 08:15:41 PM by bsnut
Jack is right. You may want to make the Pause Command a little longer like I did below. The reason for this is to give solenoid a chance to operate. A short pause is fine for something like a LED. But, isn't fine solenoid or relays.


'rattle the solenoid
FOR i=1 TO 10
  HIGH 0
  PAUSE 1000
  LOW 0
  PAUSE 1000
NEXT
William Stefan
The Basic Stamp Nut

davisgraveyard

I set it to PAUSE 100 when I first created this effect 3-4 years ago.  The longer pause was too slow.

I'll try the longer pause just to see if I get a different result but I doubt it will help?   Don't think it is too stiff I put my finger on the solenoid and I don't feel anything like it isn't getting any power.

FYI if anyone is wondering.  I have tried swapping OUT0 with OUT1.  In fact the code normally worked on OUT1 and I moved it to OUT0 just to make sure something wasn't wrong with the output?

Like I said it doesn't make any sense.

Jeff


bsnut

If, it worked before then the your problem maybe the ULN output pin is bad itself. You could try replacing the ULN with another one.

William Stefan
The Basic Stamp Nut

livinlowe

Quote from: bsnut on September 20, 2011, 12:58:08 AM
If, it worked before then the your problem maybe the ULN output pin is bad itself. You could try replacing the ULN with another one.
Yep, I agree with bsnut. Replace that ULN and see if it changes your situation!
Shawn
Scaring someone with a prop you built -- priceless!

davisgraveyard

I give the ULN replacement a try.  I think the one on the Prop1 is the smaller ULN that leaves pin 7 8 open.  I also have the full ULN that fits the entire socket too.

I can't remember what the reason is for the smaller one?  In fact what is the purpose of the ULN?

Can the failure of the ULN cause the problems I am seeing.  Where you get voltage out of the OUT0  but not enough current to power a Solenoid?

livinlowe

Quote from: davisgraveyard on September 20, 2011, 10:50:01 AM
I give the ULN replacement a try.  I think the one on the Prop1 is the smaller ULN that leaves pin 7 8 open.  I also have the full ULN that fits the entire socket too.

I can't remember what the reason is for the smaller one?  In fact what is the purpose of the ULN?

Can the failure of the ULN cause the problems I am seeing.  Where you get voltage out of the OUT0  but not enough current to power a Solenoid?
The reason for the smaller ULN is to leave pin 7 open for serial comms with other boards. The purpose of the ULN is to allow you to drive higher current out of your microprocessor pins. A typical pin will drive about 25mA. The ULN will allow you to drive 500mA on one channel! The reason Jon and John put the ULN in the socket they did is for ease of replacement since most of us are having fun, not calculating current loads.
The failure on the ULN can DEFINATELY cause the problems your seeing. And, its an easy test. I'm pretty sure if you blew the ULN you could see voltage, but supply no current. Most probably your solenoid pulls a little over 500 mA when you first activate it (pull in current) and probably just weakend the ULN every time you pulsed it until, poof, it blows.
Anyways, I hope it is the ULN, because its a cheap and easy fix. If it blows on halloween night, just switch your wires to another output (if you can) and change the output in your program. Fixed! Or you could power your solenoid off a seperate power supply.
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

September 20, 2011, 02:10:49 PM #11 Last Edit: September 20, 2011, 02:14:27 PM by JonnyMac
QuoteIn fact what is the purpose of the ULN?

The ULN converts the low voltage, low current output from the Prop-1's processor to a high-current (up to 500mA) output.  You cannot drive a 12V, 0.25A relay from a 5V, 25mA signal; the ULN acts like a buffer between the devices.

If you're using P7 for serial comms then you need to:
-- move the P7 SETUP jumper to UP
-- clip the ULN2803.1 pin, or use a ULN2003 that opens the P7 connection

The reason is that there is a pull-down resistor inside the ULN that fouls the signal level for serial comms.  This also interferes with the POT command, hence it's also removed for that (along with the SETUP jumper).

QuoteWhere you get voltage out of the OUT0  but not enough current to power a Solenoid?

This is one of those Ohm's Law things; the meter presents a very high impedance to the circuit so a low current can produce what looks like a good voltage.  When you apply the solenoid, though, it has a serious load that could be adversely affecting the output circuit of a wonky ULN.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Just curious, what's the mA draw of your solenoid? If this is a plunge type solenoid that rattles your gate, chances are it's drawing too much current for the ULN to handle. Try using a relay (wired to OUT0) to energize the solenoid.

bsnut

One way that you can find out what your solenoid draws is to hook it up to your power supply and use your multimeter (set to amps) to see what the amp draw is. The way you do this with your multimeter, is hook the meter in series with the positive of the solenoid (black meter lead on the coil and the red lead on the positive side of your power supply.)

If, the your solenoid draws above the ULN current rating for a single pin then you should use a relay like Jack is suggesting.
William Stefan
The Basic Stamp Nut

JonnyMac

Keep in mind, too, that there's a slight voltage drop through the ULN (about 1.3v) and if your device is sensitive to voltage this could also be an issue.  This usually doesn't come up as most power supplies put out a bit more that 12, and most devices are happy operating so long as the correct wattage is available.
Jon McPhalen
EFX-TEK Hollywood Office