-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add ACCS field with ACCU control #203
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The problem: When a user changes the velocity by writing to the VELO field, but forgets to write to the ACCL field, the acceleration will change and may be too high. (Note: Many users are not aware of this side-effect). Solution: Introduce a field called ACCS, "Acceleration in seconds^2". Once the field is written, the ACCL field is updated and the acceleration is "locked". It is locked for changes of VELO. It can be be unlocked by writing to ACCL. If the acceleration is locked (or not) is stored in the field ACCU, which can be either "motorACCSused_Accl" or "motorACCSused_Accs". And in this sense ACCU is not a lock, but just keeps track which of the accelation fields ACCL or ACCS has been updated last, and should be used in the next movement. In any case an update to ACCS updated ACCL and the other way around. Thanks to Mark Rivers for this nice idea.
When a database wants to use ACCS from the start, when the record is loaded into the IOC, the init_record() function needs to look at it. The new way is to set ACCS != 0.0 and ACCL == 0.0 and then ACCS takes over. The compatible (call it old ?) way is to have ACCS == 0.0, and then ACCL is used.
When the record is initialized, it could happen that the ACCS field was not initalized at all. Fix this: - Introduce a new value for motorACCSused, motorACCSused_Undef. This is == 0, and temporally used until the record is initilized. Using 0 as Undef will allow a (mis-) use in e.g. CSS to make the ACCS field invisable, whe ACCU is 0 (or not present at all in an older version of the motorRecord) - At the end of check_speed_and_resolution() set ACCS and ACCU, if needed.
When the dbd file was loaded, EPICS base complained with "Error initializing motor.ACCU initial Default" Remove the 'initial("Default")' for the ACCU field.
…eanSpallationSource/motor into add_accs_field
Merge the master branch, commit 891a66e, into torsten/181203_1217_add_ACCS_field Conflicts: motorApp/MotorSrc/motorRecord.dbd
The function accEGUfromVelo() returns acceleration in EGU, but we need it expressed in steps. Thanks to Kevin Peterson for noticing. Correct this and divide by fabs(pmr->mres). And while there, correct a typo in a comment
…eanSpallationSource/motor into add_accs_field
…cified when motor databases are loaded and is autosaved by default.
…) when VBAS (or SBAS) changes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intended to be merged after #122