Thread: QHY Woes
View Single Post
  #13  
Old 08-07-2021, 10:51 AM
etill (Elliot)
Registered User

etill is offline
 
Join Date: Oct 2019
Location: Melbourne
Posts: 140
I wouldn't go so far as to say it's not a cooler problem but it has me intrigued at least, so I've popped mine open and got the NINA source code out. I hate c# but I can follow it easy enough.

There isn't much to the DC201, but the main regulators I can identify are 7805, 7815 and 7915 types as expected. I would have originally guessed the +/- 15v is for an opamp or some other analog part of the circuit, but they are quite large regulators and a typical opamp doesn't need much. Maybe they were just cheaper than the SMD versions at the time (those rails are generated from a single +12v and if they do have anyhting to do with the sensor or an amp of some kind could be at fault if any of those components had failed). I can't find an ICX494 datasheet but similar CCD sensors from Sony appear to use a single rail supply, no idea about this one.

I'd guessing based on the rest of the DC201 circuit board the camera may have some kind of serial communication with the power supply or something like that to control some function of it. My scope can decode most serial protocols so if I have time I can probe around and see later on, I only took a brief look this morning.

Looking at the source code (the relevant parts you are after are in NINA.Equipment/Equipment/MyCamera/QHYCamera.cs and NINA.Equipment/SDK/CameraSDKs/QHYSDK/QhyccdSdk.cs) it appears the SDK allows you to set a target temp, and possibly PWM parameters. I can't see anywhere this code does much other than read the max and min PWM values and sets the current value to zero when disabling the cooler. It sets the target temp and the reads the PWM values back to display the power level.

I have to put "---" either end of the code snippets below otherwise I suspect lack of formating may make this hard to read.

This task sets the desired temperature every 2 secs according to the comment:

---
// QHY cameras have two eras of firmware when it comes to managing cooling.
// "Old" camera firmware requires that the target temperature or PWM be set at regular, constant
// intervals, usually every 2 seconds. "New" camera firmware does not have this requirement, but
// there is no programmatic way to determine which firmware is old and which firmware is new. As
// a result, QHY's own suggestion is to just treat every camera as if it is running old firmware
// and set the target temperature every 2 seconds.
//
// To manage this, we will create a task to run constantly in the background while CoolerOn = true
---

This is the task that sets the temperature every 2 secs per above:

---
private async Task CoolerWorker(CancellationToken ct) {
try {
bool previous = Info.CoolerOn;

Logger.Debug("QHYCCD: CoolerWorker task started");
while (!ct.IsCancellationRequested) {
if (Info.CoolerOn) {
Logger.Trace($"QHYCCD: CoolerWorker setting camera target temp to {Info.CoolerTargetTemp}");
Sdk.ControlTemp(Info.CoolerTargetTe mp);
} else if (previous == true) {
Logger.Debug("QHYCCD: CoolerWorker turning off TEC due user request");
_ = Sdk.SetControlValue(QhySdk.CONTROL_ ID.CONTROL_MANULPWM, 0);
}

previous = Info.CoolerOn;

/* sleep (cancelable) */
await Task.Delay(QhySdk.QHYCCD_COOLER_DEL AY, ct);
}
} catch (OperationCanceledException) {
Logger.Debug("QHYCCD: CoolerWorker task cancelled");
}
}
---

This gets the current cooler power:

---
public double CoolerPower {
get {
double rv = double.NaN;

if (Connected && CanSetTemperature) {
if ((rv = Sdk.GetControlValue(QhySdk.CONTROL_ ID.CONTROL_CURPWM)) != QhySdk.QHYCCD_ERROR) {
/*
* This needs to be returned as a percentage of Info.CoolerPwmMax.
*/
return (rv / Info.CoolerPwmMax) * 100;
}
}

return rv;
}
}
---

So based on that and the screenshots you sent of NINA showing power and temp curves that appear to be consistent with a correctly functioning TEC and temp sensor in the camera it would require a sequence of faults I think is probably unlikely to make it look like its working to the SDK / software when its actually not cooling / working at all.

This doesn't rule out the DC201 being at fault. Based on my very limited knowledge of old CCD sensors and how the circuitry that reads them works I'd guess if it were a fault with the power supply it could be something like gain gone wild rather than a heated up sensor, or maybe something to do with power to the sensor itself.

The good news is at least if its the cable or DC201 power supply you can replace that a lot easier or cheaper than fixing the camera. I'd loan you mine to test before buying another, but you never know when the clouds will clear and its the only one I have.
Reply With Quote