May 18, 2024, 03:11:13 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.


Converting a Robo-Ware program to an HC-8+

Started by JackMan, June 22, 2012, 08:56:22 PM

Previous topic - Next topic

JackMan

Yep, 9600 baud.

Bill,
  Thanks for the input, I wish it was that easy. I'm driving 10 servos with this program. The Robo-Ware program has to be converted to something that the HC-8+ can read and execute through a serial connection and it has to do it fast enough to keep up with the timing. I don't have a snowball's chance on my own of getting this to work but Jon's a programming GURU, if it can be done, he'll figure it out.  ;D

JonnyMac

June 24, 2012, 09:21:03 PM #16 Last Edit: June 24, 2012, 09:26:55 PM by JonnyMac
I was ill earlier (lunch came back up -- not sure why) and made a mistake in my timing estimate.  The Mini-SSC requires three bytes per channel per frame:

  Sync  Channel  Position

At 9600 baud N81 this means 3.1ms per channel per frame; with 10 servos we're at 31ms.  No problem so far.  But if I remember correctly, you're not using channels 0..9, you have a break in the channel #s.  This if fine on the PC end, a problem on the Propeller end.  Can you re-arrange the channels such that your 10 outputs are on contiguous channel #s? 

I'm hoping that Robo-Ware leaves the output line idle until the show starts.  If this is the case we should be able to come up with a program that does this:

  -- close switch to arm for record
  -- open file for write mode
  -- rx 10 channels in Mini-SSC mode
  -- write positions to file
  -- repeat until switch opened
  -- close file

Now... you won't be able to edit this file as it will be raw position values; this is why I'm hoping that Robo-Ware only transmits servo data when a show is actually running.  Once we have the data in place it will be easy to read and rebroadcast in Mini-SSC format (adding Sync and Channel bytes).
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Good on 1 criteria, not so good on the other. I'm pretty sure there's no data being sent until the show starts. The skip in channel #'s is a problem. Each skull has it's own Mini-SSC mounted inside, each SSC  has 8 channels. I'm using 0-5 in the first skull (not using 6 & 7). The 2nd SSC has channels 8-15, I'm using 8, 10, 11, 12, not using 9, 13, 14, 15. I'd have to do some major re-wiring between the skulls to use consecutive channels. 

JonnyMac

Okay, Jack, you're killing me, buddy.  I'm going to come up with something for you, but you're going to need to jump on programming in Spin so you can make modifications as your show changes. 

Steam is beginning to dribble from my ears... ;)

Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Sorry for all the stipulations buddy, I know this is a PITA, but I have faith in you. Better to have steam from the ears than lunch from the pie hole!  :P  As for modifications, there won't be any, if we get this working I ain't touchin' it! Besides, you know that old saying, "You can't teach an old dog new tricks", I think that might apply to me on this because at the moment Spin is a little over my head.  ???

JonnyMac

I'm backing up just a bit. At the moment I'm writing a program for the HC-8+ that emulates the Mini-SSC (eight channels). I'm going to want you to try it just so I can make sure I have the protocol reception down.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

You probably already have this but here's a PDF of the docs for the Mini-SSC.

JonnyMac

June 25, 2012, 08:22:44 PM #22 Last Edit: June 26, 2012, 01:49:52 PM by JonnyMac
I know the protocol, just wanted to find a clean way to implement on the Propeller.  Do me a favor and load this program into the HC-8+.  Using the same serial port as what you used for programming, send a test show down with some servos hooked up.  I don't have a mechanism for sending Mini-SSC packets from my PC.

I just realized that I do in fact have VSA and I can send Mini-SSC packets from it.  I'm working on a new project that allows one to control four servos and four dimmer channels from VSA, record to a file, then play live.  This will let me test the reception of Mini-SSC protocol data. 

Update: This seems to work with VSA -- please test to ensure that it works with Robo-Ware.  You'll need to tell Robo-Ware to send its commands using the same serial port that the Prop-Plug is using, and this will have to be connected to the programming port of the HC-8+. 
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

July 02, 2012, 06:36:36 PM #23 Last Edit: July 02, 2012, 07:05:28 PM by JackMan
Jon,
   Yep, this seems to work perfectly with Robo-Ware. I just tested it with some spare servos, not on my props but it looks good. What's the next step?

JonnyMac

Still struggling with doing a clean recording -- trying to avoid capture/record altogether....

Does Robo-Ware save each channel script separately?   
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Yeah, the individual channel scripts are what I posted awhile back in the Word document. They were copied and pasted directly from the Robo-Ware program.

JonnyMac

Any chance I could convince you to switching to Vixen?  ;D

Just yesterday KC gave me a binary export utility that allows a show created in Vixen to be exported to a file that then HC-8+ can read and play.  In most cases we would use the HC-8+ outputs (and DMX port), but I could use one of the pins to send the serial signals to your Mini-SSCs.

BTW... can you connect between a 3-pin header on your HC-8+ and the Mini-SSC?  If this is the case I'll want to whip up another test program to ensure we can send commands from the P0 output header.  I'm assuming you want to start an AP-16+ with the SERIAL header.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Well, I assume switching to Vixen means re-writing the whole program, not really thrilled about that.  ::) I don't see a problem with connecting the Mini-SSC to the PO output header, we just won't use the R pin. I really don't need to use the serial header for the AP-16+, I can start the audio with the switch input.

JonnyMac

QuoteWell, I assume switching to Vixen means re-writing the whole program

Yeah, it would.  Come on, Jack, it could be fun!!!

Okay, I'm one of the few that re-builds old projects to make them better.  Though the up-side of doing that is you could take advantage of the outputs on the HC-8+ in the show....

Here's my worry: I think I can figure out a way to capture the data but there is no way to edit that data and if there's a sync error it could cause problems.  Maybe I'm worrying too much about code I haven't figured out how to write.  That said, I'd prefer to write code I could use over and over again and I don't see capturing steams as happening very often.  I will, though, it you think rebuilding your show in Vixen is too much.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

July 04, 2012, 06:02:44 AM #29 Last Edit: July 04, 2012, 07:40:40 AM by JackMan
Well, my first choice would be to capture the stream and hope for the best. I know re-writing this is gonna take me forever. I'm controlling 10 servos, if I did re-do this in Vixen would the HC-8+ be able to send all the serial commands to the Mini-SSC's?

Just thinking, would I be able to take the scripts right from the Robo-Ware program and manually enter those commands into Vixen?
I realize the terminology would be different but if I could use all of my existing data I guess it wouldn't be that bad.