新部内対抗A班 / Mbed 2 deprecated circle_war_ver_A_NUCLEO__

Dependencies:   mbed

Fork of circle_war_ver_A_NUCLEO_ by 新部内対抗A班

speed_control.h

Committer:
baba2357
Date:
2016-04-05
Revision:
14:3403ce49a37a
Parent:
11:f8fac9693cd5

File content as of revision 14:3403ce49a37a:

//for speed control
#ifndef SPEED_CONTROL_H
#define SPEED_CONTROL_H

//Ticker rot_cal;
/*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;
float omega_now_f=0.0,omega_now_r=0.0,omega_now_l=0.0;
float rot_now_f=0.0,rot_now_r=0.0,rot_now_l=0.0;
float rot_old_f=0.0,rot_old_r=0.0,rot_old_l=0.0;
float rot_PID_f=0.0,rot_PID_r=0.0,rot_PID_l=0.0;
float rot_prop_f=0.0,rot_prop_r=0.0,rot_prop_l=0.0;
float rot_diff_f=0.0,rot_diff_r=0.0,rot_diff_l=0.0;
float rot_inte_f=0.0,rot_inte_r=0.0,rot_inte_l=0.0;
int dir_f,dir_r,dir_l;
const float Kp_f=30.0000f,Kd_f=200.0000f,Ki_f=0.0001f;
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;
*/
void motor_setting();
void rotation_cal();
void motor_f(int dir_f,float rot_target_f);
void motor_r(int dir_r,float rot_target_r);
void motor_l(int dir_l,float rot_target_l);
void motor_target(double rot_target_f,double rot_target_r,double rot_target_l);

#endif