使用stm32c8t6的hal库编写的pid平衡小车完整程序 使用stm32c8t6的hal库编写的pid平衡小车完整程序 使用stm32c8t6的hal库编写的pid平衡小车完整程序 使用stm32c8t6的hal库编写的pid平衡小车完整程序 使用stm32c8t6的hal库编写的pid平衡小车完整程序 使用stm32c8t6的hal库编写的pid平衡小车完整程序
2023-04-13 10:40:47 1.09MB stm32 c pid
1
PID学习——PID的PDF(器件介绍+原理+调试+入门) 包含学习套件地址,PID学习资料,对于的源码,源码对应的原理图 内含 PID源码 电机速度闭环控制 电机位置闭环控制 代码对应原理图
2023-03-04 12:17:38 3.16MB PID 平衡小车 PID学习资料
1
模糊PID即自适应PID,通过本程序可实现对平衡车模糊PID的优化控制,针对二阶的传递函数
主程序: #include "gyro.h" #include "pid.h" #include "motor.h" #define dt 10 // in ms /* Object definitions and settings */ Gyro myGyro(dt); PIDControl pid(1.0,0,0.005,-255,255,dt); OmniMotorDriver omd; /* Deadzone definition. With a rotation of less than this value, * the robot will stand still */ double deadzone = 1.5; /* Buffers for timing, gyro data and PID outputs */ long lastMillis; double xAngle, yAngle; double xOut, yOut; /* Main setup call * Initializes Serial, the IMU and prepares the motor driver, * calbriates the IMU and enables the PID controller */ void setup() { pinMode(13, OUTPUT); Serial.begin(115200); if(!myGyro.init()) { while(1) { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(2000); } } myGyro.calibrate(); omd.init(); pid.enable(); } /* Main loop * The main loop connects all the libraries and classes together, * in that it describes the order of function calls that is necessary * for the function of the robot */ void loop() { /* Save the current point in time in lastMillis */ lastMillis = millis(); /* Get Data from Gyro */ myGyro.update(&xAngle, &yAngle); /* Compute PID Output with the data */ pid.compute(xAngle, yAngle, &xOut, &yOut); /* Plot Angle on Serial Plotter Serial.print(xAngle); Serial.print(" "); Serial.print(yAngle); Serial.println(" "); */ /* Plot Angle on Serial Plotter Serial.print(xOut); Serial.print(" "); Serial.println(yOut); */ /* If any calculated angle is larger than the deadzone */ if(abs(xAngle) > deadzone || abs(yAngle) > deadzone) { /* Actually drive the motors */ omd.drive(xOut, yOut); /* Otherwise, stop them */ } else omd.stop(); /* Wait until the next dt cycle * if processing took less than dt, wait for the remaining time, * otherwise wait for the next full cycle to start * This is needed for gyro and PID accuracy */ int pTime = millis() - lastMillis; int resttime = (dt > pTime
2021-12-14 18:04:26 66.38MB Arduino 球轮机器人 PID平衡 3D建模
Arduino 使用MPU6050作为陀螺仪的平衡车程序,内含文档说明,代码说明,代码
2021-12-07 02:02:16 174KB Arduino C语言 文档说明 MPU6050
1
FREERTOS+PID平衡小车+野火上位机pid移植程序的代码,包括STM32CUBEMX的配置文件。
2021-08-17 09:07:05 26.89MB stm32 pid freertos
1