A few questions

Hello there!

I have a few questions…

  1. Is there any guide to programming PIC specifically for VRC in robotC? I have looked around but I am a little lost. For example, I don’t the values the sensors send (e.g. what number is a full rotation on the encoders, how the line followers are supposed to work)
  2. I am using a 4-motor direct mecanum drive. I have managed to program them, but it seems when I run the robot on the foam field tile the robot has trouble strafing. I am using the old vex 3-wire motors, would it be worth ordering some 269’s?
  3. I also have no idea how the field control is supposed to work with my program… I assume this will be covered in any VRC programming guide. Keep in mind I am not using VEXnet, the tournament I am going to is set up for crystal control as well.
  4. Is there any way to get debug data from the PIC without an LCD screen (e.g. through the cable)?

I think that’s all for now!

Thanks a bunch!

I’ll try to answer as best I can,

  1. there are many sample programs included in robotC you can try there first, there is also a new Wiki for the API

  2. I’m not sure 269’s would have any major benefit, you might consider the 393 motor instead.

  3. Field control is for competition, most competitions require the use of VexNet now, the 2 systems are not compatible. it would be easier to respond if you could offer more details on what you have and are intending to do.

  4. without VexNet I don’t think so.

Cheers Kb

Thank you!

Unfortunately, I cannot use 393 motors for the drivetrain unless absolutely necessary. We were hoping to use them for the lifting mechanism.
Would you recommend 393’s on the drive system to be more important then a faster lift?
The competition I will be attending (TSA nationals) has told me personally that “Yes, we will have competition crystals present so that the crystal systems can be used.”

In regards to the programming, any tips anyone has for a beginner?

Honestly, because of price, we are on the edge about attending this competition. Coming from experienced veterans, is it possible to make a decent program for autonomous in about 3 weeks after school?

In regards to your question about programming, I would recommend using EasyC for the PIC. I realize it is not your current software, but I find it to be much easier for beginners (I myself am not a programmer, so I have never used RobotC, however I did use EasyC during an emergency when our programmer was out to some effect).
Now as for building, I am the builder on my team as well as the drive base operator. I find that it is MUCH more important to have a workable-somewhat fast Drive than to have a fast arm. Also, If you put 269’s on the wheels, they will very quickly overheat and stop functioning for like 15 seconds during a match. So I highly, highly recommend using the 393’s for the drive base. Especially in a game like this where you can score by driving. As for the arm, use 2 269’s and you’ll have the same effect. (Assuming you have the 393’s geared internally for torque.) Also consider gearing the arm for torque. A 1:7 gear ratio on an arm is not as slow as it sounds. We had a six-bar arm geared at a 1:7 ratio that would go from full down to full up in about 2-3 seconds. So I recommend using 393’s for the base, and 2 269’s for the arm if possible.
Finally for your question about 3 weeks. I have helped put together robots (including autonomous) in a weekend. And we won the competition the next day. 3 weeks is a lot of time in vex.

Hope this helps.

Thanks a bunch!

I might as well tell you guys, the game I am playing is Gateway, not Sack Attack.

For me, robotC is a priority as I will soon have a job as an intern at CMU robotics academy, which develops robotC. So this really is part of preparation for the job :wink:
I know most of the concepts of programming, it is just the vex-specific stuff that I need to learn, specifically about how the crystals interact with the game control, and how this effect my testing.
I assume I will have to essentially write four different programs within one meta-program, possible selected using a potentiometer. Is that how it’s done?
So a powerful drive train is more important than a fast arm, hmm? That was sort of my gut feeling too.
So how do you guys navigate? Is it mostly line following? How accurate are the encoders? Is the sonar at all effective?

Thanks for all your tips, keep them coming!

Another, very important question which most of you should be able to answer is:
If we are planning to get some 393’s and use four of themin a direct-drive mecanum drivetrain, will we need to get a power expander?
At the moment we are running 8 3-wire motors with no trouble in the battery department, however when we get 4 393’s will the drain be too much for the PIC? Or will it just make the batteries run out faster?

Thanks again!

Your pic can run 4 393 motors just fine.

to make sure, you should put 2 of them in ports 1-4, and the other 2 in ports 5-8. It means that there is less load on each of the breakers. (assuming the PIC runs the same system as the cortex). In response to your programming question, as you get latter into the play-off’s, a good block code can be more handy than one that sometimes scores allot of objects. Last of all, I have to disagree with “3 weeks is a lot of time in vex” :stuck_out_tongue:

269s are a little stronger than 3-wire motors, but not by much. They are designed to be similar to 3-wires. And yes, 4 3-wire motors on direct drive with mecanums is a little bit underpowered. The strafing would work better if you geared down the drive or used 393s.

Field control is really simple. You just plug a field control cable into your joystick and then when the field is set to “disable” your joystick is disabled. You aren’t expected to know how it works before your first competition; you will be shown how to do it.

