November 25, 2024, 09:25:39 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.


Help with creating a 3-axis skull Prop with the HC-8+, Vixen and an AP-16

Started by BigYellowDogFX, April 25, 2013, 07:16:49 PM

Previous topic - Next topic

BigYellowDogFX

Hello all,

I am currently working on a prop utilizing the HC-8+ and I have hit a point where I could use some guidance. 

The Prop:  I need the HC-8+ to control a 3-axis skull along with a 12v LED pinspot and a DMX based fog machine.  I have an AP-16 that I plan on working in conjunction with the HC-8+ to provide the dialogue for the skull along with the background music for the prop.  I plan on downloading the completed show to the HC-8+ and running it sans computer with the uSD card adapter.

I am utilizing Vixen for the HC-8+ programing.  I have the AP-16, HC-8+, Prop-Plug for the HC-8+ and the uSD card adapter.

Where I am now:  I have figured out the rudimentary basics of working with Vixen 2.1 (there wasn't enough videos on how to use Vixen 3 out there yet for me to try to tackle it).  I have downloaded the "object sequencer" which is basically a graphical interface for controlling a 3-axis skull in Vixen (works great).  I have downloaded (to the EEPROM) all of the files (from this forum) suggested for running Vixen on the HC-8+.  I can control the skull from Vixen.  I get it to rotate, tilt, nod and move the jaw while the audio file is playing from the computer.  I have not built my entire show but I feel it is more critical for now to learn how to put the pieces together step by step first rather than spend hours building a show and then realizing I can't use it because I can't figure out a link in my complex e- chain.  However, I do have a good basic sample (program/show) that I can work with to ensure things are working properly.

What I need to do now:  1) Figure out how to download the show to the uSD card and get the HC-8+ to play the show without the computer. 2) Figure out how to chain the HC-8+ and AP-16 together so that they work in sync, the AP-16 playing the audio, the HC-8+ moving the animatronic accordingly.  3)How to trigger it all utilizing the PIR I purchased (triggering the AP-16 with the PIR was a fairly easy thing to do, triggering the HC-8+ I can't figure out.) 4) Determine how to control a DMX based fog with the HC-8+ utilizing Vixen.  This is not the biggest deal.  I can hack the DMX remote that came with the fog machine and hook it up to constant AC power, then run a relay off of the HC-8+ high current outputs and force it to produce fog when I want.  It would just be nice to have a more elegant plug and play solution. 5) Determine how to run the 12v LED pinspot off of the HC-8+.  Again, not a huge deal as I'm pretty sure I can always run the HC-8+ off of a 12v power source and then hook the LED pinspot up to one of the HC-8+ high current outputs.

So..#1,2 & 3 are my biggest stepping stones right now and despite reading all the forums on Vixen and Hacking the HC-8+ I'm at an impasse. 

I think that is it for now.  Thanks to everyone in advance!

JonnyMac

Have no fear; others have used Vixen to create stand-alone shows. Sounds like you have the hard part (creating the show) sorted.

Once you have a show running in Vixen through the HC-8+ you need to do these things:

Export the show file and copy to your uSD card for playback on the HC-8+. The export function -- as long as you've downloaded the add-in -- can be found under the Add-ins menu as Raw Data Exporter.  The file name will be in the form vixenNN.bin where NN is the show # (00 to 15 to correspond with files on the AP-16+).

Copy the audio for your show to an SD card for the AP-16+ and name it to match your show file, that is, if your show file is vixen00.bin then your audio will be called sfx00.wav. The match is important for the software.

You will connect the AP-16+ to the HC-8+ via there 3-pin serial headers. Easy-peasy. You will set your AP-16+ for fast baud (BR switch on) and address %00 (A1 and A0 switches off). It's okay to have the loop switch on to play AMBIENT.WAV between shows if you want.

Your PIR will connect to the IN0 header of the HC-8+ to start the show. If you have multiple shows you can set the player program to randomize.

NOTE: Do not use the PIR while testing -- create a switch using an extra WRB cable (connect the red and white wires via a normally-open button [like a doorbell button]). PIRs are notorious at best, and impossible to test with. Once everything is working as you wish using the button, swap it for the PIR.

The great news is the the HC-8+ has DMX output and it's used in my player code to other boards via DMX. This means there is no need to hack the remote; you can assign the fogger to channel 9 (1st channel after HC-8+) and use DMX commands to control it. This should make life much simpler.

The past few months we've been using the is process with light and pneumatics so that's my latest code. I will find and update my servo based HC-8+ programs and post them in a day or two.
Jon McPhalen
EFX-TEK Hollywood Office

BigYellowDogFX

Thanks for the excellent and easy to follow advice.  I have tried to follow everything to the letter.  Unfortunately, I am still having no luck getting the show to run from the uSD card (works fine with the Prop-plug and PC)

Here is where I am at:

I have exported the file from Vixen to the uSD card and named it vixen00.bin

The audio is on the SD card for the AP-16+ and is named sfx00.wav (the AP-16+ sound file works fine.  It plays the ambient file until it gets the trigger from me and then it plays the show sound.  I ran this as a test of the sound files, AP-16+ and my home made trigger.)

Connected the AP-16+ and the HC-8+ as delineated above and set the switches accordingly.

Should the BR switch for the HC-8+ be on or off?  I have it on currently, but have tried to run it both ways to no avail.

I have created my own trigger switch to connect to the IN0 header of the HC-8+ to test the show.  I've tried it on the AP-16+ and it works fine so I know the switch is good.  (It's just two strand wire with one end twisted together.  I touch the separate ends to the "W" and "R" outputs on the IN0 in place of a PIR, etc.)

