October 31, 2024, 11:39:35 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Chaser Lights Programming--EFX video shot by Vern Graner

Started by jukingeo, September 10, 2007, 07:14:37 AM

Previous topic - Next topic

jukingeo

Hello All

<<**Newbie Alert**>> (Siren going off)

I just received my Prop 2 Starter Kit this weekend and much to my surprise, no disks or documentation has come with it. I did figure out that more than likely the program for the kit is on the Parallax site, and I did find some basic documentation here.  However, the documentation is VERY basic (no pun intended).

Anyway, to make a long story short one of the main things I would like to accomplish with the Prop 2 is lighting control and effects triggering.  I will eventually move to animatronics and servo use, but not for now.  Right now I want to strictly learn how to turn on and off lights and other effects (such as a sound module).

First things first (Jon, I guess this is where you come in):

On Youtube, I saw a video that Vern Graner shot of EFX-TEK at a show.  Towards the end of the video is a light chaser demo.  This is something that I would like to accomplish.   So probably the best thing to do is is follow the code for this pattern and if you could explain what is going on and what each line does, that would be a big help to me.  I could then take this basic code and then alter it.

In addition, I would like to be able to add a control to speed up and slow down the pattern, I would like instructions on how to trigger the pattern or better yet, be able to select different patterns (I understand that probably this is more advanced).

Finally, I would like to know how you would set up a standard trigger in which I can have the Basic Stamp turn on an effect (such as a sound clip and turn on a light or two).

I think this should give me enough to sink my teeth into.

Thank you in advance for your help.

Geo

JonnyMac

September 10, 2007, 08:03:17 AM #1 Last Edit: September 10, 2007, 09:48:46 AM by JonnyMac
Geo,

I'm certainly not the sharpest tool in the shed, so forgive me -- but why would you go to the Parallax web site in search of material for the EFX-TEK Prop-2 controller?  On our Prop-2 page:

  -- http://www.efx-tek.com/topics/prop-2.html

... you will find documentation, as well as a Prop-2 programming basics presentation that we give.  The documentation includes a demo chaser program that is triggered and has speed control.  Isn't this exactly what you're asking for?

If you peruse these forums you'll see that I happily write programs for any person that requests them.  Perhaps, in the end, we may not be the right controls company for you.  If you feel like that's the case, please contact us by e-mail so that we can provide an RMA and prompt refund.  We strive to have happy customers, not customers who feel like we have shorted them.  If you decide to stick with us, I can assure you that we'll do everything in our power to help you get what you want from our products.

Here's the program from the Prop-2 docs -- it will run on the Prop-1 Trainer Board that comes in the Prop-2 Starter Kit.

' =========================================================================
'
'   File....... Strobe_Controller.BS2
'   Purpose.... Linear strobe of six outputs
'   Author..... EFX-TEK (www.efx-tek.com)
'   E-mail..... teamefx@efx-tek.com
'   Started....
'   Updated.... 11 JUN 2007
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Creates a linear strobe of six lamps/LEDs on P8..P13; much like airport
' landing lights.  Strobing runs when button on P14 is pressed, and rate
' can be adjusted with pot circuit on P15.
'
' Replace the ULN2803 on P8..P15 with a ULN2003 to allow the pot circuit
' on P15 to operate correctly.


' -----[ Revision History ]------------------------------------------------


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

Speed           PIN     15                      ' remove ULN, SETUP = DN
Trigger         PIN     14                      ' SETUP = DN
Lights          VAR     OUTH                    ' use high pin group


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

IsOn            CON     1
IsOff           CON     0


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

thePin          VAR     Byte                    ' Lamp/LED pin pointer
delay           VAR     Word                    ' for timing


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

Reset:


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

Main:
  DO WHILE (Trigger = IsOn)                     ' run when button pressed
    GOSUB Speed_Delay                           ' read speed setting
    FOR thePin = 8 TO 13                        ' loop through lamps/LEDs
      HIGH thePin                               ' LED on
      PAUSE delay                               ' hold
      LOW thePin                                ' LED off
    NEXT
  LOOP
  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

' Reads pot on Prop-1 Trainer, then sets delay to 50 to ~150 ms

Speed_Delay:
  HIGH Speed                                    ' charge RC circuit
  PAUSE 1
  RCTIME Speed, 1, delay                        ' read raw delay
  delay = delay / 3 + 50                        ' set new range
  PAUSE delay                                   ' hold a bit
  RETURN


