IME Auton Programming

Hey guys, I had a question about programming and IME to keep our robot arm at one position so that the weight doesn’t weight it down during auton. We have gone through and fixed the rubber bands so that they are in the optimal point, but are still having a little sag. To accommodate for this, we were going to use an IME to keep the arm at a set position, essentially using a P loop. Unfortunately, it has been quite some time since I have used the IME and am confused a bit on how to do this. My biggest problem right now is I cannot for the life of me remember how to reset/set the value the encoder gives back to 0. After that, it will be fairly simple, but if you guys could give me an example of how you might do this, that would be great.

The simplest way to reset the IME’s is to do the following:

nMotorEncoder[motorName] = 0;

However, with what you are saying, the easiest way in my opinion to accomplish what you want to do is to use a potentiometer.

OK, what I am currently trying was…

SensorValue(IME) = 0;

Would this work for my purposes? Or would I have to go with something like what you had stated?

P.S. - The reasons for not using a potentiometer is the range of motion needed is too great and would break it.

I do not think what you are trying would work as the IME’s are not configured as sensors in RobotC, so I would assume that they do not have the same methods to reference their values. I have never tried using SensorValue(sensorName) with IME’s, so I am unsure of how this would work. However, I recommend switching to what I said in my previous post because that is the official way of doing it.

Ok, thank you. I’ll let you know how it goes. :slight_smile: