I want to know how to make an autonomous program more accurate, while being faster.
So, the method that everyone jumps to is PID, but there’s an in-between which is easier than PID but more accurate than simple rotate commands. Very Simple Very Accurate Chassis Control Code Release This topic explains and provides an example of a control method which ramps acceleration and deceleration to achieve accurate motion.
I’m a real newbie at programming, and I don’t know how I would put that in VEXCode IQ Text.
Or, should I use RobotC?
I prefer robot c, and what I have done is line tracking with the color sensors, set to grayscale, 2 of them side by side over the lines, with the robot set to auto correct if the black line us not in the middle of the sensors. Not super difficult with tank or h drive, trickier with x drive.
How do you program the colour sensors to do what you explained before? Can you also do it in VEXcode IQ Blocks?
Untitled drawing.pdf (15.8 KB)
I put the colour sensors here. Is that where they should be?
Humm. Not entirely sure of the details, it’s been almost … wow… almost 3 years since I did that. Anyways, you set them to grayscale, and set them side by side, with the lights facing forward. Then you can kind of set it by showing the values on the brain, Higher values mean white, lower are black (I think) l, so if the black is in the middle of the 2 sensors, there should be a medium values- half the line on each sensor. If you start to get off the line, then you will see greater values on one sensor, lower values on the other. Then you can turn to where you have equal values on both sensors, and you should be straight on the line, mostly. Someone else can probably give more details, it’s been a long time since I did this. I don’t know if you can do it on Blocks, I’ve never done it there. When I programmed for IQ, I used RobotC.
Did you use Graphical RobotC, or the text version?
No, text based. You might be able to use graphical, but it would probably be harder
Okay, thanks. I’ll try it in Graphical first.
Also, no I don’t think that that placement is correct. They need to be side by side at the front of the robot, their sides touching.
Does it have to be at the very front, or can it be like, 3 inches back?
I said the very front… but it doesn’t matter. As long as they are along this line, in the center of your robot, they should be fine.
The color sensors are in red, the blue line is the line they should be on.
However, having them at the point where they will be most affected by the movement of the wheels-for example, if the motors are mounted in the back on a 2 motor drive, and the wheels are not linked together, then placing the sensors at the front- might show better results, I haven’t tested that.
I put them like this:
Untitled drawing (2).pdf (15.7 KB)
That should work. _________________
Does it matter if they’re upside down or not?
No, it shouldn’t really.
Do I use “Line Tracking” for the colour sensor code? There’s nothing else.
That might work… if it doesn’t, then try robotC or graphical, and you might have to make your own function. What I would recommend is where you make a function where the robot goes to the next “intersection” , where you center it on the line and make it go forwards while auto correcting, then make up your autonomous out of those.
Edit: I don’t know that Line Tracking like that will work, I think that is set to one sensor, not 2.