In multi-instrument context, if platform id=3, when using the python API set_by_gain_and_section to set PID behavior using the advanced functionality of the PID controller like the following:
pid.set_by_gain_and_section( channel=1, section=2, overall_gain=0.0, # Placeholder value prop_gain=0.0, # Placeholder value )
I get
moku.exceptions.InvalidParameterException: [‘Invalid section. Should be in between 1 and 1’]
Which is incorrect because there are two sections. This is a blocking problem for my application as set_by_gain doesn’t allow for me to utilize both sections to maintain a full output range while having a negative proportional gain.
An update: I attempted to enable section B prior to calling set_by_gain_and_section by loading a moku configuration file where I had manually enabled section B via advanced mode on the GUI.
Thank you for reaching out. I was able to replicate the error you are seeing using pid.set_by_gain_and_section(); I will report this to our team and update the thread once it has been fixed. As a workaround I was able to upload the .mokuconf files. Here is a snippet of the code I used:
That’s approximately useful, but I do still want to be able to update values programmatically. What kind of encoding is used in the 3_1_PID Controller file within the mokuconf? I think I can just make edits to an existing .mokuconf file and then load the settings to achieve what the API would normally do.
We have just released MokuOS 4.2 which includes a fix for this issue. Please download the new app here, upgrade your API package pip install --upgrade moku, and install the bitstreams mokucli instrument download 4.2.1. I hope this helps!