neurobionics / TMotorCANControl

A python API to control AK-series TMotors over the CAN bus.
25 stars 21 forks source link

Corrected temperature reading from CAN in MIT mode #4

Open Mennosytsma opened 1 year ago

Mennosytsma commented 1 year ago

When trying the demo scripts using an AK60-6-V1.1 connected via a PEAK CAN UBS converter, all demo scripts gave an overtemperature error. Looking into it more closely it seems that the temperature data is not scaled or anything after reading it from CAN, where most other values are transformed using the uint_to_float. Page 39 of the TMotor manual specifies the limits for the messages in Servo mode, but for MIT mode this is not explicitly mentioned. TMotor Manual For my setup the limit values of 0 to 100 seem to give a decent reading of the room temperature upon startup of the motor. I have also asked this question to TMotor. In their response they indicated that the temperature protection limit should be 140 degrees celcius and the temperature reading should just be substracted by 40 to obtain the temperature, which in my case results in an unrealistically low temperature for the room. TMotor Manual Chinese

JFredPerspektiv commented 1 year ago

Thanks for your commit Mennosytsma ! I implemented the corrected temperature in mit_can for my AK80-64 and its works just fine. Problem solved in few minutes, thanks to your work. IMO, this part is good to merge.