November 22, 2024, 01:29:15 AM

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.


My elevator simulator

Started by GOT, July 07, 2008, 09:46:04 PM

Previous topic - Next topic

JonnyMac

Sorry, but no amount of "programming magic" will get around the fact that the Prop-2 is single-threaded, and you can't refresh servos (which really should be done every 20 ms) and do fades that are as long as James wants with his prop.
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Quite correct Jon, however, my point was that if he removed the shutters that were hooked to the servos, and didn't try to close them AS WELL as try to fade LED's he might be able to make the prop effect look the same as moving shutters as well as fading LED's. Sorry I wasn't clearer in my last post.
Shawn
Scaring someone with a prop you built -- priceless!

GOT

OK.  I get that I can't do anything else while I am fading an LED.  What I don't get is why I can't fade an LED after I'm done with the servo (it can drift all it wants after I turn off the inner and outer LED rings).

livinlowe

You could do that, heck ya!!   :)
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Okay, let's move forward with the program -- but do keep in mind that as a consumer products designer for over 20 years, I've always engineered to what will work, not what might work; and there is a real possibillity that your servos are not going to be happy being ignored for five seconds at a time (during the long fades).

I'll print out your specs and start coding -- I'll write code while you start building things.
Jon McPhalen
EFX-TEK Hollywood Office

GOT

Jonny, I certainly am not challenging you on this.  I am trying to understand the issue so that I can fix it.  When you say the servos will be "not happy" do you mean something like losing their minds and doing something weird when I go to reset them (after the long pause of servo limbo) and use them for the next round of kids?  Should a servo be pulsed thoughout the entire program run even if it is used only briefly for a prop, then the prop is removed from sight entirely?  I am seriously considering the servoPal if that helps.
Wait a minute... Is this some kind of subversive marketing ploy? :) (I hate smileys but I thought I better use one here)

JonnyMac

The issue we face is that standard servos are designed to be refreshed every 20 milliseconds (50x per second) and if they don't get refreshed the may twitch and loose position.  Not my rules -- but as a [conservative] engineer I choose to live by them.  So... you've got servos you want to maintain while at the same time creating five-second fades.  The only way to create a fade on the Prop-2 is with the PWM instruction, and this must run to completion which means that the servos will go without updating for the duration of the fade.  Again, my conservative side says this could lead to troubles -- but that's just me.

I know your last comment was jokey, but the truth is we've never tried to sell anything to anybody; we're engineers first, sales guys last.  Had you approached us for guidance with the specifics on this prop we would have told you to go with the Prop-SX, for all the reasons I've tried to make clear in this tread.

But you have a Prop-2, so we're going to do our best to make it work.  If it doesn't... well, it doesn't, but it won't be for us not trying....
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Question: At the 5 second mark you list three things:

  -- fade up side LED
  -- fade up outer ring
  -- move servos from 40% to 60%

Are these supposed to happen in order (on at a time = okay) or concurrently (not okay with Prop-2).  If the latter, I will see if I can come up with some kind of work-around.  What I might have you do is attach capacitors to the LED output channels on the controller to hold a bit of voltage while the controller is doing other processing.
Jon McPhalen
EFX-TEK Hollywood Office

GOT

I think you missed my reply #6.  In order to work around the fade LED/move servo thing, I changed the order so that all those LEDs start in the ON state.  I fade them only when the servos are done with their motion.  To answer your question in general, go with the order listed in the step, all done serially.

GOT

OK, I just ordered a ServoPal.  Hope that fixes the issue.

jukingeo

Ollo?  Scuse Me.  May I say something?

I am hoping that I am following what GOT is trying to do.

GOT:  I do follow that you have servos opening/and closing a diamond shaped panel to create the illusion of increased distance (which is a great idea BTW).   What I don't get is the individual control of the light rings.  I am assuming that you are trying to create the fading in and out of a light source.  I would think trying to make the light source originate from a single point would be more dramatic that way.  If you have separate light sources that are visible through the top panel, what is going to happen when the panels slide over them?  Yeah, you are going to loose the number of light sources and hence reduce the believability of the effect.   It would also negate the need to dim or switch them off.  The overlapping panels will not let light pass through.  I think it would be  better to create a single but large light source, such as two halogen bulbs in a reflector, perhaps in its own diffuser box.   This way when the elevator is going "down" you can slide the shutters across AND dim the one light source.

JON: I remember back when you helped me with a special program for the BS-2 that did PWM calls from a table for a dimming chase controller.  I think the program is still here somewhere. I remember I was fixated on trying to create faux multi-tasking for the BS-2 and we both proved that IS possible.   Given this situation, it seems that the dimming of the top light and the open and closing of the diamond shaped panel coincide with one another (i.e. for every position open on the shutter would yield a constant figure for the dimmed state of the lamp).  So when the elevator is 'UP' the shutters would be wide open and the lights full brightness.  When the elevator is down the shutters would be almost closed and the lamps at a low brightness.  The opening/closing, bright/dim would be in proportion to one another.   Thus a table could be drawn up to punch in the values of what the position/brightness should be as the program cycles.   Taken further another entry in the table could control the timing for the floor counter.

So I am thinking that your program you created for me could very well be used for this application.  Be it a servo or a bulb, the table should work.  Just different values have to be punched in.

I will see if I can find that program and put a link to it here:

Ahhh, yes...here we are:

http://www.efx-tek.com/php/smf/index.php?topic=280.0

The program on the bottom.  You think it may be possible to adapt this to GOT's project?

Anyway, I thought I would pitch in.  This sounded like a really cool project.

Geo


JonnyMac

