Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   VEX inputs (http://www.chiefdelphi.com/forums/showthread.php?t=38419)

Andrew Blair 31-05-2005 21:05

VEX inputs
 
Forgive me if this is a repeat, but I can't find any info on the inputs on the VEX controller. I am mostly interested in analog and TTL inputs. If anyone should know of these wonderful little thingy's I would very much appreciate it! Thanks much!

Andrew Blair 04-06-2005 13:30

Re: VEX inputs
 
The reason I'm asking this is because I would like to interface a vex brain with a RFID tag reader.

foobert 04-06-2005 15:22

Re: VEX inputs
 
by inference from the data sheet for the microchip pic 18f8520, (http://ww1.microchip.com/downloads/e...oc/39609b.pdf), the sixteen analog/digital pins on the controller will be connected to ports D and E on the microcontroller as these are configurable as either analog inputs or as digital input or ouput pins. the six interrupt pins are probably connected to port B, which can be configured for hardware interrupts, though these pins might also be useable for digital i/o. no way to guess where the motor ports are connected except that they are probably not connected to ports B, D or E. all of this could be doped out with a little patience and an ohm meter, but i'm probably not the guy to do it and definitely not today.

i do know that two of the pins on the serial port are connected to pins rc6 and rc7 on port C, these being the transmit and receive pins on one of the 18f8520's uarts. i have verified this with a meter.

it may not be unreasonable to guess that the two pins labelled tx and rx are attached to pins rg1 and rg2 on port G, these being the transmit and receive pins of the other uart.

that's all i've got.

foobert 11-06-2005 02:28

Re: VEX inputs
 
mea culpa. mea maxima culpa. ok, i was wrong.

according to the file ifi_aliases.h in the vex starter code available at vexlabs.com the pins on the vex controller are connexted as follows.

Analog / Digital Section

pin 1 = ra0
pin 2 = ra1
pin 3 = ra2
pin 4 = ra3
pin 5 = ra5
pin 6 = rf0
pin 7 = rf1
pin 8 = rf2
pin 9 = rf3
pin 10 = rf4
pin 11 = rf5
pin 12 = rf6
pin 13 = rh4
pin 14 = rh5
pin 15 = rh6
pin 16 = rh7
rx = rg1
tx = rg2

Interrupt Section

pin 1 = rb2
pin 2 = rb3
pin 3 = rb4
pin 4 = rb5
pin 5 = rb6
pin 6 = rb7

Motors Section

pin 1 = re7
pin 2 = rg0
pin 3 = rg3
pin 4 = rg4
pin 5 = ?
pin 6 = ?
pin 7 = ?
pin 8 = ?

sorry, but there are no definitions for those last four.

any pin can be configured as a digital input or output. pins 1-16 in analog/digital section can be configured as analog inputs. the 6 pins of the interrupt section can be used as external interrupts for wheel encoders, bumpers, etc. the pins of the motors section are normally used to produce pwm outputs to control, you guessed it, motors.

John Wanninger 11-06-2005 22:43

Re: VEX inputs
 
Quote:

Originally Posted by foobert

any pin can be configured as a digital input or output. pins 1-16 in analog/digital section can be configured as analog inputs. the 6 pins of the interrupt section can be used as external interrupts for wheel encoders, bumpers, etc. the pins of the motors section are normally used to produce pwm outputs to control, you guessed it, motors.

Thanks for posting the info Foobert.

I was surprized and perhaps a bit disappointed to see that the Vex User Manual addendum preview for the upcoming Optical Encoder Sensor instructs "You’ll need to plug your shaft encoder into any port in the Analog/Digital bank on the Vex Microcontroller."

I'm hoping the sensors will be able to utilize interrupts. I wonder if the outside pins on the interrupt section pin out the same as the analog/digital section and that either section can be used with many of sensors. I'm guessing one pin is +5V; the other ground? I suppose this could be a question for the IFI engineers, although there my be an info 'blackout' for sensor info until they're officially released.

foobert 12-06-2005 00:57

Re: VEX inputs
 
white wire on the keyed end of the connector appears to be signal. middle pin on analog/digital and interrupt connectors is 5 volts and on the motor connectors it's the raw battery voltage. the pin on the unkeyed end of the connector is ground.

it doesn't appear that the folks at IF are eager to help with buggy interrupt code. there is a disclaimer to that effect in the function InterruptVectorLow in user_routines_fast.c. can't say i blame them.

davefowler 12-06-2005 16:26

Re: VEX inputs
 
Thanx for all your help. I have most the stuff to make a programming module now so I think I'm going to go that route. Someone mentioned that they bought one. Are they for sale now? Where can you get them? I can't find them.

billbo911 12-06-2005 17:22

Re: VEX inputs
 
Quote:

Originally Posted by davefowler
Thanx for all your help. I have most the stuff to make a programming module now so I think I'm going to go that route. Someone mentioned that they bought one. Are they for sale now? Where can you get them? I can't find them.

I purchased one through IFI. Contact them by e-mail at info@innovationfirst.com I have not received mine yet, it is still in route via. UPS, so I won't be able to give details on what is included until it arrives. It is my understanding that the ones from IFI are prototype units. So my guess is they may be a little different from what will be released by Radio Shack in August.

John Wanninger 12-06-2005 17:36

Re: VEX inputs
 
Quote:

Originally Posted by davefowler
Thanx for all your help. I have most the stuff to make a programming module now so I think I'm going to go that route. Someone mentioned that they bought one. Are they for sale now? Where can you get them? I can't find them.

Call Innovation First at 903.453.0800 and you'll be able to order one. The modules are bare board beta units (no housings) and cost about $99 + shipping. The MPLAB CBOT compiler (IDE + C18 C compiler for PIC18F8520) and two cables are included.

One possible caveat: By ordering now, we do not recieve EASYC, a proposed C code generator which may or may not be bundled with the upcoming Radio Shack programming module release (slated for August).

BradAMiller 13-06-2005 07:34

Re: VEX inputs
 
Quote:

Originally Posted by John Wanninger
Thanks for posting the info Foobert.

I was surprized and perhaps a bit disappointed to see that the Vex User Manual addendum preview for the upcoming Optical Encoder Sensor instructs "You’ll need to plug your shaft encoder into any port in the Analog/Digital bank on the Vex Microcontroller."

I'm hoping the sensors will be able to utilize interrupts. I wonder if the outside pins on the interrupt section pin out the same as the analog/digital section and that either section can be used with many of sensors.

That's a mistake in the manual. You will plug the encoders into the interrupt port when using them with EasyC (and could do the same if you write your own program). EasyC will give you the option to turn them on, off, read the value, and preset the count. I'm pretty sure they return 90 counts (pulses) per revolution.

Brad

Andrew 05-12-2005 22:04

Re: VEX inputs
 
Has anyone actually gotten some of the encoders? They've been listed on the vexlabs.com and the radioshack.com sites as being "sold out - coming soon" for the last couple of months.

Have they been released and sold out? Or, have they not yet been released?

Billfred 05-12-2005 22:07

Re: VEX inputs
 
Quote:

Originally Posted by Andrew
Has anyone actually gotten some of the encoders? They've been listed on the vexlabs.com and the radioshack.com sites as being "sold out - coming soon" for the last couple of months.

Have they been released and sold out? Or, have they not yet been released?

I've seen them just before Thanksgiving at the local Radio Shack.

Gdeaver 05-12-2005 22:19

Re: VEX inputs
 
Check the Radio shack website to find a local store with the encoders. I bought a set and am playing with them now. I must be doing something wrong or there is allot of latency in easy c. It drives straight with quite a wobble. These aren't greyhill quality or precision.

foobert 05-12-2005 22:34

Re: VEX inputs
 
i got a pair a month or more ago at the rat shack, took one apart and said to myself, "self. with a couple of photo interrupters appropriately placed you could convert this thing to a quadrature encoder", but since i can't find the switches i got some time ago from budget robotics they've been sitting in the parts pile ever since. reckon i should hook 'em up and see what i can do. i don't have easy c, though, having ordered a prototype programmer from ifi over the summer. i got those mean old early adopter blues.

ChrisH 06-12-2005 11:25

Re: VEX inputs
 
Quote:

Originally Posted by Gdeaver
Check the Radio shack website to find a local store with the encoders. I bought a set and am playing with them now. I must be doing something wrong or there is allot of latency in easy c. It drives straight with quite a wobble. These aren't greyhill quality or precision.

I bought a set about a month ago. Quadrature would be a real nice addition, but I'm not sure how to go about that. I didn't have any trouble getting it to drive straight if I was just measuring distance. My Squarebot could repeatedly drive a path including straights and turns with reasonable precision as long as the surface remained the same. Move to a different surface and the turn angles changed. Not an unexpected result.

I have recently started working on velocity contol. I have a Proportional algorithm working on one side. It does oscillate a little when running free. Again this is not unexpected, in fact I would have been more amazed if it didn't happen as it is characteristic of this sort of control. PID's always oscillate, the question is whether or not the magnitude is acceptable. Gdeaver were you counting clicks or controling speed?

I haven't added the second side to see if it drives straight yet. Maybe in a few days. I've been too busy with going to FLL at Legoland and setting up next weekend's tournament at CSUN.

Has anybody done anything with Potentiometers?

Francis-134 06-12-2005 14:56

Re: VEX inputs
 
I friend of mine got his hands on some encoders a few weeks ago and make a rather impressive line following program in easyC. They aren't bad, but they are just so honking huge, its hard to put them in without designing your robot around them.

Gdeaver 06-12-2005 21:10

Re: VEX inputs
 
I have the square bot driving straight. One problem I seamed to encounter is that the easy c function to read the encoder count takes a fairly long time to execute. At near full speed there are a few counts occurring between the reads. To compensate I toggle the order of the reads . I'm not using PID, just increasing or decreasing the PWM by 1 each time through the loop.

Andrew Schreiber 19-05-2006 12:05

Re: VEX inputs
 
I am attempting to play with pots but for some reason the pot reads a constant value even when it isnt plugged it. Im going to play with it today during class and ill post a result here before i leave today.

I am just trying to show a proof of concept and this will by no means be a finished product.

Also does anyone know if I could run the grayhill op encoders on a vex robot?? I am doing this to prove out concepts for our first team next year.

skimoose 20-05-2006 10:34

Re: VEX inputs
 
Quote:

Originally Posted by Damien1247
I am attempting to play with pots but for some reason the pot reads a constant value even when it isnt plugged it. Im going to play with it today during class and ill post a result here before i leave today.

If you're getting a constant value even when the pot isn't "plugged in", you're reading the value across the coil. The analog value should be taken, and read across one side of the coil and the wiper terminal. The pot should be wired to the vex controller like this:

pot coil
+5V ____/\/\/\/\/\/\/\______ GND
|
wiper
|
SIGNAL

The pot coil leads are almost always the outside two terminals and should always read 100K ohms, or 5 volts if energized, across them. The wiper terminal is almost always the center terminal. If you measure resistance across the +5V and Signal the value will change as the pot is turned. If the pot is energized, you should be measuring a variable voltage across +5V and Signal. If you are wired correctly, and you are not getting the correct values, then the pot is failed, or you're not using a 100K pot. Correct wiring is +5V red PWM wire, signal white PWM wire, and GND black PWM wire. as the cable comes off the Vex controller's analog input.

Hope this helps. :)

gblake 30-05-2006 23:11

Re: VEX inputs
 
ChrisH & GDeaver,

I would appreciate seeing your control algorithms/equations or your code that uses shaft encoders to supply feedback for controlling your Vex bots paths.

I am dabbling with the same thing right now and mine is both wobbly and biased.

Right now I attempting to have both sides maintain 50_tick / 100_msec speeds and I am using 5:1 gearing to make the the encoder count 450 ticks for each revolution of the drive motor.

Because I am think I am getting different response characteristics from my motor(s) when I compare driving them CW vs driving them CCW (see below), I think I am ultimately up against writing some semi-complicated trig equations/approximations. Maybe I am thinking too hard...

I am adjusting the bot's speed by just incrementing/decrementing the EasyC command sent to each motor depending on whether that motor's encoder counted more or less than 50 ticks during a 100 msec EasyC "wait"; and depending on whether that motor is already slower or faster than the other motor.

The slow reads of the encoders Gdeaver hypothesized could be one problem I face.

Another problem might be that (contrary to what I read on in the VexLAbs fora) the motors react differently to commands that are identical except for direction (i.e. sending 127+70 produces a different RPM magnitude from a motor than sending 127-70). That means that starting my left and right motors at values that will produce (nearly) identical RPMs is a matter of holding your tongue in the right place; and furthermore, that incrementing the input to the CW one will produce a different change in output (for that one) than does decrementing the input to the otherwise symmetrical CCW motor on the other side of the bot.

I admit, the assertions in the paragraph above are generalizations from measurements I took on ONE motor while the bot was up on blocks.

I graphed the motor transfer function results (encoder ticks over ten consecutive 100 msec intervals) vs input value) in Excel if anyone wants to compare my results with any other measurements.

