Camera has stopped cooling

Don’t misunderstand me. I am saying I have looked for hours at the code and I don’t see anything suspicious… that is not an indication of blame, just me throwing my hands in the air.

The answer to this is that nothing has changed between those versions. I have verified this through our SCM . The code to manage the TEC has not been changed in 19 months (and event that change was minor… just adding the 5 second delay).

Code / sequence of events:

  • Connect the camera (main application thread).
  • Below this is in a separate thread (always has been)
  • On success, wait 5 seconds
  • Turn the cooler on (cam.coolerOn = true). No exception thrown here
  • Wait 5 more seconds before sending change temp commands
  • Then comes the code that works on the controlled cool down:

while (true)
{
nTempChangePercent = (double)sw.Elapsed.TotalSeconds / (double)seconds;

double temper = currentTemp + (tempDelta * nTempChangePercent);

if (Math.Abs(lastTempSet - temper) >= 1)
{
if (!theCamera.SetCoolerTemp(temper, false))
{
Logger.debugln(“TEC Change: Failed to set cooler temp! Aborting…”);
bAbortTempChange = true;
}
lastTempSet = temper;
}
}

The ASCOM implementation of SetCoolerTemp:

try
{
cam.SetCCDTemperature = temp;
return true;
}
catch (Exception ex)
{
Logger.debugln("ASCOM Camera: Failed to set CCD Temperature! ",ex);
return false;
}

Hi joelshort,

This is what I am encountering with the filter wheel.

The problem is reproduced by doing bin 2 frame and focus for a few minutes, when I click stop to abort it:

  1. The Atik One internal filter wheel’s ASCOM status becomes -1, i.e. moving
  2. CoolerOn status becomes false

After several iterations, I found a way to reset the camera without power off/on: to do a “Take One” frame and focus, and to use “turn on” the cooler again by the capturing software.

I guess the issue may not be introduced by SGP, but something more in the drivers or integration with the driver.

Sorry for hijacking the thread, and let’s start another thread regarding this issue when appropriate.

It seems it is a coincidence to discover this when I upgrade to SGP 2.4.3.23 or 24.

Regards,
David

Please move any issues not dealing with Atik camera cooling to a different thread.

Thanks.

This won’t solve anything (I don’t think)… but it is worth noting that we NEVER checked to make sure the cooler was actually powered on (after the code that was supposed to do it was done executing). I added that (with some code that retries a few times). I have also added some code that will call SetCCDTemperature for a little while if the camera is supposed to implement this method, but SGPro is told that it is not implemented. No new code… just more waiting and checking…

If interested, you can try it here… just a shot in the dark:

Ken

Thanks for doing this. I will try the new ‘Atik’ version, but I am going to be away from home for a couple of days. I will report back as soon as I can.

Testing that AtikTest version:

I thought I had some good news to report - but afraid not. I had set the cooling to -5° and that showed up on the docking module…the cooler was on and looked like it was cooling to requested temp.

Ken - please note that on the test yesterday…it did actually turn the cooler on. (See the screen capture in yesterday’s post.) But, yesterday, it never even got to show the -5° requested.

However within seconds (today) that -5° disappeared from the set temp slot and it changed back to ambient. Cooler remained on…but it was only cooling to ambient temp.

Some short logs attached. You will note that I deselected the camera and then connected again a second time…with the same result.

sg_logfile_20160105094444.txt (18.0 KB)
ASCOM.Atik.0934.315910.txt (23.7 KB)
ASCOM.Atik.0931.215420.txt (12.8 KB)
ASCOM.Atik.0932.014820.txt (2.0 KB)
ASCOM.Atik.0932.575540.txt (23.8 KB)

sg_logfile_20160105094444 Again.txt (18.7 KB)
sg_logfile_20160105092503.txt (49.2 KB)

Chris:
Actually think I sent the wrong SGP log the first time anyway…looks like it is the last one here that should be looked at.

Hi Ken,

Sorry.

I did a test with 2.4.3.25 and the test version, and do not find a major difference in term of the outcome. i.e. the camera can still cool down, but that error message “Failed to set CCD Temperature!” is shown in the log.

I can get rid of this error in the log, and able to see in the UI the cooler bar, if I unclick “Cool down when camera connects”, and click “Cooler On” and then “Go” in the Cool down box.

sg_logfile_20160105220802.txt (24.6 KB) for test with 2.4.3.25

sg_logfile_20160105223130.txt (31.5 KB) for test with Atik test version

sg_logfile_20160105223707.txt (21.8 KB) ok with unclicking “Cool down when camera connects”, and click “Cooler On” and then “Go” in the Cool down box.

I can’t see the SGP log file at all, it reports "The page you requested doesn’t exist or is private."
The Atik ones show the cooler being turned on but SetCCDTemperature is never called.