' -----[ User Data ]-------------------------------------------------------


Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on September 10, 2007, 08:03:17 AM
Geo,

I'm certainly not the sharpest tool in the shed, so forgive me -- but why would you go to the Parallax web site in search of material for the EFX-TEK Prop-2 controller?  On our Prop-2 page:

  -- http://www.efx-tek.com/topics/prop-2.html

... you will find documentation, as well as a Prop-2 programming basics presentation that we give.  The documentation includes a demo chaser program that is triggered and has speed control.  Isn't this exactly what you're asking for?

If you peruse these forums you'll see that I happily write programs for any person that requests them.  Perhaps, in the end, we may not be the right controls company for you.  If you feel like that's the case, please contact us by e-mail so that we can provide an RMA and prompt refund.  We strive to have happy customers, not customers who feel like we have shorted them.  If you decide to stick with us, I can assure you that we'll do everything in our power to help you get what you want from our products.

Here's the program from the Prop-2 docs -- it will run on the Prop-1 Trainer Board that comes in the Prop-2 Starter Kit.




Hello Jon,

Thanx for the quick reply.

At first I didn't see the editor link on that page, but saw it this time. Must have just skimmed right over it.  But I will be the first to say that I do have a brain fart every now and then.  But that happens when one tries to raise two twin baby boys and the max sleep in a day is about 4 to 5 hours.

As for the documention, it kind of jumps right into it and I really would like to know what it is that I am programming.  Sure copying code is one thing, but learning is another.

As for the attached chase program, I doubt it is the same one that the you presented at your show.  I was very facinated at how you manged to get the bulbs to dim and 'slow chase'.  So naturally I would be after that program.  The basic program will do fine while I am getting used to things...but I would like to know how to program the Prop 2 as you have at your show.  That was really cool, BTW.

Finally I don't know why you might think I am unhappy with something that I didn't even try out yet.  This is the second time you mentioned this (the first being in one of my emails).  I think there was a cross in communication somewhere and perhaps you my got to thinking that I may be treating the Prop 2 as if it was a DMX or MIDI lighting controller used for theatrical purposes.  I do know the differences and I have used systems like that before too (I do have a theatrics background).  I know there is no way a stamp could keep up with that level of automation and control.   For those applications a dedicated computer system is a must.   Also, I am not looking to use a Basic Stamp just for one particular purpose.  It is something that I always wanted to learn to do.   I know that I should be able to use Basic Stamps for the Delorean project I mentioned in my emails.  Once I get to a full fledged dark ride haunt...well, then I may have to get into something bigger.  But still once I get more involved with animatronics, I still will probably will use a basic stamp for the individual props and perhaps use a full computer system for the 'house' and special effect lighting.

So I don't think I got steered the wrong way and the thought never crossed my mind.  Right now I must want to learn to use the thing :).

Thanx again for the help and the source code for the chaser.  (So this just copies right into the editor (cut and paste))?


JonnyMac

As soon as I finish a book for Parallax (called "Practical SX/B"), I will be writing a book for us called "Custom Prop Programming for Everyone."  Honestly, I had hoped to have it done by now but books are not as easy for me to write as my magazine column.

I wrote a book while at Parallax, "StampWorks", that teaches BS2 programming -- you may find that helpful for general programming skills.  You can download that book as a PDF from Parallax.  It is designed around their Professional Development Board, but still, it teaches good programming fundamentals that you can apply to your Prop-2 projects.

Here's the link: http://www.parallax.com/detail.asp?product_id=27220

Forgive me for being human, I felt like I was being fair in offering you a way out of a product that you seemed unhappy with.  I'm sorry if I was wrong -- just my interpretation of the tone of your text.

You can copy-and-paste the code, but you'll also find that program in a ZIP file in the Downloads section on the Prop-2 page.
Jon McPhalen
EFX-TEK Hollywood Office

gadget-evilusions

I just want to jump in here for one second and say, Geo, if it's the video I am thinking of your need an FC-4 to control incandescent lighting as shown in that video. That's video is the reason I bought an FC-4.
Brian
Evilusions LLC
www.evilusions.com for all your pneumatic components

JonnyMac

And that FC-4 is being controlled by Vixen -- but could have been controlled by a Prop-1 or Prop-2.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on September 10, 2007, 01:09:14 PM