4 393s and 6 3-wire motors should be fine as long as you aren’t gearing them too high. Using a power expander allows you to draw an additional 4A from a second battery. A lot of teams find this useful, but if you set all your gear ratios conservatively (which is good practice anyway) you won’t need it.

RobotC has a Debug window available after you download (go to the Robot tab & drop down to Debug window). You can select what data you need - sensors, motors, etc. You will need to be connected to your PC. The info will appear below your code on your PC screen.

Really… and we just ordered an LCD screen!
Ah well.

So, in regards to this programming, does that mean my robot will be under a timer - as in, do this autonomous, then after thirty seconds or whatever, switch over to the driver control task?

Seems simple enough, will be annoying for just driving around to test however…

Hmm, any more advice for a beginner?

OK, I’ve played around with the RobotC software and I have a few questions.
I’m using a mecanum drivebase, and I want to be able to control (that is, set values for what the remote would be doing) from autonomous mode - So, for example, I want to be able to say - forward at 100% or sideways at 50% etc, from the autonomous routine.
My guess is to set up a separate task with the mecanum code, but instead of inputting receiver values directly, I input global variables instead. Would this mean that I could just adjust the values outside this task from both autonomous and driver control?
Where should I create my functions? Just outside of all the tasks?
When I name my motors, do I still have to use motor[port1] or can I use motor[motorname]? If not, why name the motors?
Also, what is the purpose of interrupt ports as opposed to the analog/digital? How do I know which sensors go in which ports?

Thank you so much!

Yes, you could set up a separate task that uses global variables, which you can give values in autonomous or user control. Make sure the task is started in autonomous.
Always define function outside of tasks (you only want to define them once).
Yes, you can use either the motor names or “port#”.
Not sure about interrupt ports, but you can see the list of sensors here divided into analog and digital subheadings.

I have another interesting question…
I have been watching a few youtube videos, and it seems that, during autonomous, most robots seem to waste a lot of the time by, say, just driving up to a goal without doing anything, waiting for driver controlled.
Can I not expect to be able to pick up objects during autonomous? Are there just too many variables, or something?
This mystifies me… Why not, for example, in the isolation zone, pick up some of the floor objects during autonomous? It seems like there would be plenty of time for it…
Also, is line following worth it? And why is it recommended I use an array of 3 line followers? I can easily follow a line with just one - are there calibration issues or something?

Sorry for all the questions, but I am bit confused by this.


In an array of 3 line followers, the center is used to follow the line and the outer ones aid with correction. If the left one no longer reads white, than the robot knows to turn to the right to correct and it’s the opposite for the other side

It’s off the OP, but i couldn’t resist…
It’s nice to finally hear from someone else that will be attending TSA Nationals in Tennessee!
Out of curiosity, from what school and state are you coming and how did you do during your TSA state competition?

Back on topic tho, as far as wasting time sitting in front of a goal, i think most teams look at it this way: I have 4 objects in my robot. I can try to score them in autonomous risking the fact that if my robot isn’t lined up properly I’m going to drop them on the ground and waste driver control time picking them up. Or I can wait until driver control starts, spend extra time to ensure everything is lined up, and then guarantee the objects are scored.
It all depends on how you value your time and what kind of risks your willing to take. (I favor the latter, but prepare the former just in case :wink: )

Hey, someone going to the TSA Nationals!
I’m from Pennsylvania. In all honesty, our state comp was a joke. The organizers did not know the rules (I had to tell them most of them) and we had 1v1 gateway matches with no autonomous, so it became a match load war, especially as they misunderstood the corner goal rules so that stacked object still counted… However we still won playing by the real rules.
Have you been to TSA nationals before? What’s it like?

OK, my other questions.
Should I match load during autonomous?
Should I pass from interaction to isolation during autonomous? (At TSA nationals, will the standard of teams be high enough to warrant doing this, or am I going to need to implement an option to not pass due to incompetence :smiley: )


TSA is very new in VEX and as such it is a growing competition (inside of TSA). Our team competed last year for roundup and we finished with the High School excellence award. Based on my experiences, compared to the VEX circuit, TSA vex has been a bit less competitive, but there are definitely teams involved that are formidable. I will give you forewarning, last year they had interference issues with the crystals, likely because the animatronics competition was running next door. I believe they have taken that into consideration this year however.
As far as gateway specific strategy, i am not sure myself. I believe the level of competition will be greater than last year, as should the level of participation. (we had apporx. 50 teams last year)
I would recommend planning your strategies to fit in both a competent team mate and a lack of one, to cover any and all situations.

Also, are you going to be competing in any other competitions than VEX? Nationals is a long week if your not constantly in competition, I’d recommend looking at ideas for things to do online, just in case you run out of things to do.

Due to the unlimited amount of 393’s for next year’s challenge you don’t have to worry about spreading it out. If you don’t have enough money though, it’s okay. I would switch to an H-drive instead because it needs less than power than mecanums.

Btw, don’t use over 6 393’s on your robot or else you will trip your breakers on the Cortex.