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.
Dependencies: mbed
Fork of circle_war_ver_A_NUCLEO_ by
Diff: speed_control.cpp
- Revision:
- 14:3403ce49a37a
- Parent:
- 11:f8fac9693cd5
--- a/speed_control.cpp Mon Apr 04 09:26:26 2016 +0000 +++ b/speed_control.cpp Tue Apr 05 17:25:09 2016 +0000 @@ -1,3 +1,4 @@ + #include "mbed.h" #include <pin_file.h> #include <speed_control.h> @@ -11,7 +12,8 @@ PwmOut wheell1(WHl1);//左部 PwmOut wheell2(WHl2); Ticker rot_cal; -/*float angle_f=0.0,angle_r=0.0,angle_l=0.0; + +float angle_f=0.0,angle_r=0.0,angle_l=0.0; float angle_old_f=0.0,angle_old_r=0.0,angle_old_l=0.0; float duty_out_f=0.0,duty_out_r=0.0,duty_out_l=0.0; float duty_PID_f=0.0,duty_PID_r=0.0,duty_PID_l=0.0; @@ -27,8 +29,8 @@ const float Kp_r=30.0000f,Kd_r=200.0000f,Ki_r=0.0001f; const float Kp_l=30.0000f,Kd_l=200.0000f,Ki_l=0.0001f; const float resolution=1024.0; -int t=0;*/ -/* +int t=0; + void motor_move() { wheelf1=0.1; @@ -38,7 +40,7 @@ wheell1=0.1; wheell2=0; } -*/ + ////////////////////////////モーターそれぞれのPID制御/////////////////////////