# Trial and Error PID

So today I was trying to get the robot to move as straight as possible when going forward. I know you can do this with PID, but I don’t know how to do it yet. So instead, I changed the power given to each motor on the base to compensate for veering. After trial and error, I found that for the robot to move straight, one side (left) had to be at 85 power and the other side (right) had to be 127. Is this big of a difference normal?

Well you will find the motors have no speed change from 90 - 127. So this doesn’t actually sound unreasonable. Just for a quick test try changing the 127 to 95 and seeing if your results change at all ( I bet they wont).

Thank you! I didn’t know this until now.

Wait, what? The motors don’t go at a different speed until power 89?

Is the amount of stall torque different as well?

Tabor is saying the speed from 85-127 increases very marginally, while the probability of stalling is much higher. The motor changes speed from1-85, but at about that point there is little increase.

*The motor changes speed from 20-85

Is it 85 - 127 or 90 - 127 where the speed stays basically the same?

Read this historical and historic post. Notice the graphs.

https://vexforum.com/t/24cs-motor-control-value-remapping/23959/1

What @LegoMindstormsmaniac found was that a power setting of 85 to 127, the actual delivered power does not increase much at all.

From just below the second presentation of the graph, in paragraph 9:

Because of @LegoMindstormsmaniac’s work, (which others have verified and reproduced periodically) we know you shouldn’t expect to see much if any change from 85 or so up to 127. We often round this to 90, just because it’s an easier number to work with.

Ah, I see. Thank you for the clarification!

So I understand what you’re saying, however I’m wondering is there an advantage to using the value 90 instead of 127 in your code? If 90 and 127 are the same speed anyways, does it matter what value you use as long as it’s between 90 and 127 if you want your robot to go full speed? I have heard someone on the forum say that competitive robots usually don’t go above 100 during competition play, and I’m wondering why it matters, if 100 or 90 or 127 is used, if they’re all the same speed?

I guess if you use 100 instead of 127, it takes longer for the motor to overload since it’s receiving less power, but it comes at the cost of less torque (only a little bit though, like 1 in-lb loss)?

I am not sure it actually gets less torque. People have been saying that here over and over without any evidence to back it up.

If the motor receives less power, then it produces less torque.

Do you have proof it receives less power?

I did a test a while back of the motor controller output on ports 2-9. Measured on an oscilloscope.

The signal being given to the motor has no change from ~85 to 127. This means the power, speed and torque are probably completely unchanged across that range.

*caveats

1. Only tested every 5 power
2. Tested with tiny resistor instead of motor to remove back EMF, it is possible higher load on the motor controller produces unexpected effects.*

The only reason I have found to run 90 instead of 127 is that it heats the ptc less.

If you’re going to be in an engineering field, you should base decisions on facts and evidence.

There are at least two separate places in this thread that disprove your assertion that using 90 instead of 127 will heat the PTC device less.

It was really good of @tabor473 to provide a graph from his recent data-taking on this issue. If you don’t understand it, I’m sure he is more than willing to explain it.

If you disbelieve it, or think it doesn’t apply to your situation, you should be prepared to back up that thesis with data.

Yes, that is an important caveat to this discussion. There will be difference in how motor would behave under the load vs being run idle (where the only mechanical load is the friction in their internal components).