I wrote a book while at Parallax, "StampWorks", that teaches BS2 programming -- you may find that helpful for general programming skills.  You can download that book as a PDF from Parallax.  It is designed around their Professional Development Board, but still, it teaches good programming fundamentals that you can apply to your Prop-2 projects.

Here's the link: http://www.parallax.com/detail.asp?product_id=27220

Forgive me for being human, I felt like I was being fair in offering you a way out of a product that you seemed unhappy with.  I'm sorry if I was wrong -- just my interpretation of the tone of your text.

You can copy-and-paste the code, but you'll also find that program in a ZIP file in the Downloads section on the Prop-2 page.

Thanx for the link on the book.  I think I do need a good book to learn more about what it is that I am doing with the programming code (I.E. the learning part).

I have pretty much downloaded all the materials on your site about the Stamp 2.  Even though I have programmed computers in BASIC (back in the 80's).  This is different and alot of it doesn't seem familiar.  Sure we had things like GoTo loops and If Then Or's (etc).  For one we also had line numbering back then.  That doesn't seem to apply here.  So yeah, I am going to be needing a really huge primer on the PBasic lanquage.

I am probably going to get your book.  I see right now that they have it back ordered.

As for 'the other thing'.  Well, emails are not perfect  I can get to learning how to program the Prop 2 then I will be happy with it.  I know I will have uses for it.  If I DON'T learn how to program it, then that is the only case where I would be unhappy.  But I don't foresee that.

Anyway, I did download (and print) that presentation document.  But I will be needing some help interpreting it.  I probably will be asking you more specifics as we go along.

Thanx,

Geo


jukingeo

Quote from: JonnyMac on September 10, 2007, 01:51:54 PM
And that FC-4 is being controlled by Vixen -- but could have been controlled by a Prop-1 or Prop-2.


Ahhhh, yes.  This is the second time I heard about that program.  I guess I have to look into it more.  I am assuming it is easier to program than a Basic Stamp.  I can envision the code for doing all those dimming functions would probably be pretty intense for a Basic Stamp, right?

What can Vixen all do?  Is it a stand alone program, much like a DMX controller?

As for the FC-4...well, it seems to me that it isn't much different than a DMX dimmer pack.  I have quite a bit of an understanding of how control packs and dimmer packs work.  So yeah, I do know that something is needed to have the Prop 2 drive the lamps.  I can put something like that together, or even rework one of my dimmer packs to accept the input of the Prop 2.  God knows I have enough of them laying around.  After all, both systems start with a processor driving an LED/optocoupler array.

Thanx,
Geo


JonnyMac

Vixen is indeed a stand-alone lighting controller; you can read all about it at www.vixenlights.com.

One of its many cool features is a modular architecture and the ability to support custom plug-ins.  We worked with Vixen's creator, KC Oaks, to create plug-ins that turn Vixen into a simple program generator for the Prop-1 and Prop-2.  You can read about that in this thread: http://www.efx-tek.com/php/smf/index.php?topic=140.0.  We also have simple drivers for the Prop-1 and Prop-2 live, allowing one to control servos and valve outputs from Vixen in sync with audio.

The FC-4 is a four-channel dimmer that is compatible with our products/protocol.  Do note that the Prop-2's max serial baud rate is somewhere around 50K -- that's a long way from the 250K of DMX.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Quote from: JonnyMac on September 11, 2007, 08:35:29 AM
Vixen is indeed a stand-alone lighting controller; you can read all about it at www.vixenlights.com.

One of its many cool features is a modular architecture and the ability to support custom plug-ins.  We worked with Vixen's creator, KC Oaks, to create plug-ins that turn Vixen into a simple program generator for the Prop-1 and Prop-2.  You can read about that in this thread: http://www.efx-tek.com/php/smf/index.php?topic=140.0.  We also have simple drivers for the Prop-1 and Prop-2 live, allowing one to control servos and valve outputs from Vixen in sync with audio.

The FC-4 is a four-channel dimmer that is compatible with our products/protocol.  Do note that the Prop-2's max serial baud rate is somewhere around 50K -- that's a long way from the 250K of DMX.

I checked out the Vixen program the other day.  It looks interesting...but the part with having to 'tap your keyboard key' is a bit tedious.  Surely there must be a simpler way to input trigger data in time with music, right?

I was looking over the items I got with the Prop-2 kit.   I did notice that the trainer board is mostly aimed for the Prop-1.   I have two questions to start with.  1) Why do you have to change the chip?  2) The program is written for the BS-1.  I am assuming that BS-1 programs CAN be used with the BS-2 (just not vice versa, right?).

