November 23, 2024, 03:05:57 PM

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.


Beginner Prop SX owner

Started by davisgraveyard, May 14, 2008, 12:33:10 PM

Previous topic - Next topic

davisgraveyard

I unpackaged my Prop SX starter kit today.  I got everything connected and installled the software.  I was able to get several of the sample SX/B programs to run using the trainer board.    The programs are more complex than a Prop-2 but nothing  I can't eventually figure out. 

What I haven't been able to figure out is what are the 4 MHz, 20 MHz, and 50 MHz resonators needed for?   I was able to get programs running without them?   I see in the documentation that they are optional?   When would I need them and what would determine which one to use?

One of the most frustrating things for me when reading these posts is the assumption of controller technology blended with programming knowledge.    I started my programming carreer with CP/M BASIC but moved quickly to MS-DOS and then to Windows 3.1 Visual Basic all the way to VB.NET today.    I've spent the last 20+ years working on Intel Based PC's running some sort of Microsoft OS.  Putting it another way....I am not a Nuts & Volts subscriber I am a MSDN subscriber.     So I get the programming side of things but because I haven't had the experience with micro controllers where the programming is based on the hardware I have no reference.


JonnyMac

The good news is that you understand programming constructs... the bad news is that you're used to having nearly infinite resources (RAM) available to you -- that's the biggest hurdle I've found with experienced PC programmers moving to embedded applications.

On resonators: their purpose is to control the speed of the processor.  Why would you want to do this?  Well, in non-critical apps that don't have sensitive timing you wouldn't have to, the internal oscillator works just fine.  But as soon as timing becomes important, if you want to do serial communications for example, then a resonator becomes a requirement.  The speed you select will depend on the program.  I tend to default to 50 MHz because it gives me the greatest bandwidth -- but it also causes the SX to consume more current.  So, if you were using the Prop-SX in a battery-based app you'd select a resonator that gives you the bandwidth you need; slower speed means less current consumed.

If you're not doing any interrupts then the 4 MHz resonator will work most of the time.  If you're doing interrupts you may want to bump up to the 20 MHz, or the 50 if you're doing a lot of work (or very high-speed things like DMX).  The SX/B compiler handles the details for you -- you just have to set the correct FREQ directive.

It will take a little time getting used to, but once you do you'll have a lot of fun, especially when you start taking advantage of "virtual peripherals" (interrupt-based code that runs in "the background" -- things like servo drivers and UARTs).
Jon McPhalen
EFX-TEK Hollywood Office


davisgraveyard

Well, I am probably going to use the SX to contol the 4 servos of a talking skull.   I was planning on using a 12V DC 200 ma Power supply.    So should i pop in the 50hz resonator?   

What I want to be able to do is use a RC transmitter with 2 joysticks (or just 2 PC joysticks?)  to animate the head and track the changes and duration to a data file.  Then I could use a data reader program on the SX to read eprom data and play back the movements. 

My setup is something like this

SERVO1 - Head tilt
SERVO2 - Head nod
SERVO3 - Head turn
SERVO4 - Jaw

These are only separate so I can use different timing for them.
LED1  - Red LED eyes (fade on at startup, off at end) - Someday this will be  5/6th servos to work eyeballs.
LED2  - Multiple LED's used to light face (fades up before show and down at end)

The Joysticks would be mapped like this.

Joystick1 - X axis =  SERVO2  Y axis = SERVO1
Joystick2 - X axis = SERVO4  Y axis = SERVO3

I can probably write the PC code to take input from the joysticks and send it out RS-232 to the Prop SX?  I could write a Prop SX program that moves servos based on serial input.   I can save the data of the session in the PC program.  Then I could use (I believe you have something written)  a program for the SX that reads eprom data (that I create from the PC program) to move the servos.    That shoudl do it right?

Jeff



JonnyMac

One easy way to read two joysticks is by using the VEX transmitter ($30 from All Electronics).  It has an RJ-11 jack on the back and with a bit of simple construction you could make a cable that connects to the Prop-SX, reads the data, then transmits it to your PC through the DB-9 connector.  It won't be an easy program, but it can be done.  If you want to go this route I'll write the code for you.  I think this is the simplest way to get joystick data into the Prop-SX; using old analog joysticks is an issue because of their design, and I reference that in my "Where's Waldo?" project from last year.
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

