param.set_value() works...sometimes
Posted: Thu Aug 31, 2017 9:02 am
I'm encountering this issue where I am using cf.param.set_value(_,_) to help tune PID gains. However, when I try to change a few of them at once, and I check the log to see if they've changed, it's somewhat inconsistent whether or not the parameter changes.
In particular, what's happening is like this:
Say I have in the firmware kp=6.0, ki=1.0, kd=0.1. I have three successive lines of cf.param.set_value(_,_) to change these values to 0.0. In each run of my code (which does quite a bit more than just changing the PID gains), the link with the CF is closed. I am logging the pid gains to keep track of whether or not the PID gains have changed or not
After one run, none of these values change. After the second run, the kp value changes. The third run, nothing changes, but ki changes on the fourth. etc etc.
This doesn't have to happen every other time the code is run, but the point is that it changes, but inconsistently so.
I'm looking for some way to guarantee that the parameters change when param.set_value() is called.
Thanks!
In particular, what's happening is like this:
Say I have in the firmware kp=6.0, ki=1.0, kd=0.1. I have three successive lines of cf.param.set_value(_,_) to change these values to 0.0. In each run of my code (which does quite a bit more than just changing the PID gains), the link with the CF is closed. I am logging the pid gains to keep track of whether or not the PID gains have changed or not
After one run, none of these values change. After the second run, the kp value changes. The third run, nothing changes, but ki changes on the fourth. etc etc.
This doesn't have to happen every other time the code is run, but the point is that it changes, but inconsistently so.
I'm looking for some way to guarantee that the parameters change when param.set_value() is called.
Thanks!