{"action":"created","issue":{"url":"https://api.github.com/repos/epics-modules/mrfioc2/issues/9","repository_url":"https://api.github.com/repos/epics-modules/mrfioc2","labels_url":"https://api.github.com/repos/epics-modules/mrfioc2/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/epics-modules/mrfioc2/issues/9/comments","events_url":"https://api.github.com/repos/epics-modules/mrfioc2/issues/9/events","html_url":"https://github.com/epics-modules/mrfioc2/pull/9","id":155131489,"number":9,"title":"Disable sequencer before syncing","user":{"login":"aderbenev","id":11302563,"avatar_url":"https://avatars.githubusercontent.com/u/11302563?v=3","gravatar_id":"","url":"https://api.github.com/users/aderbenev","html_url":"https://github.com/aderbenev","followers_url":"https://api.github.com/users/aderbenev/followers","following_url":"https://api.github.com/users/aderbenev/following{/other_user}","gists_url":"https://api.github.com/users/aderbenev/gists{/gist_id}","starred_url":"https://api.github.com/users/aderbenev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aderbenev/subscriptions","organizations_url":"https://api.github.com/users/aderbenev/orgs","repos_url":"https://api.github.com/users/aderbenev/repos","events_url":"https://api.github.com/users/aderbenev/events{/privacy}","received_events_url":"https://api.github.com/users/aderbenev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/epics-modules/mrfioc2/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"mdavidsaver","id":4429215,"avatar_url":"https://avatars.githubusercontent.com/u/4429215?v=3","gravatar_id":"","url":"https://api.github.com/users/mdavidsaver","html_url":"https://github.com/mdavidsaver","followers_url":"https://api.github.com/users/mdavidsaver/followers","following_url":"https://api.github.com/users/mdavidsaver/following{/other_user}","gists_url":"https://api.github.com/users/mdavidsaver/gists{/gist_id}","starred_url":"https://api.github.com/users/mdavidsaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdavidsaver/subscriptions","organizations_url":"https://api.github.com/users/mdavidsaver/orgs","repos_url":"https://api.github.com/users/mdavidsaver/repos","events_url":"https://api.github.com/users/mdavidsaver/events{/privacy}","received_events_url":"https://api.github.com/users/mdavidsaver/received_events","type":"User","site_admin":false},"assignees":[{"login":"mdavidsaver","id":4429215,"avatar_url":"https://avatars.githubusercontent.com/u/4429215?v=3","gravatar_id":"","url":"https://api.github.com/users/mdavidsaver","html_url":"https://github.com/mdavidsaver","followers_url":"https://api.github.com/users/mdavidsaver/followers","following_url":"https://api.github.com/users/mdavidsaver/following{/other_user}","gists_url":"https://api.github.com/users/mdavidsaver/gists{/gist_id}","starred_url":"https://api.github.com/users/mdavidsaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdavidsaver/subscriptions","organizations_url":"https://api.github.com/users/mdavidsaver/orgs","repos_url":"https://api.github.com/users/mdavidsaver/repos","events_url":"https://api.github.com/users/mdavidsaver/events{/privacy}","received_events_url":"https://api.github.com/users/mdavidsaver/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2016-05-16T21:56:05Z","updated_at":"2016-07-06T21:01:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/epics-modules/mrfioc2/pulls/9","html_url":"https://github.com/epics-modules/mrfioc2/pull/9","diff_url":"https://github.com/epics-modules/mrfioc2/pull/9.diff","patch_url":"https://github.com/epics-modules/mrfioc2/pull/9.patch"},"body":"There is an issue when performing a Commit operation on an Enabled, Loaded sequencer. Commit sometimes causes the sequencer to run without external trigger. At NSLS-II, this triggers ACMI fault to appear spontaneously when changes are made which require sequencer commit, e.g. changing the target injection bucket. ACMI fault means that certain event does not arrive at expected times. Troubleshooting has shown that this event indeed arrived not when expected.\r\n\r\nTesting:\r\n\r\nWith EVG using FracSyn source, Mxc divider was set to obtain ~0.1 Hz frequency (the glitch occurs at 1 Hz as well, but at much lower rate). Sequencer table containing event 25 with timestamp 14 (and other events) was used and assigned to trigger from Mxc in Single Run mode. To rearm the sequencer, single shot controller logic was used which re-enabled the sequencer once its status became Disabled.\r\n\r\nTwo python scripts were used to provoke and track the glitch: first printed out the time difference between subsequent arrivals of event 25. Second one invalidated the sequencer configuration by switching and restoring the trigger source parameter and performed a commit on arrival of event 25.\r\n\r\nExpected behavior is when event 25 arrives every 10 seconds. Observed behavior (output of the first script),  tracking event 25 arrival:\r\n\r\n9.277065869 <- Mxc ticks and event 25 arrives, the second script does a commit\r\n0.912279932 <- script sees event 25 again even though Mxc is ~0.1 Hz\r\n0.912262812 <- another spontaneous run, second script performs a commit every time\r\n0.912260970 <- commits keep causing the glitch\r\n0.912296550\r\n0.912276747 <- last spontaneous run, next commit doesn't cause the glitch for some reason\r\n5.627969022 <- Mxc ticks, legitimate event 25 arrival\r\n0.912301377 <- spontaneous runs follow\r\n0.912269223\r\n0.912266949\r\n0.912302002\r\n0.912268566\r\n5.628053982 <- Mxc ticks normally\r\n0.912294509 <- for some reason glitch appears only once\r\n9.277051525 <- Mxc ticks, script commits\r\n0.912281013 <- glitch again\r\n...\r\n\r\nIt is peculiar that the time it takes for the spontaneous trigger to appear, ~0.91 seconds, corresponds to the last timestamp in the sequencer table, 113856614 ticks * 8 ns = ~0.91 seconds. Changing the timestamp of this last event also causes the spontaneous trigger delay to change. It means that when commit is performed, it sometimes makes sequencer to run immediately after the ongoing sequence is finished. If commit is performed again during the second run, it may cause another spontaneous run and so on.\r\n\r\nIt was found in code that when in Single mode, sequencer is not disabled before Commit is applied. When proposed fix is in place, the first script output is as follows:\r\n\r\n10.189346033\r\n10.189346034\r\n...\r\n\r\ni.e. event 25 arrives every ~10 seconds, as expected, and spontaneous sequencer runs are not observed. It is proposed to disable sequencer when needed before applying the commit."},"comment":{"url":"https://api.github.com/repos/epics-modules/mrfioc2/issues/comments/230905377","html_url":"https://github.com/epics-modules/mrfioc2/pull/9#issuecomment-230905377","issue_url":"https://api.github.com/repos/epics-modules/mrfioc2/issues/9","id":230905377,"user":{"login":"mdavidsaver","id":4429215,"avatar_url":"https://avatars.githubusercontent.com/u/4429215?v=3","gravatar_id":"","url":"https://api.github.com/users/mdavidsaver","html_url":"https://github.com/mdavidsaver","followers_url":"https://api.github.com/users/mdavidsaver/followers","following_url":"https://api.github.com/users/mdavidsaver/following{/other_user}","gists_url":"https://api.github.com/users/mdavidsaver/gists{/gist_id}","starred_url":"https://api.github.com/users/mdavidsaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdavidsaver/subscriptions","organizations_url":"https://api.github.com/users/mdavidsaver/orgs","repos_url":"https://api.github.com/users/mdavidsaver/repos","events_url":"https://api.github.com/users/mdavidsaver/events{/privacy}","received_events_url":"https://api.github.com/users/mdavidsaver/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T21:01:37Z","updated_at":"2016-07-06T21:01:37Z","body":"> which yields invalid nanoseconds value (>10^9).\r\n\r\nIs this the source of the \"bad\" timestamps which nsls2 sees?"}}
{"actor":{"display_login":"mdavidsaver"}}