Moderator

Standardizing the header file?

I may be completely 'off the path' here so please shoot this down if it's not popular...

Growing up metricized (is it a word?) I relate to logics of percentages, tens, hundreds, etc and get put off by some values in the header file like:

"#define THROTTLE_MAX 125  // (0-125) 70 = 56% maximum throttle..."

where 70 = 56%, could this (and some others) be standardized so that each is from 0-100? So if you put in 56 you got 56%? Obviously degrees are 0-360 and are familiar values so no changes needed there.

"#define SERVO_PITCH_P .006" could be 60 and something like "#define HEAD_MAX 4500" could be 45 for 45° (deg) rather than 4500.

I volunteer for this if it's popular but seeing as my maths wasn't that good at school (and that WAS a while ago) it may need to be checked, he he

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    We could modify ArduCopter Configurator for this use, currently we are working to integrate Mikro's & Jose's quad code to be one and we are also integrating Mikro's Configurator for this use.

    Yes there are still some main directives that you need to change from code it self but many of the changeable values like PID and things like that are done with Configurator. It runs on top of LabVIEW and one our group member is redoing it with C.

    So that could be one solution for this problem...

    --jp
  • I put the pid's into defines as usual, but then read them into var's. That whey I can auto uodate them from the Ardustation's eeprom. It was easy to automate(idiot prof). I also made them int's for reliable transmission. This way I can change them while flying.
  • Developer
    Hi Graham,
    Yes, the defines basically are a find and replace for code in Ardupilot. And because some of that, you are exposed to the needs of the micro instead of the needs of the user. This makes Ardupilot run much faster and use less ram.

    Doug and I are looking into ways to make it friendlier. Although we could write much of it into EEPROM with the config tool. We would still need to use defines for the compiler to generate the proper code for each setup. My current thinking is to make a GUI - a web page, or a PC tool - that will generate a header file for you, so you don't have to see the ugly numbers. Instead you would see 100% vs 125. (BTW, 125 * 8µs = 1000µs, the range of the servo PWM),

    Jason
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…