当前位置:网站首页>IMU 加热
IMU 加热
2022-07-28 17:24:00 【Gkbytes】
// 在此处设置引脚
void Util::set_imu_temp(float current)
{
#if HAL_HAVE_IMU_HEATER
if (!heater.target || *heater.target == -1) {
return;
}
// average over temperatures to remove noise
heater.count++;
heater.sum += current;
// update once a second
uint32_t now = AP_HAL::millis();
if (now - heater.last_update_ms < 1000) {
#if defined(HAL_HEATER_GPIO_PIN)
// output as duty cycle to local pin. Use a random sequence to
// prevent a periodic change to magnetic field
bool heater_on = (get_random16() < uint32_t(heater.output) * 0xFFFFU / 100U);
hal.gpio->write(HAL_HEATER_GPIO_PIN, heater_on);
#endif
return;
}
heater.last_update_ms = now;
current = heater.sum / heater.count;
heater.sum = 0;
heater.count = 0;
// experimentally tweaked for Pixhawk2
const float kI = 0.3f;
const float kP = 200.0f;
float target = (float)(*heater.target);
// limit to 65 degrees to prevent damage
target = constrain_float(target, 0, 65);
float err = target - current;
heater.integrator += kI * err;
heater.integrator = constrain_float(heater.integrator, 0, 70);
heater.output = constrain_float(kP * err + heater.integrator, 0, 100);
//hal.console->printf("integrator %.1f out=%.1f temp=%.2f err=%.2f\n", heater.integrator, heater.output, current, err);
#if HAL_WITH_IO_MCU
if (AP_BoardConfig::io_enabled()) {
// tell IOMCU to setup heater
iomcu.set_heater_duty_cycle(heater.output);
}
#endif
#endif // HAL_HAVE_IMU_HEATER
}
边栏推荐
- CVPR21-无监督异常检测《CutPaste:Self-Supervised Learning for Anomaly Detection and Localization》
- 优麒麟系统安装BeyondComare
- Libgdx learning path 01: libgdx introduction and running tutorial
- Minio distributed file system learning notes
- [filter tracking] target tracking based on EKF, TDOA and frequency difference positioning with matlab code
- Leetcode skimming - super power 372 medium
- Application of time series database in monitoring operation and maintenance platform
- [radar] radar signal online sorting based on kernel clustering with matlab code
- 使用Xilinx MIG验证硬件DDR设计
- From Bayesian filter to Kalman filter (2)
猜你喜欢

Application of time series database in monitoring operation and maintenance platform

Pytorch:快速求得NxN矩阵的主对角线(diagonal)元素与非对角线元素

Validate hardware DDR design with Xilinx MIG

2、 Uni app login function page Jump

Learn from Li Mu, deep learning - linear regression and basic optimization function
![[image hiding] digital image information hiding system based on DCT, DWT, LHA, LSB, including various attacks and performance parameters, with matlab code](/img/a4/5c5a90508e2f9c6b4f8e234bdfdc9e.png)
[image hiding] digital image information hiding system based on DCT, DWT, LHA, LSB, including various attacks and performance parameters, with matlab code

CVPR19 - 调参干货《Bag of Tricks for Image Classification with Convolutional Neural Network》

QT widget promoted to QWidget
![[machine learning] support vector machine classification](/img/6d/e4fb9b5bf82362edcebbf366f9b73e.png)
[machine learning] support vector machine classification

CVPR21-无监督异常检测《CutPaste:Self-Supervised Learning for Anomaly Detection and Localization》
随机推荐
[operation] differences between Oracle, MySQL and sqlserver
Application of TSDB in civil aircraft industry
【滤波跟踪】基于EKF、时差和频差定位实现目标跟踪附matlab代码
一家芯片公司倒在了B轮
Module 8 of the construction camp
[radar] radar signal online sorting based on kernel clustering with matlab code
Qt: 一个SIGNAL绑定多个SLOT
Solve the critical path in FJSP - with Matlab source code
ECS 5 workflow
How long does software testing take?
OAI L3 and L2 interface analysis
BM16 删除有序链表中重复的元素-II
6-20 vulnerability exploitation proftpd test
BLDC 6步换相 simulink
[data analysis] realize SVDD decision boundary visualization based on MATLAB
Youqilin system installation beyondcomare
优麒麟系统安装BeyondComare
2022年最火的十大测试工具,你掌握了几个
Can the training software test be employed
SRS4.0安装步骤