Revision for “ETP 520 Update gains system” created on November 18, 2015 @ 15:05:47
Title | ETP 520 Update gains system |
---|---|
Content | <h6 style="text-align: justify">1. PURPOSE / DESCRIPTION</h6>
<p style="text-align: justify">1.1 To update the Gain control system in DRONA firmware (set gain and get gain)</p>
<h6 style="text-align: justify">2. TEST SET-UP</h6>
<p style="text-align: justify">2.1 Drona: <a href="https://github.com/Vairdo/DRONA_firmware">https://github.com/Vairdo/DRONA_firmware</a>, version: 816ee47</p>
<h6 style="text-align: justify">3. PROCEDURE</h6>
<p style="text-align: justify">3.1 The gain system for DRONA can be summarized in the following table:</p>
<p style="text-align: justify"><a href="http://wiki.vairdo.com/wp-content/uploads/2015/11/p4.png"><img class="alignnone wp-image-193 size-full" src="http://wiki.vairdo.com/wp-content/uploads/2015/11/p4.png" alt="p4" width="1321" height="372" /></a></p>
<p style="text-align: justify">3.2 At the timing of writing, the gain update system has been implemented only the get gain function: <em><strong>SDP_Build_Gains_Packet()</strong></em>. Note that the parameter <em><strong>SDGetGainsCmd* cmd</strong> </em>is necessary for the function call because the gain type is determined by the request (please see 3.3)
3.3 There are three gain types: roll, pitch, and yaw. To response the get gain request from WiRa, we need to update the field in the gains packet (<em><strong>SDGainsPacket</strong></em> defined in <em>SDPackets.h</em>). The GainMask defined in the request command <em><strong>(SDGetGainsCmd</strong></em>) is to specify the gain type.
3.4 Read 9 gains from <em><strong>PIDPitch</strong></em>, <em><strong>PIDRoll</strong></em>, or <strong><em>PIDYaw</em></strong>, and write the 9 gains into the SPI Tx buffer (<em><strong>WRTXPacket</strong></em>). These were done by <em><strong>FC_PID_Get_Gains()</strong></em>.
3.5 <em><strong>SDP_Process_Set_Gains_Command ()</strong></em> is defined for setting gains, but hasn’t be implemented yet at the time of writing. To implement the set gain function, please refer to <em><strong>DFP_Process_set_Gains_Command()</strong></em> in <em>DFProtocol.c.</em> The API for setting gains provided by flight control is <em><strong>FC_PID_Set_xxx_yyy</strong> </em>(please see the table above).</p> |
Excerpt |