PT100 with amp board  

Page 1 / 4
  RSS
william.t14
(@william-t14)
Active Member

Guys i need help. I have been trying to add the PT100 with AMP board from E3D and it is giving me fits. 

Per the Einsy wiki page I need to change the element type, and the code shown on the page is for

"Set the right temp sensor type in Configuration.h or Configuration_prusa.h:

#define TEMP_SENSOR_0 20 //PT100
#define TEMP_SENSOR_0 -1 //Thermocouple with AD595

Remap pins_EINSYRAMBO.h or pins_Einsy_1_0.h

#define TEMP_0_PIN           8"

The firmware comes with the option already for this set up in Configuration_prusa:

"// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
#define E3D_PT100_EXTRUDER_WITH_AMP (I uncommented this)
//#define E3D_PT100_EXTRUDER_NO_AMP
//#define E3D_PT100_BED_WITH_AMP
//#define E3D_PT100_BED_NO_AMP"

And the Section where this is selected has
"#if defined(E3D_PT100_EXTRUDER_WITH_AMP)
#define TEMP_SENSOR_0 247
#elif defined(E3D_PT100_EXTRUDER_NO_AMP)
#define TEMP_SENSOR_0 148
#else
#define TEMP_SENSOR_0 20 // was 5 ( I was trying other numbers)
#endif"

I have tried every variation with AMP board connected, just the PT100, none, etc
and the reading continues to indicate 1062.... using my changes to the firmware

I flash Custom firmware (for the BMG extruder) and it reads 111
I flash Prusa 3.7.1 and it reads 116

It has to be something in the firmware but I have no idea beyond the brief instructions where to look....


This topic was modified 4 months ago by william.t14
Posted : 25/05/2019 1:54 am
guy.k2
(@guy-k2)
Noble Member
// Uncomment the below for the E3D PT100 temperature sensor (with or without PT100 Amplifier)
#define E3D_PT100_EXTRUDER_WITH_AMP

Already sets up the TEMP_SENSOR0 number for various values depending on the defines. I would not change those.
#define TEMP_0_PIN 8

seems correct, I'm assuming the quote was added by this new forum.
Posted : 25/05/2019 1:17 pm
william.t14
(@william-t14)
Active Member

Thanks for the response. The quotes are mine. I was trying to differential the code from my post. 

That is what is so strange.... I uncommented that line as it is already programmed but cannot get the PT100 to read. I have 2 PT100s (by accident) and both show the same thing. Unless the board is bad. I don't know enough about using a voltmeter to check the signal, etc.

But just plugging the PT100 in without the board gets the same thing. Then I plug the original thermistor  in and it reads fine. Same firmware setup..

I noticed in one of the firmware folders a fan is listed with pin 8, but the pin folder does not have a pin 8 assigned. I thought if there was a conflict compiling the firmware would identify that.

Other than that I am at a total loss as to what to do next.

 

Posted : 25/05/2019 3:11 pm
guy.k2
(@guy-k2)
Noble Member

Looking here https://github.com/KevinOConnor/klipper/issues/1337

It looks like pin 8 has a pull up resistor that will interfere with the amplifier signal.

Pin 10 of header P3 apparently does not.

I would specify pin 10 in the firmware and move the amplifier connection to that pin.

Posted : 25/05/2019 7:11 pm
william.t14
(@william-t14)
Active Member

AWESOME on it...

Wait, Shoot.... isn't the IR sensor using Pin 10? I wonder if they can be switched.

This post was modified 4 months ago by william.t14
Posted : 25/05/2019 9:14 pm
william.t14
(@william-t14)
Active Member

So interesting, as I look at the pin config in the firmware and I see this:

#define SWI2C_SDA 20 //SDA on P3 
#define SWI2C_SCL 21 //SCL on P3

what is SWI2C?

and 

define IR_SENSOR_PIN 62 //idler sensor @PK0 (digital pin 62/A8)

From the P3 pin out: 

Pin 6  20 (SDA) What is SDA?

Pin 8 21 (SCL) What is SCL?

Pin 10 62 (PKO) What is PKO?