I’ve tried this for myself with SGP x.25, Atik driver 6.2.2.20532. SGP set to cool when connected.

I think I’ve found out what is happening SetCCDTemperature is being called before CanSetCCDTemperature.

I’m checking the hardware in CanSetCCDTemperature. Before that I use the default value - false.

I guess that there was some subtle change between x.22 and x.25 that changed the order of these commands.

I will fix this so that SetCCDTemperature checks the hardware if it needs to but it would also be a good idea to call CanSetCCDTemperature in the TEC thread before the call to SetCCDTemperature.

You can SGP log file again. I copied it to the desktop…renamed…then put it in…

Actually think I sent the wrong one first time anyway…looks like it is the last one that should be looked at.

Kinch

OK sounds good and easy enough. But for how long do we check this value? Or when is it appropriate to check this value? If we had this check in place now, the cool down on connect would still fail because SGPro would think the camera does not have a controllable cooler. At face value, if a camera ever returned this, it might be fair that the client assume the ccd does not have a controllable cooler. The fact that this value can change over time leaves me in an uncertain state. What do you think? Call on the property for a bit? I understand the driver has to query the hardware… maybe that should be blocking? Not sure here.

The current Atik driver will be fine if you call CanSetCCDTemperature BEFORE SetCCDTemperature. SGP Version x.22 does this, SGP version x.25 does not.

The Atik logs provided by @Kinch show this.
with SGP x.22

10:23:13.463 CanSetCCDTemperature first get True
… 5 seconds later…
10:23:18.067 CoolerOn set True
10:23:18.070 SetCooler set 19.999999975
… and another 5 seconds later…
10:23:23.195 SetCCDTemperature set 19.93999997506
10:23:23.204 SetCooler set 19.93999997506

and with SGP x.25

10:01:06.739 CoolerOn set True
10:01:06.741 SetCooler set 19.999999975

The Atik log doesn’t show the failed SetCCDTempertature but the SGP log does:
[1/4/2016 10:01:06 AM] [DEBUG] [Main Thread] Turning camera cooler on…
[1/4/2016 10:01:06 AM] [DEBUG] [Main Thread] Turning camera cooler on…
… 5 seconds later…
[1/4/2016 10:01:11 AM] [DEBUG] [TEC Thread] TEC Change: Changing temp from 18.73 to -5.00 in 300 seconds…
[1/4/2016 10:01:12 AM] [DEBUG] [TEC Thread] ASCOM Camera: Failed to set CCD Temperature! : Property write ASCOM.Atik.Camera SetCCDTemperature is not implemented in this driver.

10:01:12.297 CanSetCCDTemperature first get True

Here is a log with additional data that shows the order more clearly:

13:20:31.240 CoolerOn Thread - get CoolerOn True
13:20:31.759 SetCCDTemperature Thread - set 17.9299999121867
13:20:31.782 SetCCDTemperature Thread - set 17.93
13:20:31.796 CanSetCCDTemperature Thread - first get True

It looks as if there is some subtle timing change between 22 and 25 that triggers this behaviour. Maybe CanSetCCDTemperature and SetCCDTemperature are being called in different threads.

All that needs to happen is to call CanSetCCDTemperature before SetCCDTemperature.

Chris

1 Like

Aha! Mystery solved. CanSetCCDTemperature was called just by chance by the temperature “poller”. I removed that for a fix to query a CCD’s temperature that did not have a cooler (A zwo camera I think?). So… all along the code to cool the Atik has just been accidentally working.

1 Like

Thanks for the time you put in on this Chris. I see that Ken has taken that on board in the latest Beta today. I’ll test again a little later on and report back - just to complete the thread hopefully.

Tested the ATIK 460 EX with 2.5.0.0 Beta - and all worked good…the camera commenced cooling on connect.

Logs here from a short test (if interested)…but hopefully that is the end of that one :smile:

sg_logfile_20160106101014.txt (20.4 KB)

ASCOM.Atik.1010.374240.txt (40.4 KB)

Thanks Chris & Ken…amazing how fast you guys got it sorted.

Thanks Kinch and Ken. The log shows CanSetCCDTemperature being called before SetCCDTemperature so it is fine. I’ll fix this in the driver as well.

Another example that 90% of fixing a problem is finding out what the problem really is.

Part of the reason this happened is that I try to keep calls to the hardware to a minimum to keep the load down on the hardware, the USB bus etc. Some applications will make status calls at ridiculous rates, I’ve seen 10,000 calls a second to CameraState at the end of an exposure.

Chris

1 Like

I tested with my Atik One on SGP 2.5.0.0 beta, and the cool down when camera connects now works.

Thank you.

1 Like

Original Poster here. I have also tried the new beta and the camera now cools once connected.

Thanks agan for fixing this so promptly.

1 Like