Closed AugustoHorita closed 2 years ago
I am working with the PIE727 module and couldn't find support for gains and notch configuration. I implemented this code which works for us. I created a new class for PIE727 and also a header file with Closed Loop parameters and necessary structures. Included functions to set the CL parameters, and put the read function for these parameters in the poll thread.
@JensKappPI and @PI-SRau, should Augusto's changes be E-727-specific or would they also apply to the other piezo controllers support by motorPIGCS2?:
There is a bug though, which I noticed also previously (also without this modification). If I use the asynRecord communication with the PI module, the poll thread starts to get timeouts for getting RAM parameters ("SPA?" commands) and position ("POS" commands) as soon as I set the ".OEOS" field in the asynRecord. I was thinking of maybe implementing a semaphore for this communication. (not yet done)
This problem is due to design decisions for handling both single-character commands that don't have a terminator and multi-character commands that require a terminator.
The driver sets the asyn records output end-of-string to an empty string in PIasynController.cpp
and expects that to not change:
The sendAndReceive
method of the PIInterface
class is overloaded. If sendAndReceive
is passed a C string, like when the version string is queried:
Then the sendAndReceive
method that is called adds a new line character:
If sendAndReceive
is passed a char instead, like when the moving status is polled:
Then the sendAndReceive
method that is called does NOT add any end-of-string characters:
There is a bug though, which I noticed also previously (also without this modification). If I use the asynRecord communication with the PI module, the poll thread starts to get timeouts for getting RAM parameters ("SPA?" commands) and position ("POS" commands) as soon as I set the ".OEOS" field in the asynRecord. I was thinking of maybe implementing a semaphore for this communication. (not yet done)
@AugustoHorita, are you able to send commands like SPA?
to the controller from the asyn record without causing driver errors by leaving the OEOS
blank and instead adding a \n
to the end of command in the AOUT
field? Sending SPA?\n
is much less intuitive, but if it works that could eliminate the need to change the driver further (and possibly introduce new bugs).
There is a bug though, which I noticed also previously (also without this modification). If I use the asynRecord communication with the PI module, the poll thread starts to get timeouts for getting RAM parameters ("SPA?" commands) and position ("POS" commands) as soon as I set the ".OEOS" field in the asynRecord. I was thinking of maybe implementing a semaphore for this communication. (not yet done)
@AugustoHorita, are you able to send commands like
SPA?
to the controller from the asyn record without causing driver errors by leaving theOEOS
blank and instead adding a\n
to the end of command in theAOUT
field? SendingSPA?\n
is much less intuitive, but if it works that could eliminate the need to change the driver further (and possibly introduce new bugs).
First of all, @kmpeters: thanks for your feedback and detailed explanation. I will try to send the command like you suggested and get back here to inform.
@kmpeters...Sending the commands like you suggested worked fine! Thanks one more time for your help.
Jens responded by email with info about the other piezo controllers:
"In general these change are valid for all piezo controllers, but there is one exception. The E-709 controller does not support the parameter 0x07030600."
Applying these features to most of the piezo controllers is outside the scope of this pull request. I'll create an issue for that.
Applying these features to most of the piezo controllers is outside the scope of this pull request. I'll create an issue for that.
The issue has been created: https://github.com/epics-motor/motorPIGCS2/issues/11
I am working with the PIE727 module and couldn't find support for gains and notch configuration. I implemented this code which works for us. I created a new class for PIE727 and also a header file with Closed Loop parameters and necessary structures. Included functions to set the CL parameters, and put the read function for these parameters in the poll thread.
There is a bug though, which I noticed also previously (also without this modification). If I use the asynRecord communication with the PI module, the poll thread starts to get timeouts for getting RAM parameters ("SPA?" commands) and position ("POS" commands) as soon as I set the ".OEOS" field in the asynRecord. I was thinking of maybe implementing a semaphore for this communication. (not yet done)