Skip to content
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

Rhs2116 step size algorithm does not account for requested amplitude #392

Open
bparks13 opened this issue Dec 23, 2024 · 0 comments · May be fixed by #393
Open

Rhs2116 step size algorithm does not account for requested amplitude #392

bparks13 opened this issue Dec 23, 2024 · 0 comments · May be fixed by #393
Assignees
Labels
bug Something isn't working
Milestone

Comments

@bparks13
Copy link
Member

The automated algorithm for choosing the step size with the minimum error does not account for the requested amplitude; it only uses the existing stimuli. This means that if there are no amplitudes stored in the Stimuli array, there are a number of cases where the step size that is chosen does not minimize the error.

As a concrete example, when opening a new configuration window the default step size is Rhs2116StepSize.Step5000nA (5 µA), and the stimuli array is empty. If the user then requests 0.12 µA, the algorithm will determine that there are no differences between any of the possible step sizes, and chooses the one closest to the original step size to minimize error. This leads to Rhs2116StepSize.Step100nA (0.1 µA) being chosen as the new step size. However, this means that there is an error of 0.02 µA between the requested amplitude and the actual value that will be used for stimulation.

There is a current workaround for this, but it requires the user to write 0.01 as the requested amplitude and apply it to a random channel so that it sets the current step size as 0.01 µA before they can then write in 0.12 and have it applied correctly.

To solve:
Add the requested amplitude as an input to the internal method that algorithmically determines the new step size. This will ensure that even if there are no stimuli saved, it will use this amplitude as a reference to minimize the error.

Addendum: Should we change the default step size to be Rhs2116StepSize.Step10nA for new objects? This does not solve the current problem, but it might make more sense to start at the highest resolution step size and then go up if the user requires a higher amplitude than this can achieve.

@bparks13 bparks13 added the bug Something isn't working label Dec 23, 2024
@bparks13 bparks13 added this to the 0.4.3 milestone Dec 23, 2024
@bparks13 bparks13 self-assigned this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant