Note: These questions and answers are taken
from the online Vex Labs forum and are duplicated here to save
you the
trouble
of
scrolling through multiple messages. Systronix is not responsible for
any errors or inaccuracies.
RX1 and RX2 are inputs to the Master processor and can not be changed.
There are 2 Serial Ports on the User processor. One is connected to the
Serial Port and the other one is connected to the RX and TX on the Analog/Digital
connector. Both these Serial Ports are TTL levels and not RS232. Do not
connect RS232 devices to these Serial Ports without level converters
or damage may occur. There is no I2C bus available.
Q: i was wondering how the signals are encoded from the rx module? is
it a pattern of 0-2 ms pulses in 16-20 ms. if this is true is 1 ms centerd
0 ms full reverce 2 ms full forword? if i hope i can write a computer
program to control a vex through my computers serial port.
A: The pulse width from the RF Receiver is 0.870 – 2.15ms and has
a period of 18ms. This signal will be decoded by the Vex Micro Controller
to a value from 0 – 255. The control signals are TTL levels where
as your computers serial port is at 232 levels. You can damage the Vex
Micro Controller if you do not do a level conversion.
Q: i assume that since you are using timer0 only to sync pwm generation
to avoid conflicts with spi interrupts, that you are using timing loops
to generate the pwm outputs. does this mean that for 1-2ms out of every
18 the controller is busy doing nothing but counting cycles and switching
motor outputs? the reason this concerns me is that i've got ahold of
an analog devices gyro and an accelerometer and would like to attempt
to put together a self-balancing robot. seems to me that i might not
be able to do this if i can't sample the sensors while waiting for pwm
generation. i'll probably need to run hardware pwm at a much higher frequency
than 50Hz through an h-bridge and either get a couple of gearmotors or
gut a couple of yours. which leads me to a question about the motors
in the kit. are they not essentially hobby servos with the stops removed
and the positioning feedback disconnected? if i wanted a plain vanilla
gearmotor that would mount to the kit could i buy a spare and remove
whatever electronics might be inside. maybe tuck a little board with
an l293d or similar into it.
A: All PWMs get generated in one call to generate_pwms which takes 2ms.
This is done every 18ms. If you can handle a 55Hz rate then allow the
master to generate them for you and you will have plenty of time to sample
sensors. A fellow from Deka has already built a balancing robot using
the Vex controller so we know that it is possible.
As for the motors, they are basically a servo motor that has been modified.
They work form a standard R/C PWM signal. That signal is decoded by a
micro-controller. You must be able to decode that same signal and then
control the motor.
Q: wondering if the motors run off of a 50hz pwm with a 1-2 ms duty
cycle like hobby servos.
A: The period on the PWM Outputs is 18ms or about 55Hz with a 1-2 ms
pulse width. The nominal dead band varies from 1.47ms – 1.55ms
but over all temperature and voltage ranges could vary from 1.36ms – 1.68ms.
The operating range of the Vex Controller is 5.5 – 9.0 Volts which
will be applied to the + Power PWM Outputs. The + Power PWM Outputs can
source up to 4 Amps. The PWM Control signal High is about 4 Volts @ 1mA
and for a Low is about 0.6 Volts @ 1 mA.
Q: i'm still trying to dope out what i've got to work with. it seems
that you guys have hijacked the high priority interrupts. i'm guessing
that you use them to catch the spi transmissions from the master controller
and to generate pwm outputs for the motors. i figure you have to be using
one of the timers for pwm as well. timer0? so is there anyway to hook
into the high priority interrupts? maybe steal back whatever timer you're
using and run a whole mess of servos off of the a/d ports -- oops, found
the bit about getting timer0 back in the readme, but am not sure what
functionality i lose. presumably all of the motors.
A: You are correct. The SPI interrupt is the only High priority interrupt
and all the other interrupts are defined as Low priority. These settings
can not be changed. When the Timer 0 flag is set, it tells you that the
SPI data transfer between the Master and the User processors is about
to take place.
Use the vex_library for Timer 0 to work this way. Use the alltimers_library
to have access to all Timers. The only functionality you lose by doing
this is that the User processor (your code) simply will not know when
the SPI data transfer is about to take place
Q: I've read on the CD Forum that the PIC in the Vex Micro Controller
is the same PIC that is used in the FRC RC. If that is true, do the analog
inputs have 10bit resolution as well, or just 8? It will make a difference
when I start programming.
A: You are correct. Both Controllers use the PIC18F8520 and have 10 bit
A/D resolution.
Sprockets and Chains are Fully Compatible with each other and the Mini
Robot Kits from IFI Robotics. They can be used with the Radio Shack Vex
Robotics Kit since the drive shafts are the same -- Vex Sprockets must
use Vex Chain and our Sprockets must use our Chain.
|