Does anyone else have any motor measurements to share? In addition to wanting to combine the fun of implementing my own ideas with not re-inventing too many wheels (see request above for sample algorithms), I am curious if I got unlucky with the one motor I measured; or if there is a pattern we should measure carefully and report in an appropriate FVC thread.

Blake
PS: Should we transfer this discussion to the Vex Shaft Encoder Kit thread???

Andrew Schreiber 31-05-2006 11:45

Re: VEX inputs
 
I would post them but i have been unable to write the code so it registered the encoders. Also, you seemed to be using easyC and i am using MPLAB. Using the sensor test code provided by vexlabs i was unable to make the encoders work. I put his down to the fact that i was attempting to use a grayhill op encoder. I am currently lookin into purchasing a pair of encoders from vex.

gblake 31-05-2006 13:25

Re: VEX inputs
 
Quote:

Originally Posted by Damien1247
I would post them but i have been unable to write the code so it registered the encoders. Also, you seemed to be using easyC and i am using MPLAB. Using the sensor test code provided by vexlabs i was unable to make the encoders work. I put his down to the fact that i was attempting to use a grayhill op encoder. I am currently lookin into purchasing a pair of encoders from vex.

Damien,

The algorithm should be fairly independent of the encoder used (especially for straight-line motion). I am still interested....

Blake
PS: Private email works for me, if you want to avoid a public posting of incomplete results.

Andrew Schreiber 31-05-2006 18:17

Re: VEX inputs
 
Oh no. im always a fan of posting work, complete or incomplete. The problem is i dont have any writen. I was doing proof of concept for a class. nothing that would be usable, just to make sure it could be done.

Though to make the 'bot drive in a straight line id think youd need two encoders. each time either of them is triggered you would add one to that wheel's count. Now, to make sure that it ran in a straight line i would use a timer to determine the rate at which you are calling interupts (dont ask me how to but i have a hunch it is in the pic18 ref manual ill look into it more after i finish my report on spam)

If i get time i will most definetly write up some code. I cant garuntee it will work or will be correct but i recall we wrote something using the hall effect sensors for the FRC game this year. I will look into it and ill keep in touch with you. .


All times are GMT -5. The time now is 02:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi