RoboteQ Temperature Conversion C Source Code, AX3500 Motor Controller User’s Manual, Value

Models: AX3500

1 208
Download 208 pages 62.24 Kb
Page 68
Image 68
Value

Connecting Sensors and Actuators to Input/Outputs

These sensors are used to automatically reduce the maximum Amps that the controller can deliver as it overheats. However, the temperature can be read using the RS232 port using the ?m query, or during data logging (see “Analog and R/C Modes Data Logging String Format” on page 170)

The analog value that is reported will range from 0 (warmest) to 255 (coldest). Because of the non-linear characteristics of NTC thermistors, the conversion from measured value to temperature must be done using the correction curve below.

It should be noted that the temperature is measured inside the controller and that it may be temporarily be different than the temperature measured outside the case.

 

300

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

250

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Value

200

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Analog

150

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reported

100

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

50

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-40

-30

-20

-10

0

10

20

30

40

50

60

70

80

90

100

110

120

130

140

150

 

 

Temperature in Degrees C

FIGURE 38. Analog reading by controller vs. internal heat sink temperature

Temperature Conversion C Source Code

The code below can be used to convert the analog reading into temperature. It is provided for reference only. Interpolation table is for the internal thermistors.

int ValToHSTemp(int AnaValue)

{

// Interpolation table. Analog readings at -40 to 150 oC, in 5o intervals

int TempTable[39] ={248, 246, 243, 240, 235, 230, 224, 217, 208, 199, 188, 177, 165, 153, 140, 128, 116, 104,93, 83, 74, 65, 58, 51, 45, 40, 35, 31, 27, 24, 21, 19, 17, 15, 13, 12, 11, 9, 8};

int LoTemp, HiTemp, lobound, hibound, temp, i;

i = 38;

while (TempTable[i] < AnaValue && i > 0) i--;

if (i < 0) i = 0;

if (i == 38) return 150;

68

AX3500 Motor Controller User’s Manual

Version 1.9b. June 1, 2007

Page 68
Image 68
RoboteQ AX3500 Temperature Conversion C Source Code, Connecting Sensors and Actuators to Input/Outputs, Value, Analog