So those three pins are already used by something else?

Is there a difference if I use pin 8 also known as 21? 

Posted : 25/05/2019 9:42 pm
guy.k2
(@guy-k2)
Noble Member

You need an ADC input of the MCU. Look at the circuit diagram at https://github.com/ultimachine/Einsy-Rambo/blob/1.1a/board/Project%20Outputs/Schematic%20Prints_Einsy%20Rambo_1.1a.PDF

They are on PK0 to PK7 of the MCU. None of the other pins will work. Finding one that isn't connected to something already is going to be the solution. Sorry, I don't have time to trace one out for you right now.

Posted : 25/05/2019 10:04 pm
william.t14
(@william-t14)
Active Member

I am eatremely appreciative of your help. I will see if I can figure it out. 

Posted : 25/05/2019 10:44 pm
guy.k2
(@guy-k2)
Noble Member

Not a lot of ADC options that are not already in use. Many are tied up with monitoring the TMC2130's.

There may be two on an LCD port, but I don't know if they are used for anything on the LCD (I can't imagine what for)

Lacking that, tracing down and desoldering the 4.7 resistor on the normal thermistor input would also be an option if one had surface mount rework capability.

Posted : 26/05/2019 2:06 pm
william.t14
(@william-t14)
Active Member

The instructions say use pin 8. But that does not seem to work. I know so very little about interpreting the schematics, etc and what the abbreviations mean.

Ah ha google fu is working today. SCL means clock signal, and SDA means signal. So would pin 6 be a better choice?

When reading the drawing, which pin number do I use? There are 2 listed......

Posted : 26/05/2019 4:25 pm
guy.k2
(@guy-k2)
Noble Member

No can't use the SDA or SCL pins. Those are digital signal lines, not analog inputs. You can't connect an analog signal from your amplifier to a digital line. It MUST be a ADC (analog to digital conversion) pin of the MCU that is not connected to anything.

There are 16 total ADC lines on the MCU. The only one I can see that is natively unused is the PK0. That would have been OK on a MK3, but on the MK3S, they use that up for the new filament sensor. That leaves you NO ADC inputs to use with your amplifier. The only solution that would create a usable ADC input on the MK3S is to desolder some components on THERM 0 to change it into a raw ADC input rather than a thermistor circuit. Unfortunately, I'm afraid that is not an option if you have difficulty even reading schematics.

TLDR - no you cannot use the PT100 amplifier with an MK3S without desoldering surface mount components.

Yes, you could use it on a MK3 because the MK3 had PK0 ADC input available. 

 

This post was modified 4 months ago by guy.k2
Posted : 26/05/2019 5:27 pm
william.t14
(@william-t14)
Active Member

I am learning!

Again thanks so much for your help. I followed your great work on the VFAs thread with interest. I am thinking of incorporating those motors on my printer.

That pointedly sums it up. No can do for now:) 

Posted : 26/05/2019 5:31 pm
guy.k2
(@guy-k2)
Noble Member

Sorry I didn't find better news for you. I checked all 16 ADC inputs on the schematic. Only PK0 would natively work.

There is ONE possible way out without soldering. Probably could run MK3 firmware with filament sensor unplugged and turned off in your settings. That would free up PK0 (logical pin 8) and let you connect the amplifier. You completely lose the filament sensor, though.

Only hitch... I don't know if an MK3S Z-axis length will pass MK3 Z-axis calibration

 

Posted : 26/05/2019 5:50 pm
guy.k2
(@guy-k2)
Noble Member

For completeness sake, this is what I would do to convert THERM0 thermistor input into a usable ADC input. The problem is the 4.7k pull up resistor that will pull voltage up to VCC. We don't want that to happen on a voltage input. Removing the pull up resistor should remove that bias. The THERM0 circuitry also has some protection zeners and 2K resistors, but that leaving those in situ should still let it work as a voltage input instead of a resistance input. There could still be an impedance mismatch, but I will bet the PT100 output is happy feeding a 4k impedance input.

In firmware, it would be Pin 0.

