Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Fryer Controller using PIC18F4620

Status
Not open for further replies.
Fuzzy logic and model based control is NOT one of my strong points and I didn't dabble in auto-tuning of the PID loops either, but I manually tuned enough of them. In that respect, fuzzy logic might be easier.
 
Just my opinion but I think a digital type control system such as one using Fuzzy Logic is more appropriate for a microprocessor that PI or PID, which is basically using a microprocessor to simulate an analog control loop. You said you did this 20 years ago, likely as an analog loop. The problem with PI(D), as you noted, is that determinng the PID circuit gain and time constants required to prevent oscillations and generate a stable system is difficult, especially if you don't know the system response times and gains, as is the case here. It's easier to determine the needed control parameters in a Fuzzy Logic loop, more obvious how to tweak the loop if it's not working properly, and things like preventing integrator windup are not a concern. The Fuzzy program basically consists of a series of simple If-Then-Else loops, something that a microprocessor readily performs.

Since I'm new with this I would prefer Fuzzy Logic for an easier approach.

I'm suggesting a commercial 5V power supply and a commercial 24 V PS just to prove a point. Tap into the circuit at the proper spots and probably your problems will go away.
Your then left with a few bypass caps and one suggested BW limiting cap. Most of the complaints were power supply related. I'd start there.

I have no idea what the requirements are, but this is the idea: https://www.automationdirect.com/ad...l power supply&utm_campaign=dc+power+supplies if you don't have a lab supply.

Linear supplies are usually out of favor these says.

Bypass caps are a part of good design, but most of the time they don't break one. An EMI filter may be regulatory and basically prevents the PIC oscillator from radiating into the power line and stuff nearby from getting in.

That transistor didn't look right, but I concentrated on the other stuff.

It wouldn't be so bad if you could say it needs a new power supply, would it?

Other stuff, like surge suppressors add cost, but contribute to reliability and insurance issues. It's one think if my french fries aren't done and quite another if the gas valve sticks.

Yes, I don't have yet a personal power supply since I'm only limited with the previous designer's leftovers so I will request for one.

Okay so I will find another substitute for 7805. Will LDO regulators be fine?

Then I would be more into programming and just few adjustments on the circuit.

Thanks, so does this mean that you agree with the RTD sensor circuit and will retain it in the design? I really don't have any idea how the previous designer came up with such a circuit. I can't see any of it on the web. Also, I don't have any idea about different OP-AMPS configurations so I think it might be a problem at the end if this one is causing the problem.
 
Last edited:
You want to quickly determine if the power supply is at fault, so if you need a 5V and a 24 V power supply controlled by a single outlet strip to do so, so what? The point is, it's quick. Do you have to worry about power supply sequencing...don't know.

Just get it out of the way.

Actual solutions come later. A quick look around, this http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=102-1959-6-ND seems promising (500 mA), but the input voltage required has tighter specs. I don't know your power requirements.

The problem is the very high input/output voltage differential and the tricks the designer used to solve it. A pre-regulator that doesn't work, diode drops etc. You also effectively have a "line regulated" power supply for the temperature sensor. Both are bad, but you have to prove it. An LDO regulator is probably not appropriate.

Thermister circuit: I haven't looked at it detail. Went for the bigger fish, first.

Yep, I think you identified a temperature measurement issue and one part of it is electrical.
 
The RTD circuit basically amplifies a reference. The gain is variable and probably non-linear. Then it's amplified again and attenuated. The non-linearity will be an issue.

This **broken link removed** is the simplest thermister circuit, but note it is ratiometric.
 
Here are some Fuzzy Logic references:
http://www.fuzzy-logic.com/
**broken link removed**,

Thanks for that.

The RTD circuit basically amplifies a reference. The gain is variable and probably non-linear. Then it's amplified again and attenuated. The non-linearity will be an issue.

This **broken link removed** is the simplest thermister circuit, but note it is ratiometric.

What do you mean non-linear?

You want to quickly determine if the power supply is at fault, so if you need a 5V and a 24 V power supply controlled by a single outlet strip to do so, so what? The point is, it's quick. Do you have to worry about power supply sequencing...don't know.

Just get it out of the way.

Actual solutions come later. A quick look around, this http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=102-1959-6-ND seems promising (500 mA), but the input voltage required has tighter specs. I don't know your power requirements.

The problem is the very high input/output voltage differential and the tricks the designer used to solve it. A pre-regulator that doesn't work, diode drops etc. You also effectively have a "line regulated" power supply for the temperature sensor. Both are bad, but you have to prove it. An LDO regulator is probably not appropriate.

Thermister circuit: I haven't looked at it detail. Went for the bigger fish, first.

Yep, I think you identified a temperature measurement issue and one part of it is electrical.

The circuit only needs 800mA. Well I really guess I should first filter the unnecessary signals. I'm thinking about using switching regulator before my 7805 regulator.
 
Last edited:
The MAXIM note shows the temp/resistance curve. The post also said, that a parallel resistance can be used to linearize it. Do you have calibration instructions for the thermister circuit?

