A temperature detection and PID heating control system extracted from Marlin firmware, implemented on STM32 platform. This project is currently under testing, and many features are still in development. 从 Marlin 固件中提取的温度检测和 PID 加热控制系统,在 STM32 平台上实现。该项目目前正在测试中,许多功能仍在开发中。
-
Fast GPIO operations for precise timing control
-
快速 GPIO 操作,实现精确的时序控制
-
Temperature measurement using thermistor
-
使用热敏电阻进行温度测量
-
PID control for stable temperature regulation
-
使用 PID 控制实现稳定的温度调节
-
Support for different heating elements
-
支持不同类型的加热元件
-
STM32 MCU (tested on STM32F1xx series)
-
STM32 微控制器(在 STM32F1xx 系列上测试通过)
-
Thermistor for temperature sensing (default: 100K NTC)
-
用于温度感测的热敏电阻(默认:100K NTC)
-
MOSFET for heater control
-
用于加热控制的 MOSFET
-
Temperature Sensor: PB1 (ADC input)
-
温度传感器:PB1(ADC 输入)
-
Heater Control: PA2 (PWM output) or PC13 (LED output)
-
加热控制:PA2(PWM 输出) 或者 PC13 (LED 输出)
-
Arduino STM32 core
-
Arduino STM32 核心库
-
PlatformIO build system
-
PlatformIO 构建系统
-
Clone this repository
-
克隆此仓库
git clone https://github.com/staff1010/MarlinTempControl.git
-
Open the project in PlatformIO
-
在 PlatformIO 中打开项目
-
Build and upload to your STM32 board
-
构建并上传到您的 STM32 开发板
-
Initialize the temperature control system:
-
初始化温度控制系统:
temperature_init();
-
Set target temperature and PID parameters:
-
设置目标温度和 PID 参数:
TARGET_TEMP 45 // Target temperature 目标温度 DEFAULT_Kp 22.20 // Proportional gain 比例系数 DEFAULT_Ki 1.08 // Integral gain 积分系数 DEFAULT_Kd 114.00 // Derivative gain 微分系数
For optimal temperature control, you may need to tune the PID parameters: 为了获得最佳的温度控制效果,您可能需要调整 PID 参数:
-
Start with conservative values:
-
从保守的值开始:
- Kp = 10.0
- Ki = 0.5
- Kd = 40.0
-
Adjust parameters based on system response
-
根据系统响应调整参数
This project is still in testing phase. Some features may not be fully implemented or may not work as expected. Please report any issues you encounter. 该项目仍处于测试阶段。一些功能可能尚未完全实现或可能无法按预期工作。请报告您遇到的任何问题。
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for discussion. 欢迎贡献!请随时提交 Pull Request 或开启一个 issue 进行讨论。
This project is licensed under the GPL-3.0 License - see the LICENSE file for details. 本项目采用 GPL-3.0 许可证 - 详见 LICENSE 文件。
-
Based on Marlin Firmware temperature control system
-
基于 Marlin 固件的温度控制系统
-
Thanks to the Marlin development team
-
感谢 Marlin 开发团队