I've attached the sample show in case someone wants to take a look and see if that's where the problem lies.  Right now it doesn't do much.  I've denoted my channels and it plays the audio track and tells the servos to make the skull look around for about 30 seconds or so.

Thanks again!

PS had to change the extension on the posted vixen00 file to .vix as the forum wouldn't allow me to post a .bin

JonnyMac

Forgive me, I write and post a lot of code, especially during the summer and early fall months. What program are you using to run the show data from the HC-8+ using the uSD card?
Jon McPhalen
EFX-TEK Hollywood Office

BigYellowDogFX

Very poignant question.  I think we may have just found the rub so to speak.  The files I downloaded onto the HC-8+ eeprom were (mostly) from the "Keen Show" thread.  I can't figure out how to peer into the eeprom of my HC-8+ but as far as I recall I downloaded the following into the eeprom:  efx_pwm8, FullDuplexSerial64 and hc-8+_keen_vixen_streamer.  I may have also loaded efx_servo8.spin and hc-8+_vixen_streamer.spin and hc-8_v100.eeprom.  I honestly don't recall.  But, after looking at it all I don't see anything that would be a player program on the HC-8+.  I assumed, incorrectly apparently, that the streamer was synonymous with the player.

Is there a "generic" vixen player that I can load onto the HC-8+ or do they all have to be custom coded?  I apologize if it has already been posted.  I have searched the forum for it but can't seem to find it.

bsnut

QuoteThe files I downloaded onto the HC-8+ eeprom were (mostly) from the "Keen Show" thread.  I can't figure out how to peer into the eeprom of my HC-8+ but as far as I recall I downloaded the following into the eeprom:  efx_pwm8, FullDuplexSerial64 and hc-8+_keen_vixen_streamer.  I may have also loaded efx_servo8.spin and hc-8+_vixen_streamer.spin and hc-8_v100.eeprom.
One thing that you can't do is peer or look into the eeprom of the HC-8. once it's load that's it. But, the Propeller Tool (the editor) shows what as been download when it compiles.

These following objects below
Quoteefx_pwm8, FullDuplexSerial64 and hc-8+_keen_vixen_streamer.  I may have also loaded efx_servo8.spin and hc-8+_vixen_streamer.spin and hc-8_v100.eeprom.
are used to do different things, since each are drivers used to make up the application for the vixen player and here's what each do.