I looked over the simple back and forth chaser code for the trainer's program.   Now as far as I can see, this can be a 'core' program and that only the lines that say EEPROM contain the actual chase program.  So would I be correct in saying that all I have to do is arrange these six digit groupings 0's and 1's around to create a different pattern?  If that is so, then what would I have to do to create a 'built in' pattern change.  Meaning I would like to program the button to change to a different set of patterns.  Better yet, I would like to group patterns together that change automatically and then use the button to change the group of patterns.  I am assuming that can be done, right?

Finally.  How would I go about handling a 'dimming' chase pattern (similar to what you did in the video).  I know this would require much in terms of code....but I think I can get Vixen to help out here, right?

Thanx,

Geo

JonnyMac

September 14, 2007, 08:13:27 AM #10 Last Edit: September 14, 2007, 08:31:48 AM by JonnyMac
1) You'll have to post your Vixen input/questions in the Vixen forums  (www.vixenlights.com) -- we just use the program, we don't develop it.

2a) The Prop-1 Trainer has a POT (RC) circuit on P7 that will not work if the ULN2803 is left in place; by changing to the ULN2003 this circuit works fine.  With POT your programs can have analog input that could be used for thing like chase speed, etc.  FWIW, the Prop-1 Trainer was developed right after the Prop-1 came out, over two years ago -- that said, it works fine with the Prop-2 (which was just released about six months ago).  Theres a discussion about using the P1-T's POT circuit with the Prop-2's RCTIME function in this thread:

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

2b) While PBASIC 1 and PBASIC 2 are similar, programs need to be adjusted when moving from one controller to the other.

3) Using an EEPROM table is an easy way to create a chaser; by using multiple tables a program could easily switch patterns based on user input (I did a project like this in StampWorks that I wrote when working for Parallax).  All of this is rather simple for a programmer with a bit of experience.

4) The dimming chaser you referenced was created with our FC-4, a 120 VAC lamp dimmer and was run by Vixen.  A similar program could be created in the Prop-2 by putting brightness levels into a table and transmitting them at specific intervals using the FC-4's "S" command input.  If you want to do a similar thing with LEDs you would have to use the Prop-SX which can -- with tricky background code -- PWM (brightness modulate) multiple outputs.  I wrote a demo program for Brian Warner in this thread that shows the PWM framework code:

http://www.efx-tek.com/php/smf/index.php?topic=245.0
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Hello Jon,

Guess I will answer according to number :).

1) Oops!  Sorry, but do give me the 'E' for effort in trying to slip that one in there.

2a) What is really the main difference with the IC's?  I would guess that the 2003 has less output drives because it is physically shorter?  What about the ratings?  Is that the same as the 2803?  Now obviously the Prop-1 Trainer is a development tool and normally wouldn't be 'left in' the circuit.  So if I decided to hard wire a pot to one of the input connectors, I would still have to use the 2003 right?

Now what if you want to hook up two pots?  Let say that one pot controls the speed of the chase and another pot adjust the time before the pattern changes.  Can that be done?

2b) Yeah I saw something in regards to the Prop-1 needing a 'symbol' command, whereas the Prop-2 doesn't use it.  But I am sure there is more that just that.  So I guess then there will always be some kind of programming 'surgery' to do the conversion.

3) For the most part I do have trouble figuring out what each part of the program does (hence my learning curve), but this was one thing I picked out real quick.   I noticed that for the Prop-2, the 'air strip' strobe program doesn't use an EEPROM table like this one does.  So I guess like with electronics, with programming a stamp, there is more than one way to skin a cat.

4) The Prop-2 CAN control the FC-4, right?  Doesn't the FC-4 use optocouplers and hence internally that would be varying the brightness of the internal LED.  Or are you using a different method of driving the outputs of the FC-4 altogether.

Oh, I see.  I just checked that link you sent.  The problem with Basic-2 stamp is that you only can dim ONE channel at a time.

So would I be correct then in saying that the Basic-2 Stamp is NOT multi-tasking whereas the SX can multitask?  In other words whith the SX you can set one timed operation, and then set another before the other is complete?  (hope I am making sense here).

