synching two basic stamps Homework Boards
sami benlarbi
Posts: 4
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
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
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
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
·
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
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.
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