PI-PhysikInstrumente / PIPython

Python Library for using PI controllers with GCS command language
28 stars 3 forks source link

Error running sample wavegenerator_cricle.py #4

Closed jingibre closed 12 months ago

jingibre commented 2 years ago

Hi,

I am having some trouble getting the sample code to work. Its problem appears when setting the Wave Table Rate:

if pidevice.HasWTR(): # you can remove this code block if your controller does not support WTR() print('set wave table rate to {} for wave generators {}'.format(TABLERATE, wavegens)) pidevice.WTR(wavegens, [TABLERATE] * len(wavegens), interpol=[0] * len(wavegens))

Giving the following error:

pipython.pidevice.gcserror.GCSError: Parameter out of range (17).

I have managed to sort of make it work by replacing the

pidevice.WTR(wavegens, [TABLERATE] * len(wavegens), interpol=[0] * len(wavegens))

with

pidevice.WTR(0, [TABLERATE], interpol=[0]))

However, as imagined, it only affects table 0, leaving the other one unaffected. Thus, generating a spiral (TABLERATE = 10).

By printing

pidevice.qWTR()

it returns:

OrderedDict([(0, [10, 1])])

I have not been able to successfully access the remaining axis and edit the other TABLERATE.

I am running out of ideas, does this happen to anyone else?

I have an E727 driver.

Thanks in advance.

Software-PhysikInstrumente commented 2 years ago

For the most PI Controller the Table-Rate of the wave generators is coupled to the servo loop, and therefor their is only 1 wave table rate for all generators. Their is a more detailed description of how the wave generator works in the manual of the E-727. However the samples are generic and have sometimes to be modified to work with the specified controller.

LwnfL commented 1 year ago

Hi,

I am having some trouble getting the sample code to work. Its problem appears when setting the Wave Table Rate:

if pidevice.HasWTR(): # you can remove this code block if your controller does not support WTR() print('set wave table rate to {} for wave generators {}'.format(TABLERATE, wavegens)) pidevice.WTR(wavegens, [TABLERATE] * len(wavegens), interpol=[0] * len(wavegens))

Giving the following error:

pipython.pidevice.gcserror.GCSError: Parameter out of range (17).

I have managed to sort of make it work by replacing the

pidevice.WTR(wavegens, [TABLERATE] * len(wavegens), interpol=[0] * len(wavegens))

with

pidevice.WTR(0, [TABLERATE], interpol=[0]))

Just wanted to say that I've been getting the same error (with the 727 too) and was finding a solution for hours until I stumbled upon your issue. Thank you so much for your help!

Software-PhysikInstrumente commented 1 year ago

We are currently working on this and will inform you as soon as there is an update available.

Software-PhysikInstrumente commented 12 months ago

Upon review of your request we think that there is still some need for clarification:

We made some amendments to the documentation regarding controller-specific availability and parameterization of commands which will be included in the upcoming release 2.11.x for PIPython. Thank you for your feedback.