Programming

I need help!!! i am new to vex robotics and i have been asked to program the robot. I have the basics done, but now i would like to make a more complex program/robot. I have seen that people that have used all these cool graphs to show motor speeds and force that is on the motor, plus a table to show the amps leaveing the cortex? Any ideas how i do this??? Any one with a little bit of knowledge would be a get help to me.

using this website is very helpful for anyone to learn robotc http://www.education.rec.ri.cmu.edu/products/teaching_robotc_cortex/index.html

Thanks that is awesome. but i can find anything of what i am look for. any other ideas

well you usually start out with just the basic stuff like startmotor and then you can use if & while statements and then you can mix them together to get a more complex program

I have gone though all of that and able to make a program, but i would now like to make a graphs to do with motors

You’ll want to use a third party sensor that records amperage or force and then piece together what the robot is doing (i.e. PWM values) with whatever third party sensor you’re using.

The kind of graphs I think you are thinking of are those mapping the efficiency of a truespeed array vs the stock vex control system. But none of the programming software has any sort of thing like this built in, JPearman may be one of the most helpful users with something of this type.

This is your best option.

To create graphs of motor force vs current (or similar), you would need to 1) sense the force and the current, then 2) log this data to a file. A problem with the VEX Cortex is that there is no built-in (for the major programming languages, at least) file access. So, you’re out of luck there.

It is possible (to some extent) to transfer data over serial or through the debugger, but that might be difficult.

Another issue that you have is that there are no current sensors or force sensors in the VEX design system. You would have to use a third party sensor for measuring force or current. A encoder could be used to measure speed, but a sensor specifically designed for measuring angular speed could make your life a lot easier.

jpearman is the one, though, who would know best how to tackle a problem like this.

%between%

It really depends which graphs you are referring to.

If it is something like the “motor torque speed curves”.
https://vexforum.com/showpost.php?p=310291&postcount=2

Then these are theoretical graphs created in excel using the published data for the motors.

There are other graphs floating around showing such things as joystick value vs motor speed. These are generally created by measuring the motor speed using either an IME (motor encoder) or the red quadrature encoder. Both allow the speed of the motor to be calculated by monitoring how many counts pass in a fixed amount of time and calculating rpm from this value. Usually to do this in ROBOTC I just send the information to the debug stream and then cut and paste into a spreadsheet to make the graphs.

Finally, there is more complex analysis of things like instantaneous motor current.
https://vexforum.com/showpost.php?p=318273&postcount=1

These are a bit more difficult, read that post and see if it answers any questions for you.

Data visualization is such a powerful tool. I encourage all of our kids to do this to see what they have to solve problems.

We’ve had a lot of luck using the write debug stream line output in the robot C debugger and parsing the data in Excel or Open Office. Using the vertical pipe character (the one above the enter key) | is very nice as a parsing variable and is a personal preference. A serial output to Arduio/Xbee/memory card is another more convoluted route.

The debug stream can only keep up so well, so some cleansing of the data is in order in Excel. You may miss a few or they come over 1/2 way depending upon the connection.

Logging too fast is also not great so make sure you have 10-15 milliseconds in between prints. The function is also limited to so many characters per line. So choose your output wisely as joining multiple lines together is very painful. Much easier to just copy/paste and then parse text to columns in Excel. Excel is even smart enough that when it sees the next run it parses it automatically. Open Office is a free spreadsheet program in case you don’t have Excel.

As far as current sensing, you need to buy a new sensor and Frankenstein it in with a bit of soldering. It can be done but is for local testing, not competitions.

What you log is what you can graph! Then you can make the distinction of what is good and what is bad. Excel is helpful for easily averaging data points to even it out, making filtering decisions for high/low passes, and other techniques to get velocity and acceleration too. Then you can choose what you want and program it into the robot.