May 18, 2024, 03:38:44 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


VEX Transmitter to HC-8+

Started by JonnyMac, August 26, 2012, 04:44:58 PM

Previous topic - Next topic

JonnyMac

August 26, 2012, 04:44:58 PM Last Edit: August 26, 2012, 07:04:51 PM by JonnyMac
A few years ago a bunch of us took advantage of a great deal by All Electronics on VEX transmitter units. I wrote a white-paper on decoding the output with a micro (I used the SX at the time) and they actually gave me mine (I'm a regular customer).

As the SX is kaput the HC-8+ becomes a logical choice for using the VEX for live puppet control or recording servo moves.  First things first.  I had written a VEX input object some time ago; today I did a bit of clean-up and created a demo using the HC-8+.  The program simply intercepts and displays the values generated by the VEX transmitter. 

Some project will have a mix of 90-degree and 180-degree servos. The DMX switch is used to tell the program what type of servo is connected to each channel.  The #1 switch corresponds to Ch1 from the VEX; the #32 switch corresponds to Ch6 from the VEX.  The switch is only read on reset.  If a switch is on the 90-degree input (1000 to 2000us) from the VEX is scaled to a 180-degree output (600 to 2400us)

Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

August 26, 2012, 07:26:09 PM #1 Last Edit: August 26, 2012, 07:34:34 PM by JonnyMac
Here's an update to the reader program that drives servos.  Have a look at both and you can see how the modularity of Spin makes building complex programs much easier than with the Prop-2 or Prop-SX.

The program will control four servos (using the VEX joysticks) and two digital outputs (OUT6 and OUT7) using the Ch5 and Ch6 buttons on the back of the VEX transmitter.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

Well, darn. I have spent a good portion of the day working on a VEX to uSD recorder and sort of got it working. Then I ran into the real problem with uSDs: they're not very fast when it comes to writing. No matter what I did I could not get the program to run for more than about 30 seconds before the uSD would barf.

Maybe tomorrow something will come to mind. Time to settle in for some Dr. Who....
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

"The Doctor" does it every time. While relaxing it occurred to me that I may have a junk uSD card in the socket.  I did.  I swapped it out for a decent card that was freshly formatted FAT32 and I was able to record a five-minute show using 20ms frame rate.  I'm going to polish the program and wait for an importer from K.C., but for those wanting to live programming with VEX joysticks, upload to Vixen for fix-ups, we're getting very close.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

You are talking my language.   Anyone out there with a 3-axis skull.   THIS IS FOR YOU!

JonnyMac

August 29, 2012, 05:41:11 PM #5 Last Edit: August 29, 2012, 06:32:25 PM by JonnyMac
Here's the latest version of the VEX recorder. This one will auto-update the file number so you can capture multiple "takes" and decide in Vixen which is best.

You'll need a cable to connect between the VEX tether port and the HC-8+.  This is easily made by cutting a 14" extension cable and telephone handset replacement cord in half, then connecting as shown in this diagram (not to scale).



Remember to use a decent quality, speed-rated uSD card, and to let the program finish (back to solid green LED) after you stop.

Controls:
  - VEX Ch6 UP starts recording (flashing green LED)
  - VEX Ch6 DN stops recording (wait for solid green before doing anything)
  - TTL headers 0 - 3 correspond to Ch1 - Ch4 (VEX joysticks)
    * connect servos here (note WRB markings on board)

The lower four bits of the DMX address switch can be used to set the servo type: 90- or 180-degrees.

If no uSD card is detected there will be a red error flash; one short flash every second.

If no VEX signal is detected there will be a red error flash; two short flashes every second.

There are lots of useful notes in the code; please have a read before running.
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

Geez Jon, you are fantastic! (sly doctor who reference)
Shawn
Scaring someone with a prop you built -- priceless!

JackMan

I have several Futaba 6 channel transmitters for R/C airplanes that have a rear connection port and a 4-wire phone cord adapter for simulator use. I'm wondering if these would work the same as a VEX transmitter?

JonnyMac

I think the Futaba signal is driven high at about 2.5v so we would need to have an inverter circuit and then I would have to write an object for its timing.  The inverter is just a two resistors and a transistor; all very common parts. 
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

What size/brand/type of MicroSD card to you recomend buying for storing show data? 

JonnyMac

I would suggest a 4G, Class 2 or higher.  I tried the record program with a 512M unrated card and the program -- due to poor performance of the card -- hung up.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

QuoteI think the Futaba signal is driven high at about 2.5v so we would need to have an inverter circuit and then I would have to write an object for its timing.  The inverter is just a two resistors and a transistor; all very common parts.

I'm not planning on using this right now, just curious if it would work.  ;)

davisgraveyard

OK...got my HC-8+ today with my microSD adaptor. 

Here's what I've done so far.

Downloaded your code and loaded it into Propeller tool 3.1
Set DMX switches 1,24,8 ON (I have 180degree servos)
Plug the Propeller USB programmer into the PGM pins
Plug the Micro SD board to the options pins above the 4 position switch so it covers the switch. 
Inserted a formated 4GB MicroSD card
Connect 12VDC power set power switch to 1.
I pulled up the hc-8+_vex_recorder.spin code and did RUN->Compile Current->Load EPROM  F11
This programmed the board
Now all I have to do is connect my servos to OUT0-3 and my audio board to OUT7.  And connect the VEX cable to the Serial Header. 


That sound about right?





JonnyMac

You got it. If you have some spare servos it would be a good idea to connect them to the TTL output headers first, just so you can verify that things are moving.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

Initial tests look good.  I had a skull plate with 4 servo's on it that I used to test with.  Had to grab a 1.5A 12VDC power supply.  The 300ma did NOT work. 

But I created a couple of show files with ease.  Pressing the chan 6 buttons to start and stop. 

Still need to hook it up to an audio card to see the audio start but I'm going to move it to my actual prop next and create the show from there.

I have to say OMG I can't believe how simple this is.   I can't wait to create a couple of versions and then load the player and see it work.   This is what I've always wanted to be able to do with my 3-axis skull. 

You know what this means don't you?   I am going to have to make more now!