Hi all,
I’m diving into ardupilot development (again, I’ve had an on/off relationship with the system for a few years) and in the process of developing some libraries I’ve run into some questions with regards to the current RPM implementation.
ap_rpm._maximum
, ap_rpm._minimum
and ap_rpm._quality_min
are declared and used as arrays despite the parameter configuration and reference manual implying they should instead be treated as universal parameters. The parameters however only allow you to set the first set and the reference manual indicates that these parameters would apply to both.
ap_rpm._quality_min
only every has its 0’th element addressed so it’s already treated as a non-array variable anyway.
As I understand it ap_rpm._maximum
and ap_rpm._minimum
are addressed by their indexes despite not being initialised to any particular value, currently this is caught in the below extract and the result is no limits are applied.
float maximum = ap_rpm._maximum[state.instance];
float minimum = ap_rpm._minimum[state.instance];
...
if ((maximum <= 0 || rpm <= maximum) && (rpm >= minimum)) {
I guess the questions I have are:
- Is this the correct interpretation of the current function of the library?
- Is this done intentionally, and is there any particular reason RPM is limited to 2 inputs only with common limits?
Expanding AP_RPM to allow A) More inputs and B) Different limits for each input would be quite desirable my end of things and doesn’t seem that much of a chore for me to change, I’m just looking at the current restrictions and wondering if there was some reason these limitations were enforced at some point? If not I’m happy to clean that up and expand to say 6 inputs?
RPM reference:
https://ardupilot.org/copter/docs/common-rpm.html