This note **broken link removed** , (link probably won't work) although the product isn't available, it's useful to look at the bridge circuit. Goto lattice and search for isppac30 and it's on the second page, with "thermister...

The linear regulator after a switching regulator won't likely work. It's too slow.
 
Thanks for the link. I was thinking before if it would be possible to use parallel circuit and I'm pretty confident now that it's doable. Aside from that I think another option is to go also for an OP-AMP for linearization. I might change the circuit then again because I find it not so apropriate. I don't know if applying linearization on micro-controller's software is easier than the hardware designing using OP-AMP.

I was wrong before that the input is 24 Vdc, I tested it in a multimeter and it was 24 Vac. The circuit I've posted is slightly different with his PCB because he added rectifier diodes for converting 24Vac to 24Vdc. The TIP31C NPN's emitter is connected to the input of 7805 while the collector is connected to the rectifier's output. He neglected the 12 diodes in series which is supposedly used to reduce the voltage.

The linear regulator after a switching regulator won't likely work. It's too slow.
what do you mean slow?
 
Last edited:
I picked the LM317T which, I belive, is similar to the 7805 except adjusttible. If you look at the data sheet and the transient response curves https://www.electro-tech-online.com/custompdfs/2011/07/LM117-1.pdf, you essentially see there is almost no regulation for uS signals. Switching regulators can operate from say 20 kHz to 1 MHz and probably outside that range. Using a linear regulator after a switching supply is like trying to ask an audio amplifier to amplify RF frequencies. It won't happen. The high frequencies just pass right through because the regulator won't respond to the change.
 
I picked the LM317T which, I belive, is similar to the 7805 except adjusttible. If you look at the data sheet and the transient response curves https://www.electro-tech-online.com/custompdfs/2011/07/LM117-2.pdf, you essentially see there is almost no regulation for uS signals. Switching regulators can operate from say 20 kHz to 1 MHz and probably outside that range. Using a linear regulator after a switching supply is like trying to ask an audio amplifier to amplify RF frequencies. It won't happen. The high frequencies just pass right through because the regulator won't respond to the change.
If you look at the Ripple Rejection graph on page 7, it shows about -18dB rejection at 1MHz and increases below that frequency (for example -40dB at 100kHz), with a 10µF filter cap on the Adj pin. While not great, it is a significant rejection.
 
Thanks for the suggestion, why did you choose LM317T? Sorry I don't have idea what we are avoiding in the design. Is it the noise?
 
They are very similar, but I should have used the 7805. The 7805 has a max input of 35 VDC. There is a LM317HV that can tolerate a 57 V input.

You said something like you needed 800 mA. . The above regulators need 3V more than what they are regulating. So, 9V DC would be good with a safety margin. With 24 V to 5 V. The regulator has to drop 19V. 19*0.8 = 15.2 Watts. That isn't good for lots of reasons. So far, the 5V is not being used for the sensor, so it doesn't have to be really clean. In any event if it was, you would use a reference, not a voltage regulator.

1) The option currently being used is stupid.
2) Use a dual secondary custom transformer and use two linear regulators (old school)
3) Switching regulators

You can buy off the shelf 24 VDC open frame power supplies. You can buy relatively small 24 VDC DIN rail mounted supplies because they are typically used in industry.

Start calculating the amount of energy a customer would save based on running 16 hrs per day, where 15 W is not going anywhere and being wasted.

Get the power supply ruled in as part of the problem quickly.
 
Yes you're right I should check the power that can be wasted since our product should be efficient.

I was wrong. You're all along right K.I.S.S. my sensor probe is a thermistor. It's just hard to find its datasheet. I tested it at 25°C and it is 100k ohms. When I rub the end part of the probe then the resistance decreases. I have observed that the circuit made by the previous designer is not appropriate to the sensor probe. Maybe he used a RTD circuit for this sensor probe.
 
There is only a few curves and few points like 100K at 25 deg C. Check a few temperatures using this table: https://www.electro-tech-online.com/custompdfs/2011/07/RTD-Thermistor_Z202030-0N.pdf

RTD's are almost universally 100 ohms at 25 C and there are a few curves for them too.

The circuit is more suitable for a thermister interface. Just not sure how your supposed to calibrate it.

Usually you have gain and span controls. Span looks like it's the pot that's in parallel with the sensor and gain is the pot later in the circuit. And yes, they seem interrelated.

I believe it does mean if you measure to the input of the last divider at a fixed temp and set that voltage and then set the divider voltage, it's a two point calibration. The effect of the parallel resistor will help linearize the sensor. You CANNOT, in this circuit, use the table data directly because it's the curve, it's accuracy, the fixed and variable resistor temperature coefficients and the parallel combination of the curve and the fixed resistor.
 
The circuit is more suitable for a thermister interface. Just not sure how your supposed to calibrate it.

Usually you have gain and span controls. Span looks like it's the pot that's in parallel with the sensor and gain is the pot later in the circuit. And yes, they seem interrelated.

I believe it does mean if you measure to the input of the last divider at a fixed temp and set that voltage and then set the divider voltage, it's a two point calibration. The effect of the parallel resistor will help linearize the sensor. You CANNOT, in this circuit, use the table data directly because it's the curve, it's accuracy, the fixed and variable resistor temperature coefficients and the parallel combination of the curve and the fixed resistor.

To what circuit are you referring to?
 
Yes, I'm adjusting them too. But I think the circuit is still not appropriate. Do you know where I can simulate a 100k @25°C Thermistor? Is it available on PSpice?
 
Thanks K.I.S.S. but I already read this one yesterday but didn't helped a lot. Well I guess I have to search for more and be back here again when I have a circuit already. I'll just make a new thread specifically just for the sensor circuit alone since this thread's label is too general.

Thanks again :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top