Tuesday, 23 June 2015

Thor Calibration

Version 1.05 of Thor now supports Factory Calibration, this is  similar to the calibration procedure used for the SMP40's during production.

The calibration uses the F200 Precision Thermometer from ASL. The thermometer is connected to the Beagle computer using a cable made up of  1 USB to Serial converter and 1 Female to Female null modem cable, similar to the cable used for the Hurricane calibration.

You will need to set the connection device on the Thor settings screen , if you are using the USB-Serial converter, select ttyUSB0 as shown below:

Open the navigation side panel and select Calibration:

If you get an error, check you cable and connection setting. Also ensure that the F200 probe is inserted correctly, you're on channel 1, using Celsius.

Press start to begin the calibration which is fully automated and will take about 1 hour. When the calibration has finished the results screen will be shown allowing you to fill out a melting point calibration certificate.

Thor stores the calibration results on disk, the Auto Melt and Video Recorder screens display the calibrated temperature. The Heater Control screen uses the raw temperature from the SMP electronics.

Getting Good Calibration

The F200 probes are quite long with a lot of metal exposed to the air, this makes the probe less accurate and less precise due to stem losses. The probe will measure lower block temperatures and repeatability will be affected by the ambient air temperature.

To counter the stem losses you need to lag the probe with fibre glass wool, you may find some ceramic tubes with the F200 kit that can help to lag the probe. Also remove the white ceramic block as this exposes the part of the probe immediately above the block.

With good lagging, you should get repeatable calibration results that are within 0.1°C accuracy from 60 to 200°C.

Technical Details

The calibration is split into to stages Calibration and Verification. Both stages take take measurements at the following set points 60, 100 and 200°C.

When each set point is reached, the program will wait for 5 minutes to allow the temperature of the F200 probe to settle. After that 10 readings are taken over a minute and averaged.

The calibration will work out a quadratic equation to perfectly match the F200 and SMP50 temperatures.

During the verification stage, the calibrated SMP50 temperature will be used* and shown in the calibration results screen.

*The display will show the raw temperature from the SMP50, but the verification program will be using the calibrated temperature.

User Calibration

The SMP40 has 3 temperature calibrations and the SMP50 will be no different. The first calibration is an electronic resistance calibration and is performed on the heater PCB by the supplier.

The second calibration is the factory calibration performed by the production staff. The third calibration is an User Calibration. The user cal adjusts the temperatures after they've been adjusted by the factory calibration.

Thor does not support User Calibrations but the underlying software framework makes it easy to set the user calibration, see TemperatureControl.java

Wednesday, 17 June 2015

Auto Melt

Thor v1.04 now has the functionality to carry out a fully automated melting point measurement.

Follow the steps below to perform your own AutoMelt.

Check Camera Settings

Make sure that the auto exposure and auto white balance are manual/off. Remember to press the 'Send to Camera' button to send your new settings to the camera.

Also make sure your image is nice and bright.

See here for more details

Check Regions of Interest Settings

Make sure the regions of interest rectangles are similar to above, remember to press SAVE button to store the settings.

See here for more details:

Open Automelt

Press the Thor icon to open the navigation panel. On the navigation panel press Auto Melt.

Melt Settings

Salicylic acid melts around 160°C, best go 5°C either side, so set the start to 155°C and the end to 165°C. This means the measurement will begin at 155 and stop at 165°C.

If you check the 'Check to automatically stop when melted' box, there is no need to specify the end temperature as the software will automatically stop for you.

Press 'Start Melt'

Heat Stage

The heater will automatically begin to heat to your start temperature.

Press stop to stop the heater.

Plateau Temperature

The heater will settle around your start temperature for several minutes

Measurement Stage

The heater begins to ramp, video recording and image analysis begins.

Note if any tube is 'Undetected' check your region of interest settings (and remember to press SAVE!)


The image algorithm will know when the chemical begins to melt due to changes in the light levels inside each of the region of interest rectangles.


When liquid the image inside the region of interest rectangle is dark, the software will still continue analyzing for a few more minutes to be sure.


The AutoMelt algorithm has detected the chemical has now stopped melting, if you had checked the  'Check to automatically stop when melted' on the melting settings screen, the melting point measurement would now have stopped. If you didn't check the box, the melt will continue until the end temperature is reached.

Press STOP to end the melt early


Video stops recording, heater stops and cooling fan starts

Note down the measured temperatures in your note book. The temperatures represent the Clear Point where all solid matter has turned into liquid.

Video Playback

Review your video and visually check the Clear Point of each tube against those recorded in your note book. The AutoMelt algorithm is good to +/-0.1°C

Wednesday, 10 June 2015

Region of Interest

As of  Thor v1.04 there is a new Region Of Settings (ROI) screen. The region of interest is the area around a capillary tube in the image returned from the camera. Since there are 3 capillary tubes to measure there will need to be three ROI areas to set.

The precise position of the capillary tubes in relation of the camera is different for each melting point apparatus and so the ROI for each capillary tube will need to be manually set by the user before you can perform an automatic melting point.

You can access the ROI settings screen from the settings screen:

Wait a few seconds for the camera image to arrive

Above you can see the 3 tubes (white), a red, green and blue rectangle. Each rectangle can be moved by dragging the squares in the corners.

The idea is to drag the rectangles so that they hug their corresponding tubes:

