May 05, 2024, 10:21:52 AM

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.


Vex Transmitter to Prop-SX to Servos + PC (via Serial)

Started by JonnyMac, May 27, 2008, 07:24:22 PM

Previous topic - Next topic

davisgraveyard

What about Vixen?  Is that more limited or just the same as VSA?  Or does Vixen even have an import option?

Jeff

gmacted

Jeff,

     Have you thought of massaging the data so you don't need as many data points?  Similar to how VSA treats a servo, from position 1 to position 2 in a period of time.  The Prop-2 code would then need to interpret the three data points instead of a datapoint every 20ms.  This would dramatically decrease the amont of data you would need.  I'm not sure the prop-2 would be able to do this, but I think the Prop-SX could.

Greg

JonnyMac

To my knowledge, Vixen doesn't have an import function.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

It would probably be ok that VSA has a 33ms limit.  I could scale my data points down to a minimum of 2 repeats (40ms) which is about 1800 data points.

Too bad Vixen doesn't have a way to paste in your data instead of doing it with the GUI?  I'll check into VSA to see if it does the import like you think it might.  I'd like to give this a try.   

I assume no matter what, I am still going to have to go with a external power supply for my servos because of the power regulator on the Prop-SX or Prop-2?


JonnyMac

If you're using VSA it might actually be quicker to rebuild the show.  VSA has a live capture function (one tract at a time while the audio and other tracks play) that even has a smoothing function for the data.  I've not used this yet -- just read about it in the help file.

Yes, I think for your skull you're going to need an external power board.  I've run lots of servos from our controllers, but not of them under particularly heavy loads.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

So one of the reasons I never wanted to go the VSA route was because of the teathered PC to the prop concept.   So what is the most common way people connect a PC running VSA to a prop controller in a prop from a long distance.  I would want the PC to be in the house and the prop is probably 25-50 feet way?


JonnyMac

September 07, 2008, 10:59:59 AM #81 Last Edit: September 07, 2008, 11:12:17 AM by JonnyMac
Use the lowest possible baud rate that VSA says will work with your routine (it has a bandwidth analysis feature).  RS-232 is actually supposed to be fine up to 50 feet, and the lower the baud rate (which fights cable capacitance) the better.  What you want to ensure, though, is that your PC is sending true RS-232 levels (+/-15 volts) and not "RS-232 compatible levels" that are generally in the +/-5 volt range.

From Wikipedia: A widely-accepted rule-of-thumb is that for cables longer than 50 feet (15 meters), special effort will be required.

I wish I was better at PC programming; seems like it should be very easy to read the CSV export from VSA and dump it into a Prop-SX to run stand-alone.  That said, I'm going to spend the morning crafting a Prop-SX RAPU program so that when I _can_ get the PC side going I have a Prop-SX that can accept the data and then play it back in stand-alone mode.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

wouldn't you run into the same old storage limits droping a VSA show into a Prop-SX?  Or are you talking about burning it into the 32K eprom?   And even then if the show were too complicated would that not be enough pace for all the data?

I'm going to buy a copy of VSA next week and give this a try.  I'll try setting it up from scratch and also importing my data.  Once I have something running I can look into the export.  I could probably write something quick that converts the data to something you could use?

Jeff

JonnyMac

What I'm talking about is using all of the SX horsepower: use background servo processing to get the timing right and put the data into the 32K EEPROM -- that's why I need a PC program that can read the exported VSA data, massage it, then "talk" with my Prop-SX RAPU program that is in download mode.  By using the 32K EEPROM instead of putting servo data into the actual code space you can have a 4-servo show run 4.55 minutes (at the 33ms rate of VSA).  If you want four servos plus four PWM channels (which I think would be good for a skull) the show length drops to 2.25 minutes, but this is probably still long enough for most shows (our "customers" get bored quickly, no matter how cool our prop is).  I'm going to try to be clever with my code so that the PC can tell the Prop-SX what the data means (just servos or servos+pwm, and the frame rate of the program [lower frame rate = longer show]).
Jon McPhalen
EFX-TEK Hollywood Office

randyaz

Would it be possible to save the data file on a thumb drive and use a Vdrive2 interfaced with the SX to read in and buffer the data using a no preserve interupt routine?  If its possible, the storage issue would solved. Only task left would be coding for the Vex or VSA/comma delineated formats.

http://www.mouser.com/Search/ProductDetail.aspx?qs=vnwGVgFuQiZQSHig5qjpOQ%3d%3d

JonnyMac

I suppose it's possible.  The funny think about FTDI is that while that make really cool products (like the VMUSIC2) they're not so good at providing useful examples.  I think the VMUSIC is just an extension of the VDRIVE so -- when time permits -- I can look into reading CSV data from it using the Prop-SX. 

That's said, I think people get bored with talking skulls that go more than a minute or so, and if that holds true we have plenty of storage space right on the Prop-SX
Jon McPhalen
EFX-TEK Hollywood Office

randyaz

I was just brainstorming/daydreaming and thinking on a larger "show" scale than just a couple of talking skulls.  It would be cool to be able to pull show routines in from a "library" on a thumbdrive.  Master/slaveing/RS485, DMX, complex motor control, sound...might be alittle grandiose but I am just thinking...

JonnyMac

Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

I was wondering, would it be possible to modify the program of this thread to burn the data it sends out the serial port to the SX EPROM?

I took a look at my captured data of a 2min session using this program and it is 35K.  Some of this could be reduced since I only use 3 servos for capture and there is a lot of duplicated data at the begining and end of the session since the servos sit for several seconds as the audio starts and ends. 

The file I create using a PC to format the captured data into DATA s1,s3,s3,count  is only 2957 lines.  That would be 12K if you stored 4 bytes for each line.  Although then you would have to keep a counter in the SX program for each 20ms frame and only write to the EPROM if any of the servo values changed.   Using that method, if even possible, would allow you to store a HUGE show if you wanted.

Then you could use the VEX program to puppeteer your animatronic and then load the player and it would read the EPROM data and play the show back?  Pretty simple process if it could be done?  For me it would have to be next year but I would be half tempted to try it this year if it were possible?


Jeff




JonnyMac

September 28, 2008, 10:59:17 AM #89 Last Edit: September 28, 2008, 11:03:24 AM by JonnyMac
To be candid, Jeff, I don't know and like you, my time is so pressed right now I probably won't be able to know until after Halloween.   It might be workable with fixed filtering/compression, though you would want to use a binary divider ( 2, 4, or 8 ) to simplify averaging of the data.  Something like this (pseudo code):

  PUT eeOut, 0, 0, 0, 0                         ' clear samples
  FOR idx = 1 TO 2                              ' average by 2x
    GET_VEX                                     ' get raw channel data
    FOR idx2 = 0 TO 3                           ' loop through 4 channels
      vex(idx2) = vex(idx2) >> 1                ' divide by 2
      eeOut(idx2) = eeOut(idx2) + vex(idx2)     ' accumulate / average
    NEXT   
  NEXT
  WRITE_EEPAGE eePntr, eeOut, 4                 ' write bytes to EE
  eePntr = eePntr + 4                           ' update pointer


For the moment, anyway, I think there is too much jitter in the VEX output to do variable sampling/compression.  With the scheme suggested above you could store 8192 records for four channels.  Each record would run 2x the VEX timing rate of about 18.5 ms; this means each position has a minimum time of 37 milliseconds and the total show could be 303 seconds, or 5 minutes. 
Jon McPhalen
EFX-TEK Hollywood Office