-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First call to calibrate functions doesnt work. #19
Comments
I think this is due to broken logic in the flatten phase routine. aoDev.py line 784:
so it continue while Either interations ((default 10) > ii (the count variable)) or (best_error> error_thres). I think this code only worked at all because the default error_threshold was np.inf and basically the second check always produced false. There seems to be another issue in the improvement code as well, around line 816:
correct_error is the current effort, best_error is the previous best correction, current_error is the previous best pattern - calculate correction factor. My understanding of this code is if your applied correction is BETTER than your calculated correction factor then it will never be accepted, hence the optimisation very often fails, and even if it is a scucess it will not finish with the lowest error, just the time you did better than you thought it ought to. |
I think I am reading the current_error wrong, it appears to be the previous best corrections minus the currently used zernike modes, so effectively the theoretical best you could do with the currently selected modes, however this ignores noise, crosstalk etc... why cant we occasionally do better? If we do why should we throw away that coprrection? |
Another howler: Really? If the corrected error is less than the best error it is worse than before? |
It's reasonably to argue that if a user has specified a set number of iterations then the routine should only ever run for that many iterations, but at that point I question why there should be an error threshold at all if the prime decision factor is the current number of elapsed iterations. Happy to discuss this further.
So, there are 3 variables here:
The conditional
This is incorrect. It should be |
You are reading this wrong.
Measures the current wavefront (before correction) and subtracts the piston, tip and tilt measured in the current wavefront, since those Zernike modes are not reliable, and piston in particular is arbitrary and varies from wavefront to wavefront thereby biasing wavefront error calculations. Line 784:
Then calculates the wavefront error according to the specified The flattening routine is then performed for this iteration and this |
This is entirely possible if the routine is running correctly. If at no point during the flattening routine do you obtain a better wavefront error than is obtained with 0.5 applied to all actuators, then those are the value which will be saved as the system flat values because those are indeed the actuators which yielded the best wavefront error. I would suspect this occurs due to a poor control matrix that has significant co-variance in the Zernike modes, meaning applying one Zernike mode introduces significant amplitudes of other Zernike modes. The whole control matrix might not be poor. It may be that you are attempting to correct for some modes which have a low reconstruction accuracy/significant co-variance with other modes (typically Noll index > 30) and this can bias the correction for the modes which you can reliably recreate on the DM. In either case, a |
However the logging functions clearly show significantly smaller RMS errors (like 5x smaller) and yet these are not stored as the best flat.
This is possible but I did check and the characterisation seemed reasonable.
I have consistently seen much lower RMS errors that the original or the "best_error" being ignored, but I see your point about removing the 0-2 zernike modes. I will have a think about the best solution. |
That is definitely erroneous behaviour.
To clarify, when you say they aren't being stored, are you referring to the to remote side or the main (i.e. Cockpit) side? So, is the |
I think I understand this better after playing on cryosim today. I see your point about removing tip/tilt/piston. However I am very surprised that a large number of repeats was typically giving me 1 as the error before correction and 2 as the error after correction. I know 1 is pretty good but still seems strange that nay correction makes things worse and despite many repeats the system flat stayed at 0.5 everywhere. We are back on deepsim today and I will have another look |
The system flat (or my new calibrate_remote_z ) returns every actuator at 0.5 on the first call. subsiquent calls appear to succeed
The text was updated successfully, but these errors were encountered: