msr-consulting / exscalabar_server

Repository for the EXSCALABAR server.
http://www.msrconsults.com/ukmet-gh/exscalabar
0 stars 1 forks source link

Power initialization #143

Closed lo-co closed 8 years ago

lo-co commented 8 years ago

Ozone and pump power supplies not following ini file.

lo-co commented 8 years ago

This was not an initialization issue. This was a UI issue. Array containing all of the power data was in the wrong order.

JustinLangridge commented 8 years ago

Matt, the power controls in the UI are now jumbled after this fix. For example, pumpis controlling the o3 lamp, ozone gen is controlling the denuder, tecis controlling the sample pump

lo-co commented 8 years ago

Arrrrggggh...thought I got rid of this one! I see what you are saying.

lo-co commented 8 years ago

OK. So, this was related to the UI (again). In cvt-service.js, we had code to convert the integer response.data.general.power to a binary string:

var power = Number(response.data.general.power).toString(2);

 while (power.length < 5) {
    power += "0";
 }

cvt.power.Pump = power[1] == '1';
cvt.power.O3Gen = power[2] == '1';
cvt.power.Denuder = power[4] == '1';
cvt.power.Laser = power[3] == '1';
 cvt.power.TEC = power[0] == '1';

So, this works if the value is something like 3 - converts to the string 11 and results in the 5-bit string 11000. But when we have 11, this looks like 10110 and this was wrong. What we wanted was 01011 and the power array reversed. So, in the end, we wound up with this:

var power = Number(response.data.general.power).toString(2);
while (power.length < 5) {
    power = "0"+ power;
}
cvt.power.Pump = power[3] == '1';
cvt.power.O3Gen = power[2] == '1';
cvt.power.Denuder = power[0] == '1';
cvt.power.Laser = power[1] == '1';
cvt.power.TEC = power[4] == '1';
JustinLangridge commented 8 years ago

Hi Matt, the logic is still not right - we are seeing the same issues as noted above (e.g. O3 controlling denuder, pumpcontrolling O3 etc)

Another oddity is that behaviour seems to change. Upon cycling denuder for the first time after launching the system it controlled the laser power supply. After this initial cycling, control of the laser cycling deferred to laser. I didn;t observe this change for the other controls.

lo-co commented 8 years ago

We need to go over this together whenever you are around.

JustinLangridge commented 8 years ago

Dave made some changes to this last night and it looks like it is now working. Issues was with consistency in ordeing. Closing this now.