View Single Post
  #11   Spotlight this post!  
Unread 07-07-2007, 20:38
gblake's Avatar
gblake gblake is offline
6th Gear Developer; Mentor
AKA: Blake Ross
no team (6th Gear)
Team Role: Mentor
 
Join Date: May 2006
Rookie Year: 2006
Location: Virginia
Posts: 1,934
gblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond reputegblake has a reputation beyond repute
Re: Vex Programming Question

Quote:
Originally Posted by ManicMechanic View Post
Has anyone investigated further what conditions require the transmitter to be turned on for "autonomous" programming, and is it possible to run any programs without the transmitter at all?
I think that my problems stemmed from the early Vex EasyC versions undocumented behaviors that I describe below. I am working from somewhat old memory here, so I might get something wrong; but hopefully not. If I do make a mistake, you can cut my FVC salary in half.

When I was first learnign to us EasyC, and I scanned the list of commands available in the "palettes"; I saw several that send something out to a PWM port. Among these, two under the heading of Outputs were Motor Module and Servo Module. Why on Earth there were two for doing exactly the same thing confused me. Whether a motor or a servo is connected to the computer is completely hidden from the software.

Then, under the heading of RC Control, I found Motor Module Rx and Servo Module Rx. Like the two mentioned above, why two existed to do the same thing confused me; and why on Earth they have Rx in their names when their job is to control output ports made them even more perplexing. Also these two had an annoying list of cryptic input parameters that (unlike named variables) would make no sense to me 5 minutes after I set them.

Four others, also found in the RC Control palette, Arcade 2 motor, Tank - 2 motor, Arcade 4-motor, and Tank 4-motor had even longer lists of cryptic parameters waiting to entangle me... yuck.

If only there was an elegant, pure, simple command to just tell a PWM port what to emit, one without any other baggage attached to it. Oh, wait! There it is, the PWM Control command. But maybe not....

Hmmm, why is PWM Control under the RC Control palette? Neither its description nor its parameters make any mention of the transmitter or receiver; but then again, why should they? This command just tells a PWM port what to emit. Oh well, trying to guess the ancient quirks of coding preferences that lead to all these confusing names and palette organizations is a fool's errand. I'll trust the documentation and use the PWM Control command. It is simple and based on what I can read about it, it carries no extra baggage.

Well... thereby hangs a tale (more than one apparently).

KingofI337 says below (thank you King) that older versions of EasyC had a hidden linkage between PWM Control and whether or not the microcontroller (plus the implied receiver...) detected a valid signal from a transmitter. He says this is gone from more recent Vex EasyC versions.

When we use those older versions, if we want to control PWM ports regardless of what is coming into the microcontroller from the receiver, I think we are supposed to use the Motor Module or Servo Module command(s) instead of the PWM Control command. I assume that which one you choose (Motor Module or Servo Module) is irrelevant, but I already guessed incorrectly above, so maybe they do have hidden differences and you shouldn't use my guesses (yes - I know that when given the same PWM signal, motors and servos rotate in different directions, but do the software "guts" of these functions contain any non-trivial differences???).

So, for purely autonomous operation (no Transmitter needed) I think you remove all PWM Control commands and replace them with Motor/Servo Module commands.

For autonomous operation when a transmitter is on (perhaps followed by teleoperated operation) I think you can use all PWM Control commands or all Motor/Servo Module commands

If you want to mix Motor/Servo Module Commands and PWM Control commands in the same program, I seem to remember two things.
  1. An admonition (in the EasyC documentation) to not put them in the same loop within your program (don't ask me why this should matter).
  2. One of my robots twitching uncontrollably as soon as I turned it on, when I tried a program (before I spotted the admnition) that contained both types of commands.
For these reasons I suggest not even putting the two within the same function (EasyC 2.X functions or the competition templates' autonomous and teleoperation functions) if you feel you need to use both.

Blake
PS: If my recommendations are wrong, please enlighten me/us. I freely admit that I was never the world's expert on this, and that I have been away from this side of things for a while.
__________________
Blake Ross, For emailing me, in the verizon.net domain, I am blake
VRC Team Mentor, FTC volunteer, 5th Gear Developer, Husband, Father, Triangle Fraternity Alumnus (ky 76), U Ky BSEE, Tau Beta Pi, Eta Kappa Nu, Kentucky Colonel
Words/phrases I avoid: basis, mitigate, leveraging, transitioning, impact (instead of affect/effect), facilitate, programmatic, problematic, issue (instead of problem), latency (instead of delay), dependency (instead of prerequisite), connectivity, usage & utilize (instead of use), downed, functionality, functional, power on, descore, alumni (instead of alumnus/alumna), the enterprise, methodology, nomenclature, form factor (instead of size or shape), competency, modality, provided(with), provision(ing), irregardless/irrespective, signage, colorized, pulsating, ideate