Taking control of the QHY268c TEC cooler

Post Reply
DiligentSkies
Posts: 52
Joined: Wed Dec 02, 2020 10:46 pm

Taking control of the QHY268c TEC cooler

#1

Post by DiligentSkies »

Hello Robin,

With the TEC cooler on the QHY268c camera, "As soon the power is connected the TEC cooler goes right for the default set point of 0C at a maximum power profile.

Very often by the time, I start up SharpCap and the camera auto connects, my first work flow goal is to adjust this set point to a more appropriate target temperature in attempt to step the temperature down.

The default goal of 0C may be a reasonable target for most locals, but it is "The rate at which it achieves this is worrying, specifically with the amount of humidity."

Very often by the time I get SharpCap up and running, "The TEC cooler is about 80 percent or more of the way towards 0C."
And, if I get distracted or run into some issue by the time SharpCap is connected to the camera, "The TEC cooler is already at 0C."

Is there a way to change this default target temperature in the QHYCCD SDK to another value?

Ideally, the best thing to do, "Would be read the current temperature of the sensor and immediately set that temperature as the target temperature."
Thus putting a break on power to the TEC cooler with the minimum required power to maintain this temperature set point.

It escapes me, why the default behavior, "Is not a zero cooling power profile until other software platforms come on line and cooling can be controlled by the user."

========================================
My experience has been the only effective means to controlling the TEC cooler, "Is to set a temperature target and step it down towards a cooling goal through small decrements."
However on the warming front, by setting a target temperature that is set above current temperature of the QHY268c sensor, "The only response is zero power until it reaches that warmer temperature then the TEC cooler supplies the minimum power to maintain that temperature."

As to the Auto controls, "Where a power level can be set for cooling and warming."
"I have yet to figure out values that achieve my preferred approach of stepping down the cooler in 2C decrements towards a minus 25C below ambient. And then allow that achieved temperature to stabilize for 30 second before the next decrement.
The same goes for warming but in the reverse.

