91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

電磁環島的.c和.h文件,外加詳解文檔,用兩個電感檢測環島,測試方案很穩定,可以參考

資源截圖

代碼片段和文件信息

#include?“Control.h“
#include?“headfile.h“
uint8?Run_Flag?=?0;


int32?MOTOR_Duty_Left??=?0;
int32?MOTOR_Duty_Right?=0;
int32?MOTOR_Speed_Left?=?0;
int32?MOTOR_Speed_Right?=?0;?
int32?MOTOR_Speed_Left_Last?=?0;
int32?MOTOR_Speed_Right_Last?=?0;
int32?MOTOR_Left_Acc?=?0;
int32?MOTOR_Right_Acc?=?0;

float?SpeedRw?SpeedLw;
float?Speed_devSpeed_sumSteer_Radius;
int?Fres?=?0; //?動態參數變量
/*******?電機速度測量?********/


/*************************???其他控制變量????******************************************/
uint8??Set?=?0;
float???Set_Speed;
int8?????CS_Point_Num=0;
float???CS_P_Right?=?0.50CS_P_Left?=?0.50;//差速系數
/*******************掛擋變量聲明**************/
float?Set_CS_P_Right[2]?=?{0.500.7};
float?Set_CS_P_Left[2]?=?{0.500.7};
uint8?Set_Set[2]?=?{04};
int8??Last_Error[5]Point_Error;
uint8????Point; //目標點橫坐標
int8?????Point_Num=0;??//提前系數
uint8????Point_Mid?=?MIDVALUE;


void?Speed_Measure(void)
{??????
??????????????static?int32?ptA0_dataptH2_data;
??
????????/*******?右電機速度相關控制?********/
??????????????MOTOR_Speed_Right?=ctimer_count_read(SPEEDR_PIN)*100*Pulse_CM_coe;//右輪???
??????????????ctimer_count_clean(SPEEDR_PIN);?
??????????????
??????????????if(gpio_get(SPEEDR_DIR))?MOTOR_Speed_Right=-MOTOR_Speed_Right;????
???????????????else?MOTOR_Speed_Right=?MOTOR_Speed_Right;??
??????????????
??????????????MOTOR_Right_Acc?=?MOTOR_Speed_Right?-?MOTOR_Speed_Right_Last; //?計算加速度
??????????????
??????????????if(MOTOR_Right_Acc?>100)
??????????????MOTOR_Speed_Right?+=?100;
??????????????
??????????????else?if(MOTOR_Right_Acc???????????????MOTOR_Speed_Right?-=?100;
??????????????
??????????????else?
??????????????MOTOR_Speed_Right?=?MOTOR_Speed_Right;
???????????????
??????????????MOTOR_Speed_Right?=?range_protect(MOTOR_Speed_Right-500?500);?//限幅保護
??????????????MOTOR_Speed_Right_Last=MOTOR_Speed_Right;
????????/*******?右電機速度相關控制結束?********/
???????????????
???????????????
????????????/*******?左電機速度相關控制?********/
??????????????MOTOR_Speed_Left?=ctimer_count_read(SPEEDL_PIN)*100*Pulse_CM_coe;//右輪???
??????????????ctimer_count_clean(SPEEDL_PIN);?
??????????????if(gpio_get(SPEEDL_DIR))MOTOR_Speed_Left=MOTOR_Speed_Left;????
??????????????else?MOTOR_Speed_Left=?-MOTOR_Speed_Left;??

??????????????
??????????????
??????????????
??????????????MOTOR_Left_Acc?=?MOTOR_Speed_Left?-?MOTOR_Speed_Left_Last; //?計算加速度
??????????????if(MOTOR_Left_Acc?>100)
??????????????MOTOR_Speed_Left?+=?100;
?????????????
??????????????else?if(MOTOR_Left_Acc???????????????MOTOR_Speed_Left?-=?100;
??????????????
??????????????else?
??????????????MOTOR_Speed_Left?=?MOTOR_Speed_Left;
??????????????
??????????????MOTOR_Speed_Left?=?range_protect(MOTOR_Speed_Left-500?500);?//限幅保護
??????????????MOTOR_Speed_Left_Last=MOTOR_Speed_Left;
???
???????????????
???????????????
???????????????
????????????/*****************轉向和直道真實速度計算*****************/
?????????????
?????????????SpeedLw?=?MOTOR_Speed_Left

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????9805??2019-05-26?17:28??Control.c
?????文件????????1962??2019-05-14?20:34??Control.h
?????文件????????4022??2019-05-27?17:30??環島處理方法及對應代碼?(1).txt

評論

共有 條評論