July 21, 2008, 11:42:04 AM #26 Last Edit: July 21, 2008, 11:45:16 AM by JonnyMac
The strategy used in your program worked because you were ONLY doing LED PWM; this program has much more going on and -- in my judgment -- will not benefit from what you did.  You could always prove me wrong though, as I tend to take a very conservative approach to programming (comes from all those years of designing consumer products).  Why not take GOT's specs and write a program?  Might be fun and educational for you.
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Yeah, I think because we have to pause so long between servo movement/led fades that wouldn't work, but then I'm not sure whats going on anyway!  :(
Shawn
Scaring someone with a prop you built -- priceless!

GOT

Jukingeo, I am trying to keep this on DC power and with a very low profile (My roof is only 10' tall and the elevator will take 7' of that).  So, LEDs, though point sources, are my best bet.  I talk about rings but really I am going to make a diagonal cross with the LEDs with a diffuser.  My hope is that the diffused light + the frosted glass will distort things enough that you just see the diamond.  You will probably notice a step in brightness when an LED is covered.  I might stagger them so that they are covered one at a time to minimize this.  If I was smart, I would ditch the servos all together and just make concentric rings of LEDs and dim them one ring at a time.  It might be easier than trying to turn a cosine function into constant linear motion with PBASIC (damn I miss those floating point variables).

jukingeo

Quote from: GOT on July 22, 2008, 09:52:39 PM
Jukingeo, I am trying to keep this on DC power and with a very low profile (My roof is only 10' tall and the elevator will take 7' of that).

You can drive lamps with low voltage DC power.   Tracklighting???  Low voltage, high output, dimmable via a driver transistor.  Or perhaps use a bunch of those large 1" diameter LED's if you are worried about lamp burnouts during a show.  The point I am making is to obsure the point of origin of the light source.

QuoteSo, LEDs, though point sources, are my best bet.  I talk about rings but really I am going to make a diagonal cross with the LEDs with a diffuser.  My hope is that the diffused light + the frosted glass will distort things enough that you just see the diamond.  You will probably notice a step in brightness when an LED is covered.  I might stagger them so that they are covered one at a time to minimize this.

Well for one, you can accomplish the dimming on ONE circuit.  The diamond shaped opening's shutters will just change the size and thus making this a really cool idea and I think it will work MUCH more effectively that dimming "rings".

QuoteIf I was smart, I would ditch the servos all together and just make concentric rings of LEDs and dim them one ring at a time.  It might be easier than trying to turn a cosine function into constant linear motion with PBASIC (damn I miss those floating point variables).

That will not work.  You will have a chaser effect and even if you dim the outside edges you are going still see a stepping.  The only way it would work is if you took 100's of leds and then fade them all in relatively quickly pretty much using a program similar to the one Jon wrote for me.   Either that or you would have to go with a translucent glass rather than a diffuser, so you wouldn't notice the effect as much.

I think the servo/sliding panel idea is a good one, because you can use a glass with very little diffusion and thus your guests would notice the outline of the box.   It would work IF everything around the mechanism is made pitch black.

I will say that Jon has much more faith in my programming level than I.  I consider myself a novice and MOST of the programs I created were borrowing pieces and bits from programs that Jon created for me.  If you notice Jon's name on any of the programs attached to my comments that usually means I edited a program that HE came up with, not I.   That is very much true of the light dimming program.  I am just a novice, not an expert.  Jon gets the full credit for the light program, not I.  I just came up with the idea and I made alterations to Jon's program so it would work for my use.

Now getting back to that program...I been working very much lately with table based programs.  Jon introduced them a long while back in a N & V column called "Drum Sequencer".    With the data table it is possible to program an output AND also a timing value.  Thus you work with the output that is the slower of the two (probably the servos) and you would use a timing multiplier for the dimming of the light source.

I am not going to sugarcoat it, it would be a VERY advanced program.   Would I work on it?  Sure, but right now I have a very sick computer and I am trying to 'nurse' it back to health.   (No I didn't have a virus, but I deleted my Windows partition via a partitioning program accident and I been having all sorts of problems since).

If you want the simple approach and if you have MANY leds and are willing to devote an entire prop controller for it, then sure, you can do with just dimming LED's.   But you would have to use a diffuser around the moving light box to obscure the light origin as much as possible and you would have to also use a decent diffuser glass on the elevator roof.

But I will say that if a table PWM program could be made up for your use, your first idea with the sliding panel coupled with my idea of the light source, would yield a pretty darn spectacular effect.

I don't know...I have to see what time I can generate.  The thing is that I am very interested in an elevator project myself and that is why your post initially caught my attention.  My concept of handling the situation would be similar to yours...raise and lower the ceiling and not the elevator itself.

Anyway, let me mull on this for a bit.  I have to go through the many programs I have.   But I think it can be done because all of your timing can be set to go together.  If you wanted total random servo movements and PWM'ed light dimming, then yeah you would be totally out of luck there and would have to use the Prop SX.   But in this case because a certain light level would reflect on a position of your light assembly and the diamond shutter, it could be very possible to get the values you need via a call table and still have the program update itself within the 20ms time frame that the servo's like.   Would I say it would definitely work? No...but you would have a very strong maybe.   I been more than amazed at what this little Prop-2 board can do.   Short of independent timing or interrupt handling calls, the Prop-2 should do it.   I was even going to use a Prop-2 for a pinball machine project, but after talking to Jon, I realized that project WILL need interrupt handling and thus I have to move up to the Prop-SX for that .  But this sounds like it could be something that could be done with timing and table calls.  Maybe I am wrong, but I think it would be worth a shot.

But if you want to do it the easier way you could go with the servo controller option mentioned earlier, or if you want to go with just the lamp dimming concept, perhaps we could elaborate on the PWM program I have.


Geo



Geo