May 18, 2024, 04:41:17 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.


Question about HC-8+ and Running show from SD card.

Started by youngti, September 21, 2012, 12:48:58 PM

Previous topic - Next topic

youngti

I am planning to work on the Cauldron skeleton.  Got everything gathered and the boards in the incloser.  What I want the prop to do is at power on the skeleton will be muttering a chant (Double, Double toil and trouble.....) and moving it's head a little.  The when activated by the PIR the head will look up and to the right, say a phrase, look center and say something else, then look left, again say something.  Then look front and laugh.  Once that is done it will look back down and start muttering again.

So I see it in two parts.  Part one is what I will call Ambient (the muttering) and part two is Active.  I have an HC-8+ and a AP-16+, the Skull has 4 servos and two LED eyes.  I have the VEX transmitter so I was going to try and program the head and jaw movements with the speaking parts. 

My questions are these;
would the two shows (ambient and active) be separate data sets on the SD?
I have read how to hook up the VEX to the HC-8+ so I had planned to program the HC-8+ with hc-8+_vex_recorder.spin code and the hook the servos to TTL-0 to 3 and audio board to OUT7.  And connect the VEX cable to the Serial Header. Then do the record on the VEX.  Is this correct?
By hooking the AP-16+ to out 7 this should power the AP, correct?  (looks like it from the code)
When I start to record the servo movements it looks like from the code that it will start the sound board as well.  But if I want to use two different WAV files I can't see in the code how to specify that.  Or would I need to do to separate recording sessions, changing the WAV file?

Still trying to wrap my head around the spin, so then next task is to look into how I can call the data sets from spin and run the show.

JonnyMac

This is a bit tricky but with some code we should be able to pull it of. What we'll have to create is a "background" sensor monitor so that the idle show can be interrupted. The background sensor monitor will set a global value that tells the idle show to stop. Then we can load and run the other show.

For recording purposes you can use the P7 output to the 12-24v input of the AP-16+ (select the file with the SELECT switch).

In the actual application I think we should connect the AP-16+ via the serial header; this simplifies playing the independent files in the show.
Jon McPhalen
EFX-TEK Hollywood Office

youngti

Okay, as always thank you for your help.  As I understand what you are saying. when recording I will name the files SFX00 and SFX01, have both of them on the SD card and use the selector switch to choose each one and record the servos.  Right?

JonnyMac

Jon McPhalen
EFX-TEK Hollywood Office

youngti

Quote from: JonnyMac on September 21, 2012, 03:23:09 PM
This is a bit tricky but with some code we should be able to pull it of. What we'll have to create is a "background" sensor monitor so that the idle show can be interrupted. The background sensor monitor will set a global value that tells the idle show to stop. Then we can load and run the other show.

Sounds like I will need to run each show in a separate cog with a if then loop to check if the PIR has been triggered.  Or maybe a beam break because the PIR may trigger too often and not when somebody id there.

JonnyMac

I don't think so. In "idle" mode show 0 will run in a loop until a trigger is detected which will cause it break out and play show 1. When show 1 finishes we go back to playing show 0 in a loop. The trigger monitor will in fact run in its own cog, and that cog can support a timer, too, so that show 0 runs for a minimum amount of time before allowing show 1 to run.
Jon McPhalen
EFX-TEK Hollywood Office

youngti

Okay I hooked everything up, using a 18Vdc 2.7A power supply.  I have the HC-8+ hooked to the AP-16+ at Out7 on one side of the 12-14v input, have the V+ on the HC-8+ hooked to the other side of the 12-14v input.  I have my servos hooked up to the 0-3 TTL inputs and I have the VEX cord hooked to the serial on the HC-8+ and finally i have switches 1,2,4,8 on for 180 degree operation.  When I turn everything on the HC-8+ and VEX work for a few seconds, i can start to move the servos, but then the servos act like they pulsing and I can't control anything from the VEX. The LED on the HC-8+ is also pulsing green and the Out's 0-3 red led's are also pulsing.

JonnyMac

What kind of uSD card to you have plugged in? I found that crappy uSD cards hung up and caused the program to behave badly.

Do not worry about the lights on OUT0..OUT3 -- what you're seeing is the servo pulses (the TTL outputs are routed the the high current outputs).
Jon McPhalen
EFX-TEK Hollywood Office

youngti


youngti


JackMan

QuoteI have the HC-8+ hooked to the AP-16+ at Out7 on one side of the 12-14v input, have the V+ on the HC-8+ hooked to the other side of the 12-14v input.

You should have the AP-16+ voltage trigger connected to OUT7 and GND of OUT7, not V+. The outputs of the HC-8+ are positive voltage, not negative like the Prop-1, Prop-2. Not sure if this is causing your "quits working" problem.

JonnyMac

I'm wondering if the servo load is too much for the board; we have a fairly stout power supply but servos under heavy load can draw a lot of current.  Can you try it with just a couple servos connected to see if it will run that way?

Jack is right about the HC-8+ outputs: they are high-side drivers. Just connect between OUT7 and the GND terminal below it and the 12-24v block on the AP-16+.
Jon McPhalen
EFX-TEK Hollywood Office

youngti

Okay so i tested with just one and yeah it works, add another one and depending on which one it will work.  It is a heavy skull and I thought i had planned for that by using a heavy duty hiTec 645MG servo for the up and down "nod" movement.  That one put the HC-8+ in the weird mode described above.  I am using a 18V 2.5A power supply.  I have a old laptop adapter that is 65W with an out put of 20V @ 3.25A.  Would this work for the HC-8+?  In the docs is says 9 to 24V, but I am concerned about how much Amps it can take.

JonnyMac

September 23, 2012, 01:47:22 PM #13 Last Edit: September 23, 2012, 01:50:51 PM by JonnyMac
Okay, the problem is not the power supply. What's happening is that the servo load, under certain moves, is exceeding the capacity of the 5v power supply and causing it to reset, this causes problems for the processor.

We knew this could be an issue and designed the board to accommodate it -- if you're willing to get your hands a bit dirty. Look at the bottom side of the board. In the lower-right corner (again, you're looking at the back) you'll see a fat trace that goes to the servo headers and a point that is marked "CUT."  You can cut this trace (I use s Dremel tool with a small, round engraving bit); this isolates the servo header from the board's 5v system. Now flip the board back over. Just below the DMX address switch you will see two pads marked - and +; these are for an external supply for the servos. Connect a very stout, 6 to 7.2V power supply to these pads and you should be set.

As ever, I am reminded about a phrase used by the Dallas Personal Robotics Group when we want to do advanced projects like this: It's harder than it looks!
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

It probably goes without saying but you MUST ensure that you have a very clean cut before connecting an external power supply to the baord; you do not want to mix supplies that could be at different potentials.
Jon McPhalen
EFX-TEK Hollywood Office