Closed JustinLangridge closed 8 years ago
This code is from the PAS laser controller on the user interface. cvt.pas.las.setVo(y)
updates the offset whereas cvt.pas.las.setVr(x)
updates the range. The code below is corrected; in the uncorrected version, both the offset and the range were set to x
. This means that when you set the value to 100, you should expect the offset to be 5 and the range to be 5 thus producing a range that goes from 2.5 to 7.5, consistent with above (sort of - don't know where the 7.9 came from).
What is not entirely clear to me is what is going on above. In the second example you give, the Vp-p
should be 1 V with the minimum voltage of 0.5 V. Is this what you saw?? Of was it really a Vmin
of 0.5 V and a Vmax
of ~2 V?
$scope.updateLasVolt = function () {
var x = [];
var y = [];
var tempRange = 0;
for (i = 0; i < $scope.lasCtl.length; i++) {
tempRange = $scope.lasCtl[i].Vnorm*maxRange/100;
x.push(tempRange);
y.push(tempRange/2);
}
cvt.pas.las.setVr(x);
cvt.pas.las.setVo(y);
};
This looks like it should work now... Please check this.
Scrap last comment. This is all working fine now. Closing.
Offset and Vp-p are not being set right via the UI laser control setting. This is causing lasers to error
For example when set to 100% we should get Vp-p = 5V, Vmin= 0V on the analog modulation We actually get: , Vmin= 4.9V, Vmin = 2.5V (this gives Vmax = 7.9V which is above the 5V limit for the lasers)
When we drop this to 20% power:
We should get Vp-p = 1V, Voffset = 0V We get: Vp-p = 1.4V, Vmin = 0.5V