<span style="color:#222222;font-family:Tahoma, Simsun;font-size:15px;background-color:#FFFFFF;">程序的原因吧,看看io配置</span>
<span style="color:#222222;font-family:Tahoma, Simsun;font-size:15px;background-color:#FFFFFF;">程序的原因吧,看看io配置</span>
<span style="color:#222222;font-family:Tahoma, Simsun;font-size:15px;background-color:#FFFFFF;">我觉得你可以进行调试,一步步来或者watch 时间看看</span>
<span style="color:rgba(0, 0, 0, 0.85);font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;font-size:16px;background-color:#FFFFFF;">可通过训练日志中的 checkpoints 文件继续训练,需确保配置文件与模型权重匹配。若出现 "list index out of range" 错误,需检查标签配置或数据集完整性。</span>
<span style="color:#222222;font-family:Tahoma, Simsun;font-size:15px;background-color:#FFFFFF;">PHJ口有中断功能 是中断</span>
<div class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space" style="font-size:16px;font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;background-color:#FFFFFF;color:var(--md-box-samantha-normal-text-color) !important;">
智能车主板正常工作电流以及短路时的电流情况并没有一个绝对固定的标准,会因智能车的具体设计、功能、配置以及工作状态等因素而有所不同,以下是一般情况下的分析:
</div>
<ul class="auto-hide-last-sibling-br" style="color:#222222;font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;font-size:16px;background-color:#FFFFFF;">
<li style="font-size:var(--md-box-samantha-normal-text-font-size);color:var(--md-box-samantha-normal-text-color) !important;">
<div class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space" style="font-size:var(--md-box-samantha-normal-text-font-size);color:initial;">
<span style="font-weight:600;color:initial;font-size:var(--md-box-samantha-normal-text-font-size);line-height:var(--md-box-samantha-normal-text-line-height);">正常工作电流</span>
</div>
<ul class="auto-hide-last-sibling-br" style="color:initial;">
<li style="font-size:var(--md-box-samantha-normal-text-font-size);color:initial;">
<span style="font-weight:600;color:initial;font-size:var(--md-box-samantha-normal-text-font-size);line-height:var(--md-box-samantha-normal-text-line-height);">简单功能智能车</span>:对于一些功能较为简单,仅具备基本行驶、转向功能,没有复杂传感器和通信模块的小型智能车,其主板正常工作电流可能在几十毫安到几百毫安之间。例如,采用小型直流电机、几个简单红外避障传感器的智能车,在正常行驶状态下,主板电流可能在 50mA - 200mA 左右。
</li>
<li style="font-size:var(--md-box-samantha-normal-text-font-size);color:initial;">
<span style="font-weight:600;color:initial;font-size:var(--md-box-samantha-normal-text-font-size);line-height:var(--md-box-samantha-normal-text-line-height);">复杂功能智能车</span>:如果是功能复杂的智能车,配备了高清摄像头、激光雷达、高精度定位模块、强大的计算芯片以及多种通信功能等,其正常工作电流会大很多,可能在 1A - 5A 甚至更高。比如,用于自动驾驶测试的智能车,其主板需要为各种高性能传感器和计算单元供电,工作电流可能达到 3A - 5A。
</li>
</ul>
</li>
<li style="font-size:var(--md-box-samantha-normal-text-font-size);color:var(--md-box-samantha-normal-text-color) !important;">
<div class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space" style="font-size:var(--md-box-samantha-normal-text-font-size);color:initial;">
<span style="font-weight:600;color:initial;font-size:var(--md-box-samantha-normal-text-font-size);line-height:var(--md-box-samantha-normal-text-line-height);">短路电流判断</span>
</div>
<ul class="auto-hide-last-sibling-br" style="color:initial;">
<li style="font-size:var(--md-box-samantha-normal-text-font-size);color:initial;">
<span style="font-weight:600;color:initial;font-size:var(--md-box-samantha-normal-text-font-size);line-height:var(--md-box-samantha-normal-text-line-height);">一般短路电流情况</span>:当智能车主板发生短路时,电流通常会明显增大,远远超出正常工作电流范围。一般来说,如果电流超过正常工作电流的 2 倍以上,很可能存在短路问题。例如,正常工作电流为 100mA 的智能车主板,当电流达到 200mA 以上且持续异常时,就需要考虑短路的可能性。
</li>
<li style="font-size:var(--md-box-samantha-normal-text-font-size);color:initial;">
<span style="font-weight:600;color:initial;font-size:var(--md-box-samantha-normal-text-font-size);line-height:var(--md-box-samantha-normal-text-line-height);">严重短路时</span>:在严重短路的情况下,电流可能会急剧上升到数安甚至更高,可能会导致电源保护机制触发,如保险丝熔断、电源芯片过热等现象。比如,在一些极端短路情况下,电流可能瞬间达到 5A - 10A,会使电源电路中的保护元件迅速动作。
</li>
</ul>
</li>
</ul>
<div class="auto-hide-last-sibling-br paragraph-JOTKXA paragraph-element br-paragraph-space" style="font-size:16px;font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;background-color:#FFFFFF;color:var(--md-box-samantha-normal-text-color) !important;">
在实际检测中,要准确判断智能车主板的电流是否正常以及是否存在短路,需要参考智能车的设计规格说明书,了解其正常工作电流范围,并结合实际测量的电流值进行综合分析。同时,可以使用专业的电路检测工具,如示波器、万用表等,对电流进行实时监测和分析,以确定是否存在短路等故障。
</div>
<p>
<table style="color:#404040;font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Oxygen, "Open Sans", sans-serif;font-size:16.002px;">
<tbody>
<tr>
<th style="color:rgb(var(--ds-rgb-label-1));text-align:left;">
<strong>现象</strong>
</th>
<th style="color:rgb(var(--ds-rgb-label-1));text-align:left;">
<strong>可能原因</strong>
</th>
<th style="color:rgb(var(--ds-rgb-label-1));text-align:left;">
<strong>解决措施</strong>
</th>
</tr>
</tbody>
<tbody>
<tr>
<td>
中断未触发
</td>
<td>
中断向量号错误
</td>
<td>
检查手册,更正 <code style="font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;">VECTOR_087</code> 定义
</td>
</tr>
<tr>
<td>
进入默认中断
</td>
<td>
ISR函数未正确链接
</td>
<td>
确保ISR函数名与向量一致,添加中断属性
</td>
</tr>
<tr>
<td>
接收数据但无中断
</td>
<td>
RIE位未使能
</td>
<td>
设置 `UART4_C2
</td>
<td>
= UART_C2_RIE_MASK`
</td>
</tr>
<tr>
<td>
程序卡死
</td>
<td>
未清除中断标志
</td>
<td>
在ISR中读取 <code style="font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;">UART4_D</code> 或手动清除标志
</td>
</tr>
<tr>
<td>
引脚无信号
</td>
<td>
复用配置错误
</td>
<td>
确认 <code style="font-size: 0.875em; font-weight: var(--ds-font-weight-strong); font-family: var(--ds-font-family-code); border-radius: 4px; padding: 0.15rem 0.3rem;">PORTE_PCR24/25</code> 的MUX值设为3
</td>
</tr>
</tbody>
</table>
<span><span style="font-size:16.002px;">
</span></span>
</p>
<span style="color:#8B8B8B;font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Oxygen, "Open Sans", sans-serif;font-size:14px;">如果之前没有接触过单片机,51可能更适合,因为它的学习曲线较平缓,容易上手,可以帮助建立基本的编程和硬件操作概念。</span>
在基于单片机的智能救援机器人小车的传感器数据处理中,卡尔曼滤波法和中值滤波法各有优劣,具体哪种效果更好取决于多种因素,以下是详细对比:
卡尔曼滤波:
中值滤波:
卡尔曼滤波:
中值滤波:
卡尔曼滤波:
中值滤波:
数据采集与初始化
滤波处理
均值滤波
收起
c
// 假设distance_buffer数组存储了超声波传感器采集的距离数据,长度为n
int sum = 0;
for (int i = 0; i < n; i++) {
sum += distance_buffer[i];
}
int filtered_distance = sum / n;
中值滤波
收起
c
// 假设intensity_buffer数组存储了红外传感器反射强度数据,长度为m
// 先进行排序(这里使用简单的冒泡排序法)
for (int i = 0; i < m - 1; i++) {
for (int j = 0; j < m - i - 1; j++) {
if (intensity_buffer[j] > intensity_buffer[j + 1]) {
int temp = intensity_buffer[j];
intensity_buffer[j] = intensity_buffer[j + 1];
intensity_buffer[j + 1] = temp;
}
}
}
// 取中值,假设m为奇数
int median_value = intensity_buffer[m / 2];
限幅滤波
收起
c
// 假设temperature为温度传感器采集的数据
if (temperature < 0 || temperature > 50) {
// 用最近的有效数据代替(假设last_valid_temperature为最近的有效温度值)
temperature = last_valid_temperature;
} else {
last_valid_temperature = temperature;
}
数据转换与归一化
normalized_value = (float)light_intensity / 1023.0
。数据融合
加权平均法示例:
distance_ultrasonic
,其权重为weight_ultrasonic
;视觉传感器测量的距离数据为distance_vision
,其权重为weight_vision
(权重根据传感器的精度、可靠性等因素确定,且weight_ultrasonic + weight_vision = 1
)。fused_distance = distance_ultrasonic * weight_ultrasonic + distance_vision * weight_vision
。异常检测与处理
问 求助一个编码器的奇葩问题