I'm trying to understand the way the Vex transmitter/receiver solution is connected.

In this case the servos are attached to the Prop SX.   Does the reciever attach to the Prop SX?  I assume the transmitter is stand alone and will control the servos through a translation program that you can write that detects the reciever signals and moves the servos?   Then you provide data feedback through the serial port of the Prop SX to the PC?   The PC has an application that captures the serial data?

The cable that has to be made connects from the RJ-11 on the receiver?   I have read the doc at http://www.allelectronics.com/cgi-bin/item/JS-6/search/6-CHANNEL_TRANSMITTER_AND_RECEIVER_.html but schematics never really help me visualize all the connections. 

I just got a Nuts & Volts issue in the mail the other day.  And your VEX article in it did help a bit with your picture?   I have a buddy that works at Intel and volunteers as a coordinator for the Logos and Vex robotics competitions.  He has a few spare Transmitters/Receivers laying around so I am borrowing one from him.    Then what?


JonnyMac

The Vex transmitter has an RJ-11 output on the back that outputs the same active-low signal as the VEX receiver; this means you can connect it (with ground) to a pulled-up input on the Prop-SX for monitoring. 

I envision a program that would have a background servo controller and UART.  The foreground program would analyze the VEX PPM stream, set the values in the servo control registers so that the servos are updated and then blast out five bytes to the PC through the serial port.  The first byte (0xFF) would be used by the PC app as a header understanding that the next four bytes are servo channels.  These could be spit out with every servo frame (20 ms) but that could end up being a lot of data for your PC app. 

I'll start with the VEX/Servo part first, then integrate the ability to send the new servo values to the PC next.  Once I build a cable that works I'll explain how (it's going to be a hacked telephone cable, you only need two connections).
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

OK I am having a heck of a time getting my brain wrapped around this servo control with a RC transmitter to create the data to allow the Prop SX to play a show.

The show playing part of the Prop SX seems pretty straight forward.   Load a program that can read eprom data and move servos and load it with the eprom data and you are good to go.   Seems simple enough.

So now we have to create the eprom data.  Your solutions compress the data only storing the changes over time which seems like a smart way to go.  With the SX we shouldn't run out of memory space for a 2-3 minute show?

So now how do we create the data?   Well given a specific sound track we are going to have to manually move the head (nod,tilt,turn, jaw) as the audio is playing real time to get an idea of what movements we want.  I currently am using a Futaba SkySport4 T4VF transmitter with a Futaba 8 channel reciever.    This allows me to move the head around quite nicely.    I already know the length of the show based on a MP3.  So my movements are just changes in position over that time.  Whether I capture the data analog or digital I just need to record what I moved, how much and at what time.   You mentioned previously that you didn't think the PC could accuratly capture PPM stream data from a buddy cable.   I have seen several solutions that provide this for simulators or custom robotics software.   Mostly a USB device that connects to the buddy output on the reciever.   It requires a driver that works with the USB device.  If you did nothing but a big data dump of your animation session you could then process the data into something that would work for for eprom data statements I would think?

As I sit here and read this and think about the Vex solution I am trying to see how that is much different from what I am wondering what can be done with a standard RC transmiter?  I know you keep talking about the amount of data in the stream but the movements aren't that rapid  and we are only talking about 4 servos for now.    I'll still see if the Vex solution works but I can't help feeling there must be an easier way?   Or maybe that is the easier way?


davisgraveyard

Ok a little more thinking while typing and then I will give it a rest.    I wonder if either on the SX side or the PC side we could do some sort of analysis of each packet of data and if the info is the same as the last one don't save or send?  If you do the compare on the SX side then the PC side just maintains a running clock when it starts capturing data and knows that not data means status quo?   If we do the compare on the PC side then we don't have to write packets that are the same?  Think of it like a zip compression or if you remember z-modem file transfers?

Just some thoughts?




tds234

I haven't gone too far down this route but I am going to end up the same place. I'm also an experienced programmer and have been using the SX as well as Prop-1's for various props. I'm not a micro-p expert like Jon, but I can hack out serial code and such on the PC side. I'm looking at a head tracking device that I bought to train a servo skull as well. A group of us in Chicago are building 3-axis skulls right now and working on how to train them.

I have two paths I'm pursuing:
1) a sensor enabled configuration that basically calculates random motion of the skull to point toward sensors that are tripped as it plays a monologue to the audience ( although I suspect it's going to end up looking a lot like Stevie Wonder) while the show is enabled.

2) a recorded show ( that may or may not utilize servoPals to save space and complexity) that I'm going to try and train with a head tracker and then download into the SX as a recorded piece. I know a lot of work has been down with VSA and VIXEN but I want to act it out to get the motion right and capture it real time.