Well if worse comes to worse, if I do want to get crazy with dimming then I will stick with a Vixen control step.  However, I WOULD want to try to see if I can do a pulsing lamp.  I could see quite a few uses for that.

JonnyMac

1) We expend enough energy supporting out own products, so forgive us for not doing tech support for others....

2a) Ratings for the ULNs are identical -- and you can see for yourself by downloading the spec sheets from our web site.  You don't in fact ever have to use a ULN2003 if you are willing to clip the appropriate pins on the ULN2303.  I have a rig a Prop-1 and uMP3 player; the ULN2803 has pins 1 - 4 clipped off.  Yes, you can connect two pots -- just clip the associated ULN pins (it's in a socket for more than one reason).

2b) Most Prop-1 to Prop-2 "programming surgery" after the conversion of SYMBOLs is trivial; usually changing parenthesis to square brackets.  The Prop-2 is more flexible with SEROUT, so there's a little work there, too, but it is just a little -- especially when using one of our standard templates (they include the baud constants for our accessories).

3) I have THOUSANDS of ways to skin programming cats; comes with time and experimentation -- you will learn more by experimenting than by anything else.  I'm good at coding microcontrollers because I spend eight to 12 hours a day doing it.  At some point you just have to dig in and start.

4) Yes, of course, the Prop-2 can control any of our accessories.  Dimming AC involves precise timing of the triac signal vis-a-vis AC voltage zero-cross point; that's done on the FC-4 by a high-speed SX processor (which I programmed in BASIC [mostly] using SX/B).  The FC-4 takes care of dimming, the external host (be it Vixen, a Prop-1 or Prop-2) simply tells the FC-4 what the level of each channel should be (0 is off, 255 is full bright).

The Prop-1 and Prop-2 have a PWM instruction that can be used for dimming from one extreme to another (so you can pulse a single output) -- you cannot use it to set an output to half brightness and then leave it there; this is where the Prop-SX comes in.  That can be programmed with "background processes" to handle multiple dimmers, or dimming an output while the foreground does other things.  The Prop-1 and Prop-2 are single-process controllers; the Prop-SX can do multitasking if programmed appropriately (which is not for beginners).

Do yourself a favor Geo, start with blinking LEDs.  If you rush too quickly to your end goal you may not learn important lessons that will serve you later.
Jon McPhalen
EFX-TEK Hollywood Office

jukingeo

Hello Jon...  I guess I will stick with the numbers game again.

2a) Ok, so then the 2003 does have less outputs to free up those pins for the inputs. So I would have to disable another output in order to use another pot.  Ok, I think I am getting it now.

2b) Do you have a conversion chart or PDF with this conversion information already?  While I may not need it now, I know there probably will come a time where I will find a BS-1 program that I would like to utilize and a handy reference would be good.

3) Ok, that's a lot of skinned cats!  Well, as I said, I am a complete newbie when it comes to programming. ...Alright I will admit to doing some Basic programming back on the old Commodore PET computers back in the 80's.  Yes, a dinosaur, I know.  So obviously much has changed since then.  Anyway, I am going to hook the Prop-2 and trainer board this weekend and try to play around with some of the programs.  Perhaps I will try a few minor alterations (such as that one program with the EEPROM command lines).

4) You just basically confirmed what I thought the SX processor can do.  Granted, that WILL be the next level because I DO want to take advantage of the multi-tasking that it has to offer.   But I guess I just need to 'get my feet wet'.  I been wanting to work with these micro-controllers for a long time.  I just didn't know what direction to take.  But this sounds good because as of now I believe the Prop-2 WILL handle most of my initial projects nicely and most just involve simple turning lights on and off.  Flash something here, chase something there.

Ok, I guess it is time to hook it all up and see what happens

Thanx for your help.

Geo

JonnyMac

2a) Parallax -- creators of the BASIC Stamp and PBASIC -- have such a document: http://www.parallax.com/dl/docs/prod/stamps/BS1nBS2ConvTips.pdf

3) Good; talk is cheap, start programming!  ;D

4) Learn to walk before you decide to train for a marathon.  ISR programming (multitasking) on the SX requires a bit of programming finesse -- again, it's not for beginners.  That said, those who will invest the time to learn to program the SX will be well-rewarded.  I love working with the SX; all of my Nuts & Volts columns this year have used it.
Jon McPhalen
EFX-TEK Hollywood Office