Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: CONTROL/control.cpp
- Revision:
- 6:aad89fd109c2
- Parent:
- 5:6a95726e45b0
--- a/CONTROL/control.cpp Tue Oct 08 04:35:23 2019 +0000
+++ b/CONTROL/control.cpp Mon Dec 02 14:22:07 2019 +0000
@@ -8,19 +8,43 @@
{
if(c_control == 1)
command_control();
+
+ if(return_zero == 1)
+ {
+ if( abs(ppf) >= radmax )
+ cal_command.q_des_pf = ppf - radmax;
+ if( abs(ppf) < radmax )
+ cal_command.q_des_pf = 0;
+
+ cal_command.qd_des_pf = 0.0f;
+ cal_command.kp_pf = 60.0f;
+ cal_command.kd_pf = 10.0f;
+ cal_command.tau_pf_ff = 0.0f;
+
+ if( abs(pdf) >= radmax )
+ cal_command.q_des_df = pdf - radmax;
+ if( abs(pdf) < radmax )
+ cal_command.q_des_df = 0;
+
+ cal_command.qd_des_df = 0.0f;
+ cal_command.kp_df = 60.0f;
+ cal_command.kd_df = 10.0f;
+ cal_command.tau_df_ff = 0.0f;
+ }
+
if(c_lock == 1) // 处于PC串口锁定模式
{
cal_command.q_des_pf = SP_pf;
cal_command.qd_des_pf = 0.0f;
- cal_command.kp_pf = 800.0f;
- cal_command.kd_pf = 100.0f;
+ cal_command.kp_pf = 60.0f;
+ cal_command.kd_pf = 10.0f;
cal_command.tau_pf_ff = 0.0f;
cal_command.q_des_df = SP_df;
cal_command.qd_des_df = 0.0f;
- cal_command.kp_df = 800.0f;
- cal_command.kd_df = 100.0f;
+ cal_command.kp_df = 60.0f;
+ cal_command.kd_df = 10.0f;
cal_command.tau_df_ff = 0.0f;
}