Go Down

Topic: Transistor high-impedance: possibly affecting entire board setup (Read 469 times) previous topic - next topic

lennon-pledge

For Mega 2560.
I am attaching a generalized "schematic" of my project so far.  I am not including 3 parts: an encoder (connected to interrupts 2 and 3 / 20 21, GND and 5V from Arduino), the 16x2 LCD I use on top of all the boards, and the 12V fan pushing air into the custom refrigerator (which is the project.)

I will provide code if need be, but this is more an electrical question than anything.

-----------

The way the ground lines are connected in the schematic is exactly how I have them wired on the board.

From the bottom - I power all the components with 12V, and the Arduino is regulated down to 5V.

I have a Trinamic TOS-100 Stepper motor controller on top of it, powered by the 12V (wherein the onboard TMC2660 chip requires 9V to operate.)

On top of the Trinamic is a custom board with 4 resistors, 1 transistor, and 2 capacitors.  
For the point of this topic, I would like to focus on 1 analog output, and 2 analog inputs.

The two analog inputs are used for the LM35 sensors I am using to monitor air temperature and plate temperature.  Their power and ground pins are wired to the same 5V and GND pin on the Arduino.  Their output goes through a low pass filter (R = 26.7kOhm, C = 0.1uF) into A2 and A3.  Each capacitor is wired to a ground pin separate of the one used for the sensors themselves.

The transistor (IRL530NS) is used to either allow or disallow the cool side of the Peliter sensor from receiving voltage (if that doesn't sound right, lingo-wise, could you reword it so I know how to voice it properly for the future, thanks!)  I have a 10k resistor acting as a pull-down for when the transistor goes into high impedance mode.

Finally, I'm using the PID looping method to, for example, bring ambient temperature of 22 degrees Celsius down to setpoint of 4 degrees.  When the PID reaches the equivalent output (produced using analogWrite(PIN_28)) in relation to the setpoint, the transistor goes into the high impedance..."turning off" the cool side.


Here's my issue.  When the PID is in the aggressive state, whereby it's driving its output down to the setpoint, my entire current draw from the 12V supply by the whole board is around 4.25 A.   When the transistor goes into high impedance, the current draw goes down to 0.4 A.  

As a result, the Trinamic board becomes inoperable (which is something I will hopefully address myself in the future) AND the LM35 analog input readings drop significantly.

Here's what happens to the sensor that is reading the air temperature (which I'm using as the Input factor for the PID):
1. Read about 4 degrees C - gets closer to mark
2. Reads a little below (~3.8) - passes setpoint, expectantly
3. Then the transistor goes to high impedance - current draw goes from 4.25 A to 0.4 A
4. The sensor then starts reading around 1.2 degrees C
5. PID algorithm now takes a long time to get back up to Setpoint - about 5 minutes of stepper motor inactivity.


Any thoughts as to why this happens, or how it can be fixed?  I have checked all the wiring on the board, and it checks out.  Is the transistor switching affecting all the other parts/pins?

Thanks, Anthony

MarkT

From that sketch its not clear where the high-current paths are - they must be kept well
away from the sensors and not go through the Arduino board at all.

Can you redraw with high current wires (including ground wires) shaded heavily?

Are you keeping the high current wiring as twisted pairs?  Its a very very good idea to do so,
always keeping a supply wire twisted together with its ground return, etc.  Open loops of
unpaired high current wiring are radiating magnetic interference all over the place.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Southpark

Here's my issue.  When the PID is in the aggressive state, whereby it's driving its output down to the setpoint, my entire current draw from the 12V supply by the whole board is around 4.25 A.   When the transistor goes into high impedance, the current draw goes down to 0.4 A. 

As a result, the Trinamic board becomes inoperable (which is something I will hopefully address myself in the future) AND the LM35 analog input readings drop significantly.
When the transistor goes into a high impedance state, and if the current is meant to flow through the transistor during low impedance state, then the high impedance state should translate to very small or zero current through the transistor, right?

You're saying you get 0.4 amp for high impedance state. So that's too much, right?

aarg

Quote
The transistor (IRL530NS) is used to either allow or disallow the cool side of the Peliter sensor from receiving voltage (if that doesn't sound right, lingo-wise, could you reword it so I know how to voice it properly for the future, thanks!)
The transistor (IRL530NS) is a low side switch to control current through the Peltier device.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

outsider

Sounds like your AREF voltage is changing when you drop the 4 Amp load, causing the VREF voltage and ADC result to change, is your Arduino being supplied from the same PS as the Peltier? Might try using the internal VREF.
Also, the Vout from LM35 at 4C is only 40 mV, I would use TMP36 with a 500 mV offset so 4C would be 540 mV to get your temp signal up out of the noise.
The TMP36s offset allows it to read temps below zero (down to -50C).
http://www.analog.com/en/products/analog-to-digital-converters/integrated-special-purpose-converters/digital-temperature-sensors/tmp36.html
Also also I would drop the gate R to 220R and move the 10K pulldown directly to the gate instead of behind the gate R.
Also also also, I see what @MarkT said, the current from the Mosfet source must go to the 12V - (ground), NOT to Arduino GND but you still need a connection fro 12V - to Arduino GND.

lennon-pledge

Are you keeping the high current wiring as twisted pairs?  Its a very very good idea to do so,
always keeping a supply wire twisted together with its ground return, etc.  Open loops of
unpaired high current wiring are radiating magnetic interference all over the place.
I'll make note of that in the future and apply it.  But no, I am not.  Previously, before I added the transistor portion of the circuit, I was just using the Trinamic + stepper motor, fan, LCD, 2 LM35's, the encoder, and the components for the LM35 analog readings.  On top of that, I previously just fed a wire from a digitalOutput pin on the Mega to the cool side of the Peltier without any components.  But all the wires were very loose and much longer than they are now. With the transistor, everything works the same up until the current drop. 




The transistor (IRL530NS) is a low side switch to control current through the Peltier device.
Thanks, sounds much better.


Sounds like your AREF voltage is changing when you drop the 4 Amp load, causing the VREF voltage and ADC result to change, is your Arduino being supplied from the same PS as the Peltier? Might try using the internal VREF.
I imagined it was changing too, but I don't know how to calculate (or measure accurately) the result of the change.  Yes, every component stems from the same 12V supply.  And when I read the analog signals from the sensors, I use (on the Mega) the INTERNAL1V1 1.1V aref.  Not the 5V.

I'll look into the TMP36, thanks for the suggestion.

And, I'm going to make those changes, see what happens, thanks.



As an overall update, the stepper motor now seems to run even when the current drops the way it does.  I don't know why I couldn't access the motor yesterday, but that part of it is fine for now.  It didn't de-latch in either scenario, so the cause/solution is very much up in the air.

MarkT

Remember wires are just resistors, albeit of low value, so that whenever large currents flow in wires,
voltages are generated - if the wire in question is part of a sensor circuit, you inject that voltage
in series with the sensor, which you don't want at all.  And rapidly switching high currents induce
voltages in nearby conductors too.

Don't share high current wiring with sensor circuits, especially ground wires (usually the voltage
reference for the sensor).
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up