trueSpeed for Turbo Motors

trueSpeed was made in sack attack using speed motors. Now we have turbo motors, and it has been a while since then, so why not make a new trueSpeed for turbos?

This thread (made by @LegoMindstormsmaniac) is pretty much exactly how I found these values, just tailored to my robot using turbos.

Brief summary of steps
I first tested every value (0-127) and calculated the RPM for each value. I did this 8 times, 4 times per chassis side. 2 of those were 0-127, and the other 2 were 127-0. I was monitoring the battery voltage the entire time to make sure it didn’t get to low.

After I had my 8 tests completed, I averaged all of the data. It was all very consistent, and thats good because it makes it easier to fix.

That is the end result of the averaged data. We want it to be linear, so we will be remapping the values to get it to be as close to linear as possible.

The RPM I got with 127 power was around 280. I found that I needed 45 RPM (15 power) to go from a full stop to slowly moving. Knowing that, I can calculate what RPM I should be seeing with every motor value.

That is the ideal graph I should be seeing

I went through each ideal value, and found a motor value to get me that RPM (or very close to it). In the end, that gave me very good results.

Yes, it could be more accurate, but the way it is works perfectly for my needs :slight_smile:

The Code
Turbo: Click Me
(High Speed array was made by @LegoMindstormsmaniac and I modified the function a little)
High Speed: Click Me

Some example code using trueSpeed: Tank Drive (turbo)

If you have any questions, feel free to PM me or ask below!


Turbo trueSpeed is now more sensitive, it wasn’t sensitive enough and you had to move your joystick more than half way to get any movement. Kind of defeats the purpose of trueSpeed… Has been fixed

In both speed and turbo, when it returns a value, it grabs the abs of newRawValue instead of multiplying it by a number to make it positive

Threshold on turbo trueSpeed was increased to 15

Updated example code (tank drive) with the updated version

I would assume that these values would change based on the weight of the robot?

Or are you purely mapping RPM to input value, irrespective of load?

Technically, yes, the values will change based on the weight of the robot. With very little testing and modifying the values, that can be fixed.

Jordan’s trueSpeed was created with the weight of the robot driving. My trueSpeed was created with the robot on a skateboard so the wheels didn’t touch the ground, and modifying the values to get a different output that worked with my robot.

I didn’t have to play with the values much to get a good array for my robot, but I highly suggest you do that if you use my trueSpeed.

With testing my trueSpeed VS Jordan’s trueSpeed, mine works better only because I made it to work on my robot. If Jordan’s array was tuned to my robot, it would work better.