When you are satisfied with each ROI setting, press the SAVE button. If you need to reset the ROI positions preset the reset button

Monday, 8 June 2015

Manual Melt Using Thor

Version 1.03 of Thor now includes video recording and playback, there is enough functionality to perform a melt.

1. Build Your Test Rig

Here I'm using a Chipsee Android computer, an SMP40, a USB camera and Salicylic Acid as my test chemical.

Take extra caution due to the chemicals, heat and electricity! Do not leave the test rig unattended.

2. Set up the Camera

Click here to find out how to turn off the auto-exposure and set the gain so that the image is bright.

This is what your image should look like

3. Set up the Heater

Salicyclic Acid melts at 158°C, so you need to set the heater to start ramping from 153°C

The heater will quickly heat to 153°C and then spend a few minutes settling, once settle the Plateau temperature is reached and you can then press the Ramp button to start raising the temperature at 1°C per minute.

4. Start Recording

Press the record button to start recording the video stream, the video streams a 640x480 image at 4 frames per second. Videos are stored in the Movies folder on the device.

5. Watch the Melt

The melt has finished when all the chemical solid has melted into its own liquid (the Clear Point).
Press Stop button, to stop recording and finish writing the video file.

6. Turn Off the Heater

Press Stop button to start cooling, the fan will blow until the temperature of the block is below 50°C

7. Watch Your Video

Go to the videos screen and choose your newly created video

Press on a file to play the video

Pause the video and use the seek bar to manually determine the Clear Point (when all solid has melted into liquid).

8. Copy to PC

You can grab you videos off the Android device and copy them onto your PC, use a Mini USB B cable to connect to the Beagle computer.

Your videos are stored in the Movies folder, note you may need to power off/on you device to refresh the files.

The video is stored as an AVI file, suitable for most media applications.

Monday, 1 June 2015

Thor Camera Controls

Version 1.02 of Thor allows you to set various camera controls for your webcam.

To see all the controls scroll the screen:

Swipe vertically to scroll

The three blue buttons do the following:

Refresh Settings
Reads the value of each control from the camera and updates the user interface. Press this button to go back to your current settings.

Send To Camera
Sends the value of each control to the camera. Press this button after you've have made your changes to the control settings.

Reset All
Sets each of the controls on the screen to their default values, remember to press Send To Camera to send these values to the camera itself.

To quickly see your changes, press the GO TO CAMERA menu option in the top right corner. Please allow a few seconds for the camera to start up.

You can go back to the settings from the camera view by pressing the GO TO SETTINGS menu option in the top right corner. Please allow a few seconds for the camera to shutdown.

How To Use The Controls

Each camera has its own set of controls, where possible turn off any automatic settings such as White Light Balance and Exposure.

Experiment by changing only one setting at a time, you make notice that some controls do very little to the camera image. Most settings can be left set to their default values.

Important settings for the AutoMelt application will be the Gain, especially in low light situations.

Trouble Shooting

Pressing 'Send To Camera' says SEND ERROR. 

Go to the camera screen, wait a few seconds and then go back to the settings. If that fails try sending the default settings to the camera as some combinations of setting may cause the camera to send a fail response. If that still fails, power off the computer and reboot.

Have patience with the User Interface, there is a lot going on under the bonnet when communicating with the camera. Give a few seconds when sending new settings to the camera as the camera itself will be busy processing them.

Camera is not detected / does not work. 

Power off
Unplug the camera
Check the USB lead connection to the camera.
Plug in the camera.
Power on and reboot.

Swapping cameras does not work

If you wish to use another camera you will need to power off the computer, plug in the camera, power on and reboot.

Camera Settings Have No Effect

Remember to press 'Send To Camera' after changing a setting, wait a few seconds for the SEND OK response. Some camera settings may do very little such as Hue, Saturation and Gamma.

Camera Forgets its Settings

The current settings are lost when you power off, I recommend noting down camera settings that are to your liking. The idea of Thor is to allow you to experiment and research the camera optics and heating controls, it is not a full blown user product.

Some Controls Are Missing

Webcams will have differing capabilities and so have their own set of controls, out of the 3 webcams I have tried, only one had the Auto Exposure setting.

Programming Notes

Thor communicates directly to the Video 4 Linux drivers (V4L2), no third party UVC or USB libraries are used.

It is necessary that the Android build makes the /dev/video0 device available to the user for read/write operations:

Add the following code to the file /rootfs/ueventd.am335xevm.rc found on the SDCard
/dev/video0        0666  root       root

Thursday, 7 May 2015

Installing an APK

In this post I will explain how to install an Android App on a Chipsee Android computer, the app I use here is called Thor but the guide can be used for any app.

Uninstall the older version

First find the app, on the home screen press the apps button as shown below:

Touch and hold the Thor icon:

Wait for the home screen to show and then drag the icon to the bin:

Press OK to uninstall

Thor has now been uninstalled

Copy APK to Android

1. Copy the APK file on to a USB memory stick
2. Plug the APK in to the USB port on the Android computer
3. Open the Ol File Manager App:

4. Navigate the folders to the APK file:

Installing the App

Select the APK file in the File Manager app:

Press Install
Press Done

Thats it! You will find the newly installed app in  your apps screeen, you can create an icon on the home screen by holding the icon and dropping it on the home screen.