MATLAB: Modifying the power gain for the PARROT Minidrone

Aerospace BlocksetEmbedded Coderminidronesparrotparrot minidronessimulinkTarget Support Package

How do I change the power gain for the PARROT Minidrone?

Best Answer

After you have successfully generated code, create a PARROT object in the MATLAB command window using the command below.
>> rs = codertarget.parrot.internal.parrotminidrone
You can see the current setting for the power gain using the command below.
>> rs.getPowerGain
To change the value of the power gain, use the "rs.setPowerGain" command. For example, if you wanted to change the power gain to 10, you would use the command below.
>> rs.setPowerGain(10)
The power gain is a representation of the maximum power utilization of the minidrone's motors, and has a range from 0 to 100. To prevent unwanted accidents with the minidrone, it is a good practice to always set the power gain to 10 first. If you are satisfied with the performance at a power gain of 10, you can then increase the power gain up towards 100.