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


Using the park feature on a motor with a prop-1

Started by wdgoof, April 09, 2015, 09:48:43 AM

Previous topic - Next topic

JonnyMac

Jack makes a very good point: If you're reversing direction then you cannot use that park circuit with the Prop-1 as I suggested. Sorry that I may have looked past that.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

April 12, 2015, 06:00:02 PM #16 Last Edit: April 13, 2015, 02:52:09 AM by bsnut
Quote from: JonnyMac on April 11, 2015, 08:06:42 PM
Jack makes a very good point: If you're reversing direction then you cannot use that park circuit with the Prop-1 as I suggested. Sorry that I may have looked past that.
What I suggest is use a relay rated at he same voltage as the motor and have its contacts wired to the I/O header. Since the pins on the I/O header on the Prop-1 is rated at 5 volts not 12 volts. This coil should be wired so that the park switch controls this relay via the RC-2.
Quote from: JackMan on April 11, 2015, 07:34:03 PM
The more I look at this, I really don't want to post any code for it. I don't have one of these motors and I'm uncertain as to how it needs to be wired. I don't think it's as easy as detecting "GND" on the yellow "park" wire. I would think this could be positive or negative voltage depending on the motor direction. More info from FP is needed.
I changed your code but, it's up to you to test this code to see if it works. It's based on using the N.O. contacts on the park relay.

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

' -----[ Program Description ]---------------------------------------------
' Automates column - Skull lights always on.
' Show = Turn inside light on, open the door, puase, close the door, turn inside lights off

' -----[ Revision History ]------------------------------------------------
' Added control for skull lights on outside of column
' adjusted door timing for slower moter speed.

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


'------------------New Stuff here --------------------
SYMBOL diffuse_sensor = PIN6   ' SETUP = jumper off

SYMBOL sensor          = B0
SYMBOL debounce        = B1
'-------------------------------------------------------


SYMBOL park_rly = PIN4 ' contacts from the Park Switch Relay.
SYMBOL Lightsout = PIN3
SYMBOL LightsIn = PIN2
SYMBOL DoorClose = PIN1 ' to RC-2
SYMBOL DoorOpen = PIN0 ' to RC-2

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

SYMBOL Yes = 1
SYMBOL No = 0

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

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

'SYMBOL timer = B2 ' for debounce loop

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

Power_Up:
' put code here that only happens at power-up/hard reset

Reset:
PINS = %00000000 ' all off
DIRS = %00111111 ' P5..P0 are outputs
LightsOut = IsOn
PAUSE 30000 ' PIR warm-up/re-trigger delay

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

Main:

'Very simple code FOR diffuise sensors
IF diffuse_sensor = not_active THEN Main     'the diffuse sensors are active LOW
IF park_rly = IsOff THEN Run_Show

'More Advanced Debounce code for diffuse sensors
'DEBUG "sensor is ", #diffuse_sensor,"--",#sensor," debounce = ",#debounce, CR
'sensor = %00000001 &/ diffuse_sensor  'invert the pir_sensors output
'debounce = debounce + 1 * sensor  ' advance/clear timer
'IF debounce < 100 THEN Main



Run_Show:
LightsIn = IsOn

DoorOpen = IsOn
PAUSE 1500 ' wait 1.5s

DoorOpen = IsOff
PAUSE 30000 ' wait 30s

DoorClose = IsOn
'PAUSE 1500 ' wait 1.8s

Wait_for_Lid_Close:
IF park_rly = IsOn THEN Wait_for_Lid_Close
DoorClose = IsOff

LightsOut = IsOff

GOTO Reset
William Stefan
The Basic Stamp Nut

bsnut

I just noticed when I was looking at the drawing of the motor that this is easier then I tough. I also was thinking that you don't need to use any other code. This means that you can use the code that you first posted. Just wire the "Park Switch" across the two RC-2's.

The way this will work is, when any of the two RC-2's contacts are closed for a short period of time (1500 ms) the "Park Switch" will close its contacts and the motor will run untill the "Park Switch" are opened back up.

William Stefan
The Basic Stamp Nut

wdgoof

I originally wired it according to the attached image.  So all I may need to do is add the yellow wire (park) to the 2 COM connections coming from the motor?

I will undo or remove the previous modification and try that tonight.

Thank you.

JackMan

Do not connect the yellow wire to both COM's of the RC-2. Doing so will create a direct short when either of the 2 relays is active.

wdgoof

OK that makes more sense to me as I only wanted the park switch to effect the reverse motion.  I will connect it to only the reverse and post the results after tonight.

Thanks again for all of the advice and help.

wdgoof

I finally had some time to experiment with this and based on all your feedback I was able to get it to work.  The answer was really simple.  I wired the "park" wire into the NC port on the relay connected to the reverse for the motor.  The motor has a physical spot that is the park.  So I had to play with it a bit to get the motor into park to start the program.  After that I adjusted the reverse or "door close" time to be greater then the forward or "door open" time.

So now, when the program runs, it opens the door for a defined amount of time (in my original code it is 1.5 seconds).  The rest of the show plays, then the door closes. It hits that park position before the programed time allotment and stops.  This achieves my goal of always starting and stopping from the exact same physical position on the motor.

I can't thank you guys enough for helping me to understand how this stuff works and giving me the courage to experiment with it.

JackMan

That's great news, glad you got it working and thanks for giving us the update.  ;)