Maybe we can pool our efforts to make this work. I respect what SkullTronix has done, but we are trying to duplicate 80-90% of that for 10% of the money ( although I assume a lot of effort). I'm more than willing to help make this work for a group to share the results....

Let me know and maybe we can have a periodic conference calls with interested parties to go with the online messages/emails and such to keep the tempo and information sharing going....

davisgraveyard

Sounds good to me.   I had forgot about the servoPals idea.  That does seem like a good way to go.  Keeps the code small.   They are so inexpensive that adding them to the solution for a 4-5 servo head seems to make sense?

I like the idea of a head tracker system I just didn't know how to go about making something?   I wonder if we could use some of the work people are doing witht the Wii?  I have seen some tracker solutions done with them?

Jeff


tds234

This is why we should talk. I bought a commercial one that runs like $99 ( I got it on sale) and am going to try and adapt it to my use with some code. It supposedly comes with an SDK to code towards on the PC. I have to get it hooked up and start experimenting around building my skulls, building my columns, building my mummy crypt, planning the show routines and lighting....I'm hoping that I can just sample the outputs in real time and write the positions out in a form that I can translate to servo positions, either on the fly or a later post processing routine. I think it gives something like polar coordinates so I'll have some math to do but it shouldn't be awful...

Send me some email to tds2 at scrimager dot com and maybe we can exchange cell numbers and talk about it all....

Doug

JonnyMac

Jeff,

As far as compression of the data I think that should happen on the PC end -- this will keep the Prop-SX side very simple and allow the PC to start picking off data any time it wants.

So... the idea is:
A) Connect a VEX transmitter to the Prop-SX (P15)
B) Control four (or six) servos using the VEX transmitter (P0..P3 [P5])
C) After each servo frame send a block of bytes to the PC via the DB-9:
    <sync><servo1><servo2><servo3><servo4><servo5><servo6>

The VEX transmitter actually has six channels, though channels 5 and 6 are limited to center, extreme CW, and extreme CCW positions only.

Does this work for you?

Jon
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

ServoPals make sense if using the Prop-1 or Prop-2, but with the Prop-SX you can get a built-in servo controller for free -- and customize it for as many servos as you like.

Quote from: davisgraveyard on May 14, 2008, 08:06:33 PM
Sounds good to me.   I had forgot about the servoPals idea.  That does seem like a good way to go.  Keeps the code small.   They are so inexpensive that adding them to the solution for a 4-5 servo head seems to make sense?
Jon McPhalen
EFX-TEK Hollywood Office

davisgraveyard

Sounds good.  I'll have the Vex transmitter this Sunday.   Could probably work on the PC software sometime next week.

Jeff


Quote from: JonnyMac on May 15, 2008, 10:41:17 AM
As far as compression of the data I think that should happen on the PC end -- this will keep the Prop-SX side very simple and allow the PC to start picking off data any time it wants.

So... the idea is:
A) Connect a VEX transmitter to the Prop-SX (P15)
B) Control four (or six) servos using the VEX transmitter (P0..P3 [P5])
C) After each servo frame send a block of bytes to the PC via the DB-9:
    <sync><servo1><servo2><servo3><servo4><servo5><servo6>

The VEX transmitter actually has six channels, though channels 5 and 6 are limited to center, extreme CW, and extreme CCW positions only.

Does this work for you?

Jon