Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
pt100 [2017/01/25 16:12]
arthur
pt100 [2017/05/18 01:33]
70.83.197.215
Line 1: Line 1:
-== PT100 configuration and usage+A [[https://​en.wikipedia.org/​wiki/​Resistance_thermometer|PT100]] is a commonly used RTD. Compared to how Thermistor class works - it handles NTC's PT100 is PTC so the change in resistance with temperature is "other way around"​. PT100 also have very different curve than NTCs handled by Thermistor class.
  
-A [[https://​en.wikipedia.org/​wiki/​Resistance_thermometer]|PT100] is a commonly used RTD. Compared to how Thermistor class works - it handles NTC's PT100 is PTC so the change in resistance with temperature is "other way around"​. PT100 also have very different curve then NTC's handled ​by Thermistor class.+PTC means positive temperature coefficient ​so electrical ​resistance ​increases ​with raising ​temperature. They cannot be used as-is, you must use an amplifier circuit so they become usable ​by SmoothieBoard.
  
-PTC means positive temperature coefficient so electrical resistance increases with raising temperature.+Currently Smoothie only supports E3D's PT100 amplifier board. Other PT100 amplifiers may be supported later (i.e. MAX31865 via SPI).
  
-You wire a PT100 the same way you would a Thermistor, but you need to specify Smoothie it is a PT100 and what type it is.+<callout type="​danger"​ icon="​true">​ 
 +The PT100 E3D amplifier needs to be powered from the AVCC and AGND header pins on the SmoothieBoard,​ only newer boards have this header.
  
-=== Un-amplified ​PT100+If you do not have AVCC/AGND pins, you can use 3.3V and GND. However this may introduce noise in the ADC system and may affect all temperature readings from analog sources (i.e. thermistors and PT100).
  
-Example configuration : +**DO NOT power from 5v or you will kill the port.** 
 +</​callout>​
  
-[[code]]+You wire a PT100 //almost// the same way you would a thermistor, but you need to specify to Smoothie it is a PT100 and where you connected the amplifier signal output: 
 + 
 +<code>
 temperature_control.hotend.enable ​             true temperature_control.hotend.enable ​             true
-temperature_control.hotend.sensor ​             ​pt100 +temperature_control.hotend.sensor ​             ​pt100_e3d 
-temperature_control.hotend.pt100linear ​        1 +temperature_control.hotend.e3d_amplifier_pin ​  1.30        # ​must be a free ADC pin, not a temperature input 
-temperature_control.hotend.thermistor_pin ​     0.23 +</code>
-temperature_control.hotend.ampmod1_pin ​        nc +
-temperature_control.hotend.ampmod2_pin ​        nc +
-temperature_control.hotend.slope ​              ​0.0523809524 #slope for e3d pt100 amp +
-temperature_control.hotend.yintercept ​        -299.       #yintercept for e3d pt100 amp +
-[[/code]]+
  
- +<callout type="​info"​ icon="​true">​ 
-=== Amplified PT100 +When using a PT100 sensor ​type you do not need to set values ​for the thermistor kind or thermistor_pin. ​If you do, these values ​will be ignored
- +</callout>
-Example configuration :  +
- +
-[[code]] +
-temperature_control.hotend.thermistor_pin 0.23 +
-temperature_control.hotend.pt100linear ​   0            # use 0 for RDT curve (alpha/beta values) +
-temperature_control.hotend.pt100_a ​       0.0039083 ​   # PT100 ALPHA value +
-temperature_control.hotend.pt100_b ​       0.0000005775 # PT100 BETA value +
-temperature_control.hotend.pt100_r0 ​      ​100 ​         # resistance at 0C +
-temperature_control.hotend.pt100_amptype ​ 0            # type of RTD amp, attm only 0 supported (0 is e3d pt100 amp) +
- +
-# quoeficients ​for the ADC to Rt formula +
-# q1 * ADC_VALUE / ( Q2 - Q3 * ADC_VALUE) +
-temperature_control.hotend.pt100_q1 ​ 810000 +
-temperature_control.hotend.pt100_q2 ​ 45409000 +
-temperature_control.hotend.pt100_q3 ​ 280 +
-[[/code]] +
- +
-== Example configurations +
- +
-[[code]] +
-temperature_control.hotend.thermistor_pin ​0.23 +
-temperature_control.hotend.pt100linear ​   0            # use 0 for RDT curve (alpha/​beta ​values+
-temperature_control.hotend.pt100_a ​       0.0039083 ​   # PT100 ALPHA value +
-temperature_control.hotend.pt100_b ​       0.0000005775 # PT100 BETA value +
-temperature_control.hotend.pt100_r0 ​      ​100 ​         # resistance at 0C +
-temperature_control.hotend.pt100_amptype ​ 0            # type of RTD amp, attm only 0 supported (0 is e3d pt100 amp) +
- +
-# coefficients for the ADC to Rt formula +
-# q1 * ADC_VALUE ​( Q2 - Q3 * ADC_VALUE) +
-temperature_control.hotend.pt100_q1 ​ 810000 +
-temperature_control.hotend.pt100_q2 ​ 45409000 +
-temperature_control.hotend.pt100_q3 ​ 280 +
- +
-# coefficients that are also known to work with E3D amp: +
-#​temperature_control.hotend.pt100_q1 ​           11000000 +
-#​temperature_control.hotend.pt100_q2 ​           606888919 +
-#​temperature_control.hotend.pt100_q3 ​           2500 +
-[[/code]] +
- +
-== Technical details +
- +
-Too technical for the wiki, greyed for now, please transform this into more digestible/​usage-oriented documentation above ^ +
- +
-[[[div]|style="​color:​grey;"​]]+
  
 <callout type="​danger"​ icon="​true">​ <callout type="​danger"​ icon="​true">​
-**NOTE** that PT100 is not currently supported in edge firmware, there is pull request https://​github.com/​Smoothieware/​Smoothieware/​pull/​1034 that needs to be tested. +You **must** use spare ADC pin to connect the amplifier signal; you **cannot** use a thermistor input due to the pull-up that is already ​on the board. On most boards ​that means either 1.30 or 1.31, depending on what is more convenient.
-**NOTE** The PT100 amplifier needs to be powered from the AVCC and AGND header pins on the smoothieboard,​ only newer boards ​have this headerDO NOT power from 5v or you will kill the port+
 </​callout>​ </​callout>​
- 
- ​Platinum Resistance Thermometers (PRT) are often manufactured of coiled platinum wire or as film thermometers with a layer of platinum applied on non conductive substrates. They are used in the range -200°C ≤ t ≤ 850°C. Outer these bounds polynomial approximation is not assured and higher temperatures are often problematic for proper use. PRT sensors are differentiated by their specific electrical resistance R0 at 0°C. Common types are: 
-* Pt100 (R0 = 100Ω) 
-* Pt200 (R0 = 200Ω) 
-* Pt500 (R0 = 500Ω) 
-* Pt1000 (R0 = 1000Ω) 
-* Pt3000 (R0 = 3000Ω) 
-* Pt6000 (R0 = 6000Ω) 
-* Pt9000 (R0 = 9000Ω) 
- 
-Resistance of the sensor can be converted to temperature for the respective PRT type. Tolerances according to DIN IEC 751/DIN EN 60751 (1995) ([[http://​www.code10.info/​index.php?​option=com_content&​view=article&​id=82:​measuring-temperature-platinum-resistance-thermometers&​catid=60:​temperature&​Itemid=83]|data from here]) are: 
- 
-* Class A: ±(0.15 + 0.002*|ϑ|) °C 
-* Class B: ±(0.30 + 0.005*|ϑ|) °C 
-* Class C: ±(1.20 + 0.005*|ϑ|) °C 
-* Class 1/3: ±[[1/​3*(0.3]|+ 0.005*|ϑ|)] °C 
-* Class 1/5: ±[[1/​5*]|(0.3 + 0.005*|ϑ|)] °C 
-* Class 1/10: ±[[1/​10*(0.3+]|0.005*|ϑ|)] °C  
- 
-Resistance / Temperature curve for PT100 comes from this formula 
- **Rt = R0 * (1 + A* t + B*t2 + C*(t-100)* t3)** 
- 
-Where: 
- Rt is the resistance at temperature t 
- R0 is the resistance at 0 °C, and 
- A= 3.9083 E–3 
- B = –5.775 E–7 
- C = –4.183 E–12 (below 0 °C), or 
- C = 0 (above 0 °C) 
- 
-We assume C = 0 since we don't care about sub zero temps for 3D printing 
- 
-So resulting formula is: 
- **T = (SQRT(A^2*R0 +4*B*(Rt – R0)) - A*SQRT(R0)) / (2*B*SQRT(R0))** 
- 
-pt100 type of sensor implementation support 2 different approaches of reading the temperature from the PT100 sensor. 
- 
-These implementations are select with pt100linear and it can be 0 or 1. In case pt100linear is 1 (default value) class will use a simple line formula ​ 
- 
-T = slope * ADC + yintersect 
- 
-so you need to find a sweet spot for your setup to get a minimal error in the range of temperatures you are using. ​ 
-In a non linearized PT100 amp circuit (for e.g. just measuring voltage across the PT100 that's conducting constant current) this linear function will be precise inside +-2°C in a 60C range, meaning that in 200-260C for e.g. you can have 2 °C reading error. Should be acceptable in 3D printing. Now on the other hand, if you are using non linear amplification linearizing the RTD curve on the input (for e.g. E3D is trying to do that with their PT100 amplifier) the the error is even lower. For e.g. with this approach, reading E3D amp we get below 3 °C error on 150-280C range and less 1 °C error on the 60 °C range. 
- 
-There are 2 more parameters that does not depend on the linearity of the read. "​ampmod1_pin"​ and "​ampmod2_pin"​ values are used for energizing the PT100. When you are pushing current trough PT100 it self heats and you get a wrong read. Some solutions use 2 mcu pins to energize the PT100 so if you configure these 2 pins they will go HIGH while reading the temperature and then back low. You can configure only one or both or neither. By default they are nc. 
- 
-to configure this linear readout of the PT100 sensor setup the sensor type to pt100, pt100linear value to 1 and configure slope and yintersect. 
- 
- 
-[[code]] 
-temperature_control.hotend.enable ​             true 
-temperature_control.hotend.sensor ​             pt100 
-temperature_control.hotend.pt100linear ​        1 
-temperature_control.hotend.thermistor_pin ​     0.23 
-temperature_control.hotend.ampmod1_pin ​        nc 
-temperature_control.hotend.ampmod2_pin ​        nc 
-temperature_control.hotend.slope ​              ​0.0523809524 #slope for e3d pt100 amp 
-temperature_control.hotend.yintercept ​        ​-299.6 ​       #yintercept for e3d pt100 amp 
-[[/code]] 
- 
-The second approach, where we read RTD sensor that's amplified using "​linear"​ amplifier so we get the curvature characteristic to RTD the pt100linear parameter should be 0. 
- 
-This type of readout is configured in 2 set of parameters. First set of parameters define A, B and R0 of your RTD. For e.g. if your using IPTS-68 then 
-A = +3.90802E-03 
-B = -5.80195E-07 
- 
-on the other hand if you are using ITS-90 then 
-A = +3.9083E-03 
-B = -5.7750E-07 
- 
-These parameters are configured using pt100_a and pt100_b parameters. You also need to configure pt100_r0 that is your r0 value (100 for PT100). 
- 
-With A, B and R0 we can convert resistance to temperature,​ but now we need a second set of parameters to convert our ADC value to resistance. 
-Different amplification types can be selected using pt100_amptype parameter (at the moment of this writing only 1 amp is supported, value is 0). 
-The initial amp that's implemented covers most of the amplifier out there including e3d pt100 amp. Use value 0 for it. It needs 3 coefficients and it's calculating resistance from ADC using following formula: 
- 
-Rt =  Q1 * adc_value / (Q2 - Q3 * adc_value) 
- 
-E3D values are 
-Q1: 805200 
-Q2: 45409000 
-Q3: 183    ​ 
- 
-but since this is tracing (expecting) a proper RTD curve and not straightened curve that E3D amp is making the errors start to be significant at higher temp values. 
- 
-Example configuration:​ 
- 
-[[code]] 
-temperature_control.hotend.thermistor_pin 0.23 
-temperature_control.hotend.pt100linear ​   0            # use 0 for RDT curve (alpha/beta values) 
-temperature_control.hotend.pt100_a ​       0.0039083 ​   # PT100 ALPHA value 
-temperature_control.hotend.pt100_b ​       0.0000005775 # PT100 BETA value 
-temperature_control.hotend.pt100_r0 ​      ​100 ​         # resistance at 0C 
-temperature_control.hotend.pt100_amptype ​ 0            # type of RTD amp, attm only 0 supported (0 is e3d pt100 amp) 
- 
-# quoeficients for the ADC to Rt formula 
-# q1 * ADC_VALUE / ( Q2 - Q3 * ADC_VALUE) 
-temperature_control.hotend.pt100_q1 ​ 810000 
-temperature_control.hotend.pt100_q2 ​ 45409000 
-temperature_control.hotend.pt100_q3 ​ 280 
-[[/code]] 
- 
-[[http://​smoothieware.org/​local--files/​3d-printer-guide/​PT100%20E3D.ods]|spreadsheet with info and help to setup and test coefficients] 
-