User Tools

Site Tools


pidgesture

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
pidgesture [2017/06/03 00:51]
sirdomsen created
pidgesture [2017/07/03 01:54] (current)
silverxxx
Line 1: Line 1:
-===== Gesture PID tuning (under construction) =====+===== Gesture PID tuning =====
  
-Silverware branches of [[https://github.com/silver13/BoldClash-BWHOOP-B-03|BWHOOP]], [[https://github.com/silver13/H8mini_blue_board|H8BLUE]], [[https://github.com/silver13/H101-dual|H101/H8S]] and [[https://github.com/silver13/h8mini-dual|H8Green]] now have to possibility to tune the PIDs via Tx gestures (thanks to RCGroups user eitama for adding it!).+The [[:Gestures|gesture]] based PID tuning allows the pilot to change the acro PIDs at the field, without the use of a computer. The new PIDs can be saved, and will be loaded next time the quad powers up. If not saved by performing the appropriate gesture, they will be discarded when the quad is powered off. 
 + 
 +Silverware branches of [[https://github.com/silver13/BoldClash-BWHOOP-B-03|BWHOOP]], [[https://github.com/silver13/H8mini_blue_board|H8BLUE]] (both STM MCU), [[https://github.com/silver13/H101-dual|H101/H8S]] and [[https://github.com/silver13/h8mini-dual|H8Green]] (GigaDevice MCU) now have the possibility to tune the PIDs via Tx gestures (thanks to RCGroups user eitama for adding it!).
  
 New options in config.h: New options in config.h:
Line 11: Line 13:
 </code> </code>
  
-Make sure you have commented in "gestures2" on STM Silverwares, it won*t work otherwise!+Make sure you have commented in
  
-Basic instructions:+<code> 
 +#define GESTURES2_ENABLE 
 +</code> 
 + 
 +on STM Silverwares, it won't work otherwise! 
 + 
 +**Basic instructions:**
  
 The PIDs can be changed in the order you find them in pid.c The PIDs can be changed in the order you find them in pid.c
Line 19: Line 27:
 example: example:
  
-<code>// Kp                                                                                   ROLL       PITCH     YAW+<code> 
 +// Kp                           ROLL       PITCH     YAW
 float pidkp_flash[PIDNUMBER] = { 12.0e-2, 12.0e-2, 4e-1 }; float pidkp_flash[PIDNUMBER] = { 12.0e-2, 12.0e-2, 4e-1 };
- +// Ki
-// Ki                                                                                   ROLL       PITCH     YAW+
 float pidki_flash[PIDNUMBER] = { 6.5e-1, 6.5e-1, 50e-1 }; float pidki_flash[PIDNUMBER] = { 6.5e-1, 6.5e-1, 50e-1 };
- +// Kd
-// Kd                                                                                   ROLL       PITCH     YAW+
 float pidkd_flash[PIDNUMBER] = { 6.05e-1, 6.05e-1, 4e-1 }; float pidkd_flash[PIDNUMBER] = { 6.05e-1, 6.05e-1, 4e-1 };
 </code> </code>
Line 31: Line 38:
 If you plug in the battery, The "cursor" stands on PID value "P" on ROLL axis If you plug in the battery, The "cursor" stands on PID value "P" on ROLL axis
  
-Gestures are as follows:+**Gestures are as follows:**
  
-Up - Down - Up (further called UDU) (means right stick Up-Center-Down-Center-Up, others work similar) +   Up - Down - Up (further called UDU) (means right stick Up-Center-Down-Center-Up, others work similar) 
- +  Up - Down - Down (further called UDD) 
-Up - Down - Down (further called UDD) +  Up - Down - Left (further called UDL) 
- +  Up - Down - Right (further called UDR) 
-Up - Down - Left (further called UDL) +  Down - Down - Down (further called DDD)
- +
-Up - Down - Right (further called UDR) +
- +
-Down - Down - Down (further called DDD)+
  
 UDU: Cycle the Cursor to the next Row (Confirmed by LED Blinks, 1x Blink = P, 2x Blink = I, 3x Blink = D) UDU: Cycle the Cursor to the next Row (Confirmed by LED Blinks, 1x Blink = P, 2x Blink = I, 3x Blink = D)
  
-UDD: Cycle the Cursor to the next Column (ROLL --> PITCH --> YAW, also confirmed by the LED blinks as above)+UDD: Cycle the Cursor to the next Column (ROLL > PITCH > YAW, also confirmed by the LED blinks as above)
  
 //<font inherit/inherit;;#EE82EE;;inherit>note: If you selected #define COMBINE_PITCH_ROLL_PID_TUNING, you won't get the 2 blinks while changing the Column, as ROLL/PITCH are tuned simultaneously</font>// //<font inherit/inherit;;#EE82EE;;inherit>note: If you selected #define COMBINE_PITCH_ROLL_PID_TUNING, you won't get the 2 blinks while changing the Column, as ROLL/PITCH are tuned simultaneously</font>//
Line 53: Line 56:
 UDR: Increase the selected Value (Where the Cursor stands) by 10% UDR: Increase the selected Value (Where the Cursor stands) by 10%
  
-DDD: Save The selected PIDs to the Quad (note: this also performs an ACC calibration, make sure the quad is levelled at this moment or perform another ACC calibration later)+DDD: Save The selected PIDs to the Quad(Note: this performs an ACC calibration if PIDs are unchanged. If UDL/UDR is performed at least once, the ACC calibration is skipped and only the PIDs are saved.) 
 + 
 +For PID tuning, it's highly recommended to use [[:silvervise|SilverVISE]] Android app, where you can see the cursor and also see the PID numbers / changes. For all infos how to use the app please click at the link above. 
 + 
 +For all that don't own an Android device and are interested in the actual numbers, [[:using_debug_mode|debug mode]] can be used (with Keil), where the PIDs can be seen (as decimal numbers). Just add pidkp, pidki, and pidkd to the Watch1 window: 
 + 
 +{{https://static.rcgroups.net/forums/attachments/6/4/6/0/1/1/a10069931-74-pid_debug.png?nolink&1003x703}} 
 + 
 +**<font inherit/inherit;;#FF0000;;inherit>Important:</font>** 
 + 
 +<font inherit/inherit;;#FF0000;;inherit>Once the PIDs got changed and saved via gestures, they will stay even when you reflash the firmware, given that you //did not change the PIDs in PID.c. //Once these are changed, these will overwrite the PIDs in flash, so take care while using Debug Mode</font> 
 + 
 +<font inherit/inherit;;#FF0000;;inherit>Entering debug will automatically flash code unless a setting is turned off.</font> 
 + 
 +To use debug mode without reflashing the quad, you can do the following: 
 + 
 +In the last tab of the settings ( utilities uncheck "update target before debugging"
  
-For PID tuning, it's highly reecommended to use [[:silvervise|SilverVISE]] android app, where you can see the cursor and also see the PID numbers / changesFor all that don'own an Android device and are interested in the actual numbers, it'recommended to use the debug mode, where the PIDs could be seen (as decimal numbers!)+Also go to stlink - settings , where the algorithms are, and set "do not erase" , also uncheck program and verifyThis way it can't program it even if it tries to. This is just for added safety, the first option should do it but some things one really don'want erased even if it's unlikely. Be aware that this procedure only works if you use the exactly same Silverware version you flashed at the quad, otherwise you may get crappy values (because the values shown are stored in a particular memory section, and only the compiler knows where they are. Therefor, it'standard to reflash the code before using debug mode.
  
  
pidgesture.1496443916.txt.gz · Last modified: 2017/06/03 00:51 by sirdomsen