# V5 Motor Temp in Percent?

I was looking through the reference and I find this:
vex::motor.temperature
however the output is in percent units.
Does this mean that the motor’s temperature is measured in percentage with relation to its limits?
Will the motor break when it reaches 100%?
Will it ever reach 100%?
What is the “not-safe-zone.”

2 Likes

We had a flywheel that worked good until about 50%. They would still run, but not with enough power to shoot a ball.

One off my teams prints their flywheel motor temp to the controller. It appears to us to be Celsius. (Or there is an uncanny relationship between an unused motor and room temperature.) I could see the power throttle starting at around 50C, which is somewhat hot.

Anyone know for sure what that value is reporting and what value the brain throttles power to the motor?
@jpearman ?

1 Like

The original conversion, the one that’s still in the VCS August version, is this.

``````
double temp_in_percent = (motor_temperature - 21.0) / (100 - 21.0) * 100;

``````

which was then limited to the range 0 to 100%
so 0% was 21C and 100% was 100C, we knew these were not the real limits, it was really just a place holder until final numbers were determined.

We updated in September to this.

``````
double temp_in_percent = (motor_temperature - 20) / 50 * 100;

``````

so 0% would be 20C and 100% would be 70C, this matches more accurately the limits in the motor. Unfortunately, as VCS has not been updated, neither has the sdk so we have not been able to release this.

We also added methods to read motor temperature in degC or degF, but again, it has not been released. Using what we have now it’s easy enough to convert back to a more useful absolute temperature.

The motor firmware will cut maximum motor current in half at 55 degC, to 1/4 at 60 degC, 1/8 at 65 degC and disable the motor completely if it reaches 70 degC.

5 Likes

Is there a way to increase the resolution of the sensor values? We noticed the values jump in increments of 5. In a room with an ambient temp of 25 C, motors on a completely idle robot show either 30 C or 35 C. Also, it seems that the sensors are polled infrequently, but this could be an illusion due to the 5 degree increments. We use RMS Python - not sure if it makes a difference.

The motor only has this information with 5 deg resolution. It’s returned with all the other motor status so update rate is the same as everything else.

2 Likes

@jpearman: Thank you. Is it rounded / averaged in any way? Or 50 to 54 is 50 until it reaches 55? Trying to program an early warning system for a heavy bot that overheats easily.

Temperatures in the range 47.5 to 52.5 will be reported as 50 deg C. vexos just reports what the motor sends back. There’s a lot of hysteresis, temperatures can continue to rise after we limit current and they take some considerable time to drop due to thermal mass. The best thing to do would be to collect some data for your motors on your particular robot and base decisions as to what to do on that data.

2 Likes

To followup /support the data collection approach…

We have a local middle school team with a single motor V5 flywheel, 600 rpm, I believe 5:1 gear ratio. Code was set to run the flywheel motor at 600 RPMs, and they were running into issues where the motor would suddenly slowdown.

Their initial instinct was to blame the battery power, but after some discussion/direction, the lead programmer added monitoring of motor.temperature to their loop so they could troubleshoot to see if it was a battery, motor issues, or excess friction (it was clearly friction issues coming from NBN tuning).

From initial temp %, they saw the motor temp % value change in 6-7% increments as the motor ran and temp climbed.

In this particular motor’s case, there was a sudden drop off in RPMs as soon as the motor was at or above the 43% range. it would still run, but would slow down to around ~ 350 RPMs IIRC.

The team worked on their mechanical issues, and the temp/overheating was resolved (at least for a good amount of time before they had to start chasing some wear/tear issues on the flywheel again).

That’s what the team is trying to do and your info was super helpful. Now we have some better understanding on how things behave. Thanks again.

Idk what it means. My team has been joking about 100% temperature for a while, since temp stalling isn’t a thing.

I’m still trying to figure out VCS, and am trying to display the drive motor temperature on my controller screen so that I know when to give the motors a rest before they overheat. If someone could help with this, I would appreciate it.

Here’s how our code does it: (EDIT: this is for printing to the brain)
`Brain.Screen.printAt(2, 40 ,"Motor Temp %f " , Motor.temperature(percentUnits: :pct));`

First number is x position on the screen, second is y, %f is placeholder that allows the second number to print.

Edit: just realized you said controller, my bad. Here is how you would print to the controller display. Note that the controller only has a maximum of 40 ms (iirc) update rate on the screen.

Controller1.Screen.print(“Motor Temp %f " , Motor.temperature(percentUnits: :pct))

I’m not exactly sure if you will need to or not, because I haven’t played much with it, but you may need to clear the screen (Controller1.Screen.clearScreen();). I’m assuming you will since printAt isn’t listed as a command on the API reference.

1 Like

Thank you so much! @jack202020

@jack202020 I have tried both using your code for the brain and for the controller, and my code will not compile. It just shows the “compiling” flag that comes up on the right of the screen, but never actually compiles.
Here is my code, which was copy pasted from your post, except for making the motor be “LeftMotor”, as is the name of the motor I am trying to get the temperature of:

``````Brain.Screen.printAt(2, 40 ,"Motor Temp %f " , LeftMotor.temperature(percentUnits: :pct));
``````

I tried this as well to no avail:

``````Brain.Screen.printAt(2, 40 ,"Motor Temp %f " , LeftMotor.temperature(vex::percentUnits::pct));
``````

Edit: I found this as the error in the console, though it wasn’t actually showing up as an error

``15:12:03 -- info -- make process failed with return code: 1``

The only issue I see is that you have a space in your colons on the first example. (I accidently put one there) other than that, I don’t know why it wouldn’t compile. Are you running it in a loop? Have you tried restarting VCS? The code below is directly from our code, and compiles. It is in the user control task.

I think I know what the problem was. I was unaware that I couldn’t have the code in an if statement, so once I just put it alone in the while loop of the user task, then all worked well. Thanks for the help