xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

電磁環(huán)島的.c和.h文件,外加詳解文檔,用兩個(gè)電感檢測(cè)環(huán)島,測(cè)試方案很穩(wěn)定,可以參考

資源截圖

代碼片段和文件信息

#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; //?動(dòng)態(tài)參數(shù)變量
/*******?電機(jī)速度測(cè)量?********/


/*************************???其他控制變量????******************************************/
uint8??Set?=?0;
float???Set_Speed;
int8?????CS_Point_Num=0;
float???CS_P_Right?=?0.50CS_P_Left?=?0.50;//差速系數(shù)
/*******************掛擋變量聲明**************/
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; //目標(biāo)點(diǎn)橫坐標(biāo)
int8?????Point_Num=0;??//提前系數(shù)
uint8????Point_Mid?=?MIDVALUE;


void?Speed_Measure(void)
{??????
??????????????static?int32?ptA0_dataptH2_data;
??
????????/*******?右電機(jī)速度相關(guān)控制?********/
??????????????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; //?計(jì)算加速度
??????????????
??????????????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);?//限幅保護(hù)
??????????????MOTOR_Speed_Right_Last=MOTOR_Speed_Right;
????????/*******?右電機(jī)速度相關(guān)控制結(jié)束?********/
???????????????
???????????????
????????????/*******?左電機(jī)速度相關(guān)控制?********/
??????????????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; //?計(jì)算加速度
??????????????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);?//限幅保護(hù)
??????????????MOTOR_Speed_Left_Last=MOTOR_Speed_Left;
???
???????????????
???????????????
???????????????
????????????/*****************轉(zhuǎn)向和直道真實(shí)速度計(jì)算*****************/
?????????????
?????????????SpeedLw?=?MOTOR_Speed_Left

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

評(píng)論

共有 條評(píng)論

相關(guān)資源