Shop OBEX P1 Docs P2 Docs Learn Events
synching two basic stamps Homework Boards — Parallax Forums

synching two basic stamps Homework Boards

sami benlarbisami benlarbi Posts: 4
edited 2008-08-29 13:51 in BASIC Stamp
I built a fully working rotor ( the fair ride that spins really fast and creates a G force effect). Inside the rotor I have a projection of a short video of me going through a ride. As a viewer, watching from above it looks like the character in the projection is actually in the ride ( it's all synched up). I have two basic stamps running this. One stamp runs the dvd player and friction motor, while the other one ( in the moving parts) controls the linear actuator moving the floor up and down at the beginning of the the ride. I "could" fix this by buying a different slip ring, but at $ 350 a piece I want to explore cheaper alternatives ( if there are any ).
The problem I am having is that over time the two Basic stamp get out of synch. Both stamps have the same program downloaded. Program is pretty simple. I have tried having a third stamp with a remote control to shut down and start up both controller after each sequence but the remote does not work all that well if the receivers are not side by side ( I can't quite control where the rotating part ends up at the end of the ride).
I should say that both controllers are connected to a single power remote control, so that I am sure that both are turned on at the same time.

Bellow is my code. I would greatly appreciate any input you might have as to how to keep the two controller synched.

I have pictures of the project at :
www.s-b-l.org/distinction/index.html
video inside the rotor ( big file):
www.s-b-l.org/distinction/video/400.mpg
view of the inside as it rotates:
www.s-b-l.org/distinction/video/insideview.mov

PS: 11 is my linear actuators
15 the start switch to my dvd player
13 is my friction motor



DO
LOW 13 PAUSE 60000
HIGH 15 PAUSE 500
LOW 15 PAUSE 29500
HIGH 11 PAUSE 5000
HIGH 13 PAUSE 3000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2700
LOW 11 PAUSE 300
LOW 13 PAUSE 3000
HIGH 13 PAUSE 3000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000
HIGH 13 PAUSE 2000
LOW 13 PAUSE 3000

PAUSE 10000
PAUSE 60000
PAUSE 60000
PAUSE 60000
PAUSE 60000
PAUSE 60000
PAUSE 60000
PAUSE 60000

LOOP

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.s-b-l.org

Comments

  • kevinb2050kevinb2050 Posts: 56
    edited 2008-08-23 00:09
    Look at the SERIN & SEROUT on the editor help files to link 2 BS2's
    just watch the errors in the code (see below)

    There is an error in the sample code from the editors help file
    Help file SERIN is ok but help file SEROUT has the following error

    SERIN SI/FC, Baud, [noparse][[/noparse]letter] - the "/" should be the other way "\"

    as well as the pins are wrong in the slave code - should be as below
    SI PIN 1 ' serial input
    FC PIN 0

    I have linked a BS2 & BS2e with no problems - you could have the master send the slave a start message every couple of loops to reset
    I have had a similar problem as the stamps don't have an internal clock to keep them in sinc with
  • metron9metron9 Posts: 1,100
    edited 2008-08-23 00:58
    Not getting why you need two stamps if they are both running the same program, if they both make pin13 low for 60000 mS why not just use the same signal for both from one stamp?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • sami benlarbisami benlarbi Posts: 4
    edited 2008-08-23 10:52
    Because I have to run the power to the projector/ stamp/ linear actuator and the video signal trough a slip ring in the center. I only have four connections on that ring.
    As I said I cannot have a dvd player on something that's 6' in diameter and spins at 45 rpm.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.s-b-l.org
  • stamptrolstamptrol Posts: 1,731
    edited 2008-08-23 11:48
    If the limitation is the number of slip ring contacts, what you could do is have the rotating stamp have an output which is a LED. (in fact the LED can be on at all times) It would be mounted on one face of the rotating system.


    The stationary stamp has two photocells as inputs.Use one photocell as a trigger to tell the stationary stamp that the LED is almost ready to be checked then just count how long it takes for the next photocell to be illuminated. If the count is low, slow the loop. If the count is high, speed the loop up.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • sami benlarbisami benlarbi Posts: 4
    edited 2008-08-25 12:18
    Tom
    Thanks for your input.
    I am not sure that the photo cells idea would resolve the timing issue. What you propose is controlling the speed of rotation of the rotor, which is controlled by the stationary stamp.
    My problem is the timing of the linear actuators on the rotating part, controlled by the second stamp.
    The actuators get out of synch with the video over time ( about 1/4 of a s. per cycle). Video is started by the stationary stamp.
    I wish it could be as easy as factoring the 1/4 s. into the code but the stamps keep changing which is the slowest and which is the fastest.

    thanks again for thinking about it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.s-b-l.org
  • metron9metron9 Posts: 1,100
    edited 2008-08-25 14:22
    What about monitoring the video signal and inserting a 100mS video signal break in the signal? Instead of all the pause statements you would monitor the video signal for the return to the main loop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • MSDTechMSDTech Posts: 342
    edited 2008-08-25 19:08
    What you would want to do is make the stationary stamp a master and the rotating stamp the slave. Use Serout (on the master) and Serin (on the slave). Let the master tell the slave when to perform its actions.
    The master starts the dvd and at the point when the platform should move, it sends a charater to the slave that tells the slave to move the platform. Most of the time, the slave should be waiting for a command (see the description of wait on serin to make the slave sit and wait for a command).
    This way, only the one stamp is controlling all the timing.
  • sami benlarbisami benlarbi Posts: 4
    edited 2008-08-29 13:51
    HI
    I think I may have found a solution. A compound of all your input.
    I am reusing my third stamp as a wireless power switch, to reset the stationary motor/dvd stamp and rotation linear actuator stamp.
    At the end of each cycle ( using subroutines) I have the motor turn repeatedly on for a brief moment, moving the rotor until a LED light ( on the rotor) lines up with a photocell ( connected to the stationary stamp). At which point the motor shuts off. I then have both stamps lined up for the RF remote to work.
    I have the whole system working on my work table so far. I will get to put it to use next week when I reinstall the piece for a show and I hope it works fine.
    Thank you all for your input, you pointed me in what i think is a working solution.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.s-b-l.org
Sign In or Register to comment.