[INSTRM-1809] incremental convergence request large theta moves Created: 01/Dec/22 Updated: 24/Aug/23 Resolved: 24/Aug/23 |
|
| Status: | Won't Fix |
| Project: | Instrument control development |
| Component/s: | ics_cobraCharmer, ics_fpsActor |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Normal |
| Reporter: | cloomis | Assignee: | chyan |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | EngRun | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Looking into why the incremental convergence routines were taking so long, I noticed that for each of the four iterations there were a number of cobras which were sent on long (maximum) theta moves, and several which were commanded on long moves for every iteration. This suggests very bad (x,y) -> (theta, phi) conversions or a bug. For example, on run 20221119_005, the following groups all theta=2000 step moves by cobra: cd /data/MCS grep 2000 20221119_015/logs/fpgaProtocol.log | sort And within those 93 lines, there are several cobras which showed four commands – they never converged at all: run cobra: 22 6 Theta: 1 ccw 2000 40.0 0.0 Phi: 0 cw 0 18.0 0.0 run cobra: 22 6 Theta: 1 ccw 2000 40.0 0.0 Phi: 1 cw 2 18.0 1998.0 run cobra: 22 6 Theta: 1 ccw 2000 40.0 0.0 Phi: 1 cw 2 18.0 1998.0 run cobra: 22 6 Theta: 1 ccw 2000 40.0 0.0 Phi: 1 cw 9 18.0 1991.0 run cobra: 25 5 Theta: 1 ccw 2000 40.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 25 5 Theta: 1 ccw 2000 40.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 25 5 Theta: 1 ccw 2000 40.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 25 5 Theta: 1 ccw 2000 40.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 53 12 Theta: 1 ccw 2000 33.0 0.0 Phi: 0 cw 0 23.0 0.0 run cobra: 53 12 Theta: 1 ccw 2000 33.0 0.0 Phi: 1 ccw 1 22.0 0.0 run cobra: 53 12 Theta: 1 ccw 2000 33.0 0.0 Phi: 1 ccw 13 22.0 0.0 run cobra: 53 12 Theta: 1 ccw 2000 33.0 0.0 Phi: 1 ccw 49 22.0 0.0 run cobra: 75 27 Theta: 1 ccw 2000 39.0 0.0 Phi: 0 cw 0 30.0 0.0 run cobra: 75 27 Theta: 1 ccw 2000 39.0 0.0 Phi: 0 cw 0 30.0 0.0 run cobra: 75 27 Theta: 1 ccw 2000 39.0 0.0 Phi: 0 cw 0 30.0 0.0 run cobra: 75 27 Theta: 1 ccw 2000 39.0 0.0 Phi: 0 cw 0 30.0 0.0 run cobra: 78 19 Theta: 1 ccw 2000 41.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 78 19 Theta: 1 ccw 2000 41.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 78 19 Theta: 1 ccw 2000 41.0 0.0 Phi: 0 cw 0 20.0 0.0 run cobra: 78 19 Theta: 1 ccw 2000 41.0 0.0 Phi: 0 cw 0 20.0 0.0 In two cases the first phi move was 0 – so a two-step command? In the other three none of of the phi moves were enabled. Something is wrong there. If the cobra is broken, the Theta: enable bit should be off. |
| Comments |
| Comment by chihyi [ 05/Dec/22 ] |
|
This is likely related to the bad hard stops configuration. All the cobras are stuck for the large theta movements. Does those positions are close to the theta hard stops? Well, it's difficult to measure the hard stop positions for bad cobras. I have wrote some 'not so complex' codes to determnine the theta angles, especially for the overlapping region. Maybe someone should check the problem, and figure out if there is any better way to do. |
| Comment by chyan [ 03/Feb/23 ] |
|
As mentioned in Chih-Yi's comment, there is a flag called 'thetaMargin' set to default value of 15 degree. We should try to reduce this number, so that the cobra will not choose the other way. |
| Comment by chihyi [ 03/Feb/23 ] |
|
I use the 'thetaMargin' parameter to keep the target not too close the the hard stop. If the target is in the overlapping region and it's too close to the CCW hard stop, then CW hard stop will be choosed. The original code is good if we always do 'home' operation in the beginning. But If we want to move cobras from one position to another nearby position, then the shorter way should be choosed. We may want to add an additional flag or check if we are moving from the 'homed' position to distinguish those two cases. |
| Comment by cloomis [ 04/Feb/23 ] |
|
I think that comment helps, thank you. It was hard to understand why it was always being driven to the CCW limit. But I will ask whether that is consistent with your statement about going away from the CCW limit: does your logic move away from the CW limit as well? As far as home-vs-nothome goes, is there a difference if you always know where you are (from the last MCS exposure)? Yes, you do lose track of theta if you go home, but other than that home is just another position to start from. And because of the loss of theta, going home is arguably one of the few bad places to start from. |
| Comment by chihyi [ 04/Feb/23 ] |
|
For the first question, driven to the CCW limit is because we want to move cobras in the radial way to the target. So the speed ratio phi/theta must be '-2'. It's also bad to move theta/phi arms in the same direction, this is the most dangerous way and can increase the chance for collisions. By the way, for the nohome operation, it's probably difficult to do the radial movement. Anyway, we can predict if there is any collision from the simulator. Target selection can also play an important role here. For the second question, after the go home operation, 'cobraInfo['thetaAngle']' is set to either 0 or the angle to travel from the CCW to CW limits. So it's probably sufficient to check this value. I don't expect to run cobra in the nohome operation, so maybe we can add a few more flags in the cobraCoach class, e.g., the 'homed' flag. |
| Comment by yuki.moritani [ 23/Feb/23 ] |
|
(Note from the meeting on 2023/02/23-22) This has not been tested because there is a problem with transformation on us-mcs (a ticket for it will be created). |
| Comment by arnaud.lefur [ 14/Apr/23 ] |
|
chyan would like to know how to reproduce this issue, one needs to find out exactly what we did. |
| Comment by yuki.moritani [ 12/May/23 ] |
|
(as of 2023.05.11) Chi-Hung needs more test on US (i.e., using us-mcs). |