This is all very tedious and a perfect scenario for scripting through a timer thread(or IronPython's equivalent thereof)

I see SharpCap has the IronPython scripting language console that allows simple programs to be written that can perform just about any action that can be performed when controlling SharpCap with the keyboard and mouse.
I would like to take a crack at a python script, "To achieve better control over the TEC cooler."
This is my well thumbed reference desk
This is my well thumbed reference desk
Reference Desk.jpg (828.83 KiB) Viewed 1248 times
Meaning, "I do understand the Object Model of parameters, methods and classes."

==========================================
I just read SharpCap's Scripting Help and,
viewed the console command line...
>>load System
>>from System.

My initial sense of things is, "If this cooling script can be written."
It might be possible to do so through a script built on using...

SharpCap.SelectedCamera.Controls and SharpCap.Settings

At this stage, "Is there a SharpCap API?"
If not, "What are the names of IronPython import class libraries and where are they located."

So I can run a python API parser to build my own API HTML and if I am lucky, "You have annotated the code."
If not, "At least I will have the syntax of the parameters and methods in a given class library in a format that I am use to working with."

I know python has its own programming syntax that is different in many ways from Java.
However, "I have written Python program scripts in the past."
Sincerely,
Mark
Last edited by DiligentSkies on Wed Feb 10, 2021 9:37 pm, edited 4 times in total.
DiligentSkies
Posts: 52
Joined: Wed Dec 02, 2020 10:46 pm

Re: Taking control of the QHY268c TEC cooler

#2

Post by DiligentSkies »

Hello Robin,

As far as a SharpCap API is concerned...

I just figured out, "How to utilize the 'dot' feature built into the IronPython console after a revisit to SharpCap's Scripting help."

A quick purview through what is exposed. Reveals there is nothing allowing IronPython scripting of the Thermal Controls.

So a IronPython script is moot at this point.

The only option left is the QHYCCD SDK.

Here is an interesting link...
https://github.com/qhyccd-lzr/ that demonstrates the various development platforms that build on the QHYCCD SDK.

However, to do this I am going to game out the software development project phase in a nature language(English) program.
When I have written this, I going to share it with you.
Maybe that will launch your interest to encode a Thermal Control profile in SharpCap to add just another one of many reasons to get the Pro license.

Sincerely,
Mark
Last edited by DiligentSkies on Wed Feb 10, 2021 8:13 pm, edited 3 times in total.
DiligentSkies
Posts: 52
Joined: Wed Dec 02, 2020 10:46 pm

Re: Taking control of the QHY268c TEC cooler

#3

Post by DiligentSkies »

Hello Robin,

Here is an outline of approach to a Thermal Cooling profile.

Run SharpCap.
No camera is powered on.

So SharpCap happily waits for a camera to be powered on.
Meaning SharpCap is polling the USB Hub waiting for a camera to be powered on or something to that effect.

Once the camera is powered on, SharpCap recognizes this and connects to the camera.
After the SharpCap GUI populates with the camera specific controls in the GUI.
The first thing SharpCap does, "Is to requests a temperature reading of the sensor and then sends the command to set this is as the target temperature.
As if the user set that value in the Thermal Controls section of SharpCap's Thermal Control GUI.
The net effect is zero or very minimum power to the TEC cooler.

Then with a button in the Thermal Control GUI, a process can be started that decrease the target temperature by a parameter value that can be set in SharpCap Setting's dialog. For example by 2C.

Then by polling the current temperature of the sensor to determine, "If that temperature has been reached."

When reached. A timer is started to wait say 30 seconds for things to stabilize. The process is repeated until the temperature cooling goal is reached.
Again a parameter value that can be set in the Settings Dialog. Either a target temperature or a minus 25C off set from this initial sensor temperature read out.

On the warming front the process is just reversed.
However from a programming stand point, it is not as straight forward as cooling.
Very likely the current ambient temperature, "Is no longer the initial temperature readout at the beginning of the imagining session."

To avoid loop traps, my 'Keep It Simple' solution would involve just monitoring the warming process with a conditional test.

As I have observed the TEC cooler preforms very well in that after a night's session of imagining. If I am at 10C, by changing the set point to 12C.
The TEC cooler shuts off all power, but once 12C is reached the TEC cooler starts to immediately apply the minimum power needed to maintain that temperature.

Therein lies the solution.
By having this stabilizing period of time between increments of temperature and at the end this period, a conditional query can be made. "Is power being applied, if so go to the next increment temperature, if not the sensor is now at or very near ambient temperatures.

Sincerely,
Mark
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Taking control of the QHY268c TEC cooler

#4

Post by admin »

Hi Mark,

What happens to the camera before SharpCap connects to it is down to the camera firmware (QHY written), so if it is cooling before you connect in SharpCap then there isn't anything SharpCap can do about it.

If you want to change the initial temperature set when SharpCap does open the camera, the easiest way is to open the camera, set the inital cooling settings (maybe 10C target perhaps) then save those camera settings as a capture profile. Then press the 'Manage' button to manage capture profiles and set that profile as default.

From then on, when SharpCap opens the camera it will immediately load that profile containing th 10C cooler target.

cheers,

Robin
DiligentSkies
Posts: 52
Joined: Wed Dec 02, 2020 10:46 pm

Re: Taking control of the QHY268c TEC cooler

#5

Post by DiligentSkies »

Hello Robin,

As always thank your for timely responses.

Quoting your response, "What happens to the camera before SharpCap connects to its camera firmware controll (QHY written)..."

Yup... much as I have observed. SharpCap has little control over the firmware presets.

Thanks for the advice on setting a target temperature in a default profile.

With the QHY268c, representing nearly 20% of the money I have spent in the last few months on astrophotography hardware.
I am just looking out to protect my investment.

I just finished powering up my camera and connecting to SharpCap per your suggestion. By the time I did this, SharpCap was reporting a sensor temperature of 17.8C. So I set about per your suggestion a target temperature of 16C.

I then warmed it up and shut everything down.

I repeated the same process but this time I had SharpCap running, then powered the camera and I did not even need to rescanned for my camera it just appeared in the Camera connections and then when I connected to the Camera.
This time the temperature reported by SharpCap was aound 18C.

Thus the profile target temperature of 16C in a default profile set about gaining control of the TEC cooler per say.

Maybe I am being a little paranoid about thermal shock to the sensor.

If it was truly, a make or break issue in terms of this 0C set point and the means the TEC cooler achieves this temperature is approached by the amount of power being supplied at 100%.
Then one would think the folks at QHYCCD would have implemented a more controlled set point.

It would definitely would not be good for the QHYCCD brand if in using the camera with the current TEC cooler firmware, resulted in the equivalent of a statistical probability of camera failure, "Akin to flying a B-17 over 25 missions in WWII."

Since being totally focused on this process today.

I would add, in watching what power was being supplied (regardless of what I posted earlier) when I first connected to the camera.
It was at 100% power, however once I set a default profile to a targeted temperature . The power value being applied quickly adjusted to the preset value of 16C after I set this as the profile temperature and doing so as I connected the camera within SharpCap, it quickly adjusted the power in the neighborhood of 38%.
Meaning, by your suggestion the SharpCAp is able to quickly again control of amount of power being applied to the TEC cooler.
Which is very much a good thing.
====================
As to sensor shock issues...
Maybe, QHYCCD is just discussing in broad generalized terms on their website to cover the cravats of thermal shock.
For example cooling the sensor down by minus 50C below the ambient for example.
Also since there is always the situation of...
Taking the camera from a 28C household outside to an -10C ambient and then immediately start cooling to minus 35C without waiting for the camera to thermally adjust to the current outside ambient temperature.
And the reverse is also true, shutting down all software controls and disconnecting the power to the camera and taking it back into a much warmer environment.


Sincerely,
Mark
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Taking control of the QHY268c TEC cooler

#6

Post by admin »

Hi Mark,

I've never actually heard of anyone who has broken their camera due to fast heating/cooling, so I think the frequency of this happening is somewhere between extremely rare and never happens at all. I've certainly had plenty of cameras that have run through fast cooling and warming cycles due to software testing, crashes, etc and not had a problem. I guess that in general the number of clear nights that we get to observer is so low that the number of thermal cycles never really builds up to a dangerous level.

cheers,

Robin
Post Reply