1) efx_pwm8 = pulse with modulation driver which is for servos or dimming lights that are connected to the outputs.
2) FullDuplexSerial64 = driver for handling the comms to and from the Propeller chip and also used for the RS485 chip that is on the HC-8 board itself.
3) hc-8_v100.eeprom = driver for moving and storing data to the eeprom on the HC-8 board.

One thing to remember is that Objects are groups of methods that make up the driver that is used in your application to make at do what you want it to do.

QuoteIs there a "generic" vixen player that I can load onto the HC-8+ or do they all have to be custom coded?
Also take a look at this thread http://www.efx-tek.com/php/smf/index.php?topic=1910.0 if you haven't already done so, which should help you a little bit and will give you some idea how it works on the HC-8. It is a basic 16 channel Vixen player that would play what you did in Vixen.

Some of the code from the vixen player and the some methods for the AP-16+ are added in, would be used to make your project work the you want to, since everybody's Else's are different from yours 
William Stefan
The Basic Stamp Nut

BigYellowDogFX

Thanks for the explanation on the various driver files.  It makes a lot more sense to me now that I know what is what.

Quote
Also take a look at this thread http://www.efx-tek.com/php/smf/index.php?topic=1910.0 if you haven't already done so, which should help you a little bit and will give you some idea how it works on the HC-8. It is a basic 16 channel Vixen player that would play what you did in Vixen.

Some of the code from the vixen player and the some methods for the AP-16+ are added in, would be used to make your project work the you want to, since everybody's Else's are different from yours 


I read this post (and a few others) several times and the only thing I could see that looked like a Vixen player that you could download to the EEPROM was this: hc-8+_vixen+dmx_demo.spin (which was contained inside this link:  http://www.efx-tek.com/php/smf/index.php?action=dlattach;topic=1910.0;attach=744 ).  So, I downloaded it into the HC-8+ EEPROM.  When I unplugged the prop plug, plugged in the uSD card and triggered IN0, nothing. 

I know I'm doing something wrong, or missing something obvious, I just can't figure out what it is.  I can stream my Vixen show from the PC to the HC-8+ through the Prop plug and it works like a charm.  However, I am having no luck with trying to play it from a uSD card loaded onto the HC-8+.

Does anyone have any thoughts?

JackMan

I could be wrong because I'm not really up to snuff on SPIN but I think the program that gets downloaded to your HC-8+ has to be taylored to exactly what you are doing. Jon would probably be the one to get you on track.

bsnut

The idea with pointing you to that post was to give you some idea how the code is laid out, not something that will be used in your project.

The way that program works is, it takes the Vixen serial stream that is playing on your computer and plays it on your HC-8+ up to 64 channels (outputs), which comes to 8 HC-8+'s. This means that the Prop Plug needs to be plugged in in order for this to work, after you have downloaded the program into eeprom.

Now, back to the topic at hand your project. It will be coded similar to the one done for Jackman but, we won't be serially communicating with servo controllers. We will be communicating with the AP-16+ instead.

I will try to come up with a program for you later on this weekend.
William Stefan
The Basic Stamp Nut

JonnyMac

Sorry, gang, I've been hammered busy with EFX-TEK projects this week.  I'll try to get some updated code posted on Sunday (I'll be at a Parallax Propeller event tomorrow and Saturday).

My strategy for keeping code simple has been:

1) Build the show with a "streamer" program. I have a couple variations that work, though I haven't released any of the improvements I made since posting code last year. My streamer takes live data from Vixen (though the HC-8+ programming port) and plays it. There is a constant in the program called SERVOS that you must set so that the streamer knows how to manipulate the outputs. For example, if you set SERVOS to 4 then TTL outputs 0-3 will be servos, and OUTs 4-7 (TTL and terminal blocks) will be PWM signals can be used for lighting control or straigh on/off signals (you just 0% or 100% in your show data).

Once you're happy with a show...

2) Load the "player" program into the HC-8+. You will, of course, have exported the show data, put it into a microSD card, and connect that using the uSD adapter to the HC-8+. Like the streamer, there is a SERVOS setting in the player that must match your data. The player program supports direct access to shows (0..7) or random access to up to 16 (0..15) shows.
Jon McPhalen
EFX-TEK Hollywood Office