Friday, May 08, 2015

Fransk middag

Venter på Cajun-mat på Cane & Table i New Orleans.

Friday, February 06, 2015

Vellykket

Fra skeptisk til overbevist. Fritzing kretskortproduksjon var både enkelt, relativt billig og av god kvalitet.

Tuesday, July 02, 2013

RIP Google Reader

We will miss you!

Sunday, October 28, 2012

Wednesday, December 21, 2011

Lo tech decoding

Solution to optional exercise in Stanford's "Introduction to Artificial Intelligence". No need for computers...

Tuesday, November 01, 2011

Hot plate PI controller - Part 5: Boiling water and measuring with thermistor

I made a new mistake in my attempt to make a hot plate PI controller: The thermistor I selected from eBay was an unbranded China thermistor marked with "10k ohm 103 NTC Thermistor"with no datasheet. I thought it would be easy to obtain the datas for the thermistor, but so far I have not been able to find any other info than what the seller is saying:

Model: CP_RM_103 NTC Thermistor
Resistance: 10KΩ
Resistance tolerance: +/- 10%
Temperature: 30°C to +125°C

I have sent an email to the seller as a last effort to get a datasheet for the thermistor, but I have doubts that I will get it.

I wanted to set up a test to check the accuracy of the thermistor in combination with the pre set parameters in the arduino library for thermistors. I soldered a wire to the thermistor, filled a pot with 1 liter of spring water, submerged the thermistor and boiled the water. When boiling temperature 100°C is reached the chart for temperature with stabilize at 100 degrees as water is vaporized.

First some theory:
Thermodynamics has equations describing how a volume will be heated. When there is no flow in or out of the volume the heating equation reduce to:

Cp*ρ*V*dT/dt=P+h(T0-T)

Where
Cp is specific heat capacity. For water Cp=4181.3 J/(kg*K)
ρ is the density. For water ρ=1000 kg/m^3
V is the volume. For my experiment I use 1 liter=1e-3 m^3
T is the temperature in the volume.
T0 is the temperature of the neighboring. The air temperature is about 22°C
P is the power of the heating source. I use two different boiling plates with 1.4 and 1.5 kW
h is the heat conduction number

If no energy is transferred to the environment with no other losses whatsoever I get:
Δt=Cp*ρ*V*ΔT/P

I am using two different hot plates:
1. A 1.5 kW standard hot plate. Ideal time for boiling 1l water should be 262 seconds, about 4 minutes.
2. A 1.4 kW induction hot plate. Ideal time for boiling 1l water should be 281 seconds, about 4,5 minutes.

The ideal heating time is based on the tap water being 6°C.

After modifying the LabVIEW VIs used with the thermistor and servo to also save raw voltage data to disk and importing to excel I get these curves:





A couple of things can be observed from the charts:
  1. The heating curve for the induction hot plate is very erratic. This is likely because induction is basically fast alternating current through a coil. This creates a magnetic field that again induces current in the sensor wire. If better results are to be obtained with an induction cooker I need a shielded thermistor.
  2. Both measured heating curves for the induction and standard hot plate has a measured boiling temperature of about 110°C. This is probably due to wrong values for this sensor set for the Steinhart-Hart equation.
  3. The zero crossing with the y-axis is above the temperature of the tap water temperature. This is again probably due to wrong values in the Steinhart-Hart equation.
  4. Some drops are observed for the standard hot plate. This is due to different temperatures when the thermistor touched the pot and when it was only in contact with water.
  5. The slope for the induction cooker is very close to the ideal curve, thus the induction cooker is very efficient at transfering energy into cooking water.
  6. The induction hot plate and pot can be modeled as an integrator without time delay. The standard hot plate can probably be modeled as an integrator with a time delay included. When heating a larger amount of water I am expecting more energy to be transfered to the environment, and  the curves will probably take the shape of a "time-constant with time-delay" process.
Now I need to search a little more to try finding some information about the sensor specs. This in combination with the measured curves will probably give me everything I need to know to calibrate the thermistor.

Hot plate PI controller - Part 4: Playing with thermistor, RC servo and LabVIEW with arduino library


In my previous post I wrote that I wanted to use LabVIEW in combination with an additional Arduino library and the Arduino device to work as a controller. LabVIEW has library for both fuzzy and PID controllers.

I have been testing the LabVIEW PID library in combination with the Arduino library while waiting for my thermistors to arrive. My first test was to use a potmeter as an input for a PID controller setpoint and use a simulated plant to test the PID functionality. I tested the PID relay autotuner, which is a tuner that uses on/off signals to test the plant response. I have previously used relay autotuners successfully to set PID controllers with microcontrollers. The autotuner function in the LabVIEW PID library seems to be more sensitive to having a working PID controller before trying to excite the plant with on/off signals. My experience with the library is that this results in a poorly tuned controller. My plan is to use the step response for the plant to set the controller or make a relay based controller from scratch from my previous knowledge of the problem.

A few days back I finally got my 10k thermistors from eBay. The 10kohm value seems to be rather flexible with the LabVIEW Arduino library, and I cannot really understand why. I thought that the equation used, the Steinhart-Hart thermistor equation, needs three parameters A, B and C set that is allready fixed in the Arduino thermistor read function.



I hooked up the thermistor as shown in the library included thermistor example and one servo as shown in the servo example. Pretty simple:




Next I mixed the two examples together so that the temperature from the thermistor would set the output for the servo. I multiply the temperature with 1.8 so that when I have 100 degrees C input I get a 180 degrees rotation of the servo. I also tested with different delays in the loop to remove some of the "spastic" behaviour you can get when the realtime signal is used.


I experienced a bit with moving the thermistor over a candle to check the system. Below is a video of the system in action:

Here is the output in LabVIEW with and without delay:

I am quite happy with setting this system up so quickly and with both input and output working as planned on the first run.

One thing I experience is that when I stop the LabVIEW program and restart it i get erratic behaviour of the servo. Perhaps because of the PWM output from the Arduino being out of sync with the servo. I need to pull out the USB plug from the computer a couple of times in order to make it work again. This all might have to do with me having an old Arduino or that I got black smoke coming out of it the last time I used it.

Coming up I will be soldering a wire to the thermistor, put it in boiling water and see if I get a reading of 100 degrees celcius. Otherwise I need to get better parameters for the thermistor function.