Here is the diagram with the mod. Unfortunately, nano-tweezers would be the ideal tool for removing the sub-millimeter resistor. Do you have a friend who can do board level work? It is doable with the right equipment (I pull SMD components off board for reuse).

This post was modified 4 months ago 2 times by guy.k2
Posted : 27/05/2019 7:15 am
chocki
(@chocki)
Reputable Member

Seeing how the PT100 amp board has a 100 Ohm resistor in the output line to limit the current, if you put another 4k7 resistor from the output to ground you would end up with a swing from 0.1 to 4.9 v instead of the 0 to 5v on the THERM0 input, maybe with a tweak to the Prusa firmware limits this would be good enough?, this way you would not need to modify the Einsy board.

Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet....
Posted : 27/05/2019 8:21 pm
guy.k2
(@guy-k2)
Noble Member

That's a decent idea to modify the amp instead of the EINSY.

Amps' 100 ohm output impedance vs the higher THERM0 impedance would win.

Could even do a mult-turn 5K pot rather than a fixed 4.7 so one could balance out the EINSY's 4.7 more accurately. Add resistor, measure voltage on THERM0 with multimeter and trim to 2.5 volts.

The slightly reduced swing amplitude could probably be worked around by specifying slightly different target temperatures in filament settings.

 

Posted : 27/05/2019 9:00 pm
william.t14
(@william-t14)
Active Member

You guys rock. 

Posted : 28/05/2019 11:42 pm
Vojtěch
(@vojtech-p6)
Honorable Member

@chocki @guy-k2 I don't see how you could make your idea work with the two 2k37 resistors in series with the input. They increase the input impedance to 4.7k, same as the pullup.

But then, over the whole thermistor range (0-120kΩ), the ADC will see 2.5-5V input. That's with a thermistor. If the amplifier has 0V-5V output, it'll be able to generate the same range at the ADC, so no modifications other than changing the curve parameters in the firmware should be needed.

And, by the way, BAT54 is a Schottky, not a Zener. Not that it matters in this case, but it's a problematic design choice on the Einsy.

 

Posted : 29/05/2019 12:26 am
guy.k2
(@guy-k2)
Noble Member

It would at least neutralize the bias towards Vcc. IIRC Atmega ADC input impedance is in the 10 Meg range, making it essentially a voltage input. The 4K in series with the input should be insignificant. Is the amp not able to generate enough voltage swing in the face of a 4K load? If not, then we're back to pulling the resistor and possibly the diodes should that prove insufficient.

Posted : 29/05/2019 1:28 am
chocki
(@chocki)
Reputable Member

I checked it using SPICE to simulate the signals also the amp swings rail to rail according to the spec sheet for it.

From spice the swing is from 0.8 to 4.2, but I'm erring on the worse to allow for tolerance variation.

Now the output characteristics for this board are as follows:

http://wiki.e3d-online.com/wiki/E3D_PT100_Amplifier_Documentation#Output_Characteristics

So it will never reach 5v output, in fact due to the maximum temperature setting for PT100 configuration being 410 Deg C, the maximum voltage would only be approx 2.7v and between 1 Deg C and 400V C we only really see a 1.55v swing, which is not ideal to begin with, let alone adding additional resistors and further reducing the swing range!.

As is this corresponds to line 1130 of this thermistor table which is for an analog input without a 4.7k pull up resistor

https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/thermistortables.h

It is beginning to look like the PT100 amplifier board as is, is not ideally suited to begin with for accurate temperature sensing over the range a Prusa Printer is designed to work over (MAX 410 Deg C hot end), and using an unmodified thermistor input with this PT100 amp board is not really going to be good enough.

Maybe if the amplifier gain which is only 1.9 were improved, say by replacing R5 5k49 resistor with a 2k2 to give a gain of 3.25 which would limit the amp to about 500 Deg C maximum reading, may be better, but would also require a new lookup table in firmware, but would still be better without the pull up resistor.

This post was modified 4 months ago by chocki
Normal people believe that if it ain’t broke, don’t fix it. Engineers believe that if it ain’t broke, it doesn’t have enough features yet....
Posted : 29/05/2019 10:57 am
Page 1 / 4
Share:

Please Login or Register