查看: 481|回复: 0

[项目提交] 智能车汽车尾门控制系统

[复制链接]
  • TA的每日心情
    开心
    昨天 07:18
  • 签到天数: 103 天

    连续签到: 4 天

    [LV.6]常住居民II

    发表于 2024-1-21 22:06:01 | 显示全部楼层 |阅读模式
    分享到:
    本帖最后由 eefocus_3914144 于 2024-1-22 18:29 编辑

    一、项目名称:
    智能车汽车尾门控制系统
    二、项目概述:
    我们在开启汽车尾门时,有时经常因为双手手抱物品而不方便开启后门,那用脚扫一扫能开启车门,就给车主提供了极大的方便。本系统采用STM32U585-IOT为主控芯片,其板载vl53l5cx时间飞行传感,实时的对运动物体的扫描,生成数据后,通过智能算法,实现对脚的动作进行识别,从而实现非接触方式来开启车门的综合控制系统。本系统只能脚的运动进行识别,对较小的物体或者非指定动手不予响应,实现精准识别。
    2.1系统框图
    系统框图.png
    2.2 测试初始化部分代码
    1. uint32_t R_total;  //用于合计右边的总运动强度
    2.         uint32_t L_total;  //用于合计左边的总运动强度
    3.         uint8_t check_sta;  //用于统计发生可以检测运动强度
    4.         
    5.         uint8_t dir_move_sta; //用于判断运动驱势
    6.         uint8_t FWD;
    7.         uint8_t                                 status, isReady, i;
    8.         VL53L5CX_Motion_Configuration         motion_config;        /* 运动配置 */
    9.         VL53L5CX_Object_t *pL5obj = CUSTOM_RANGING_CompObj[CUSTOM_VL53L5CX];
    10.         VL53L5CX_ResultsData         Results;                /* 来自VL53L5CX的结果数据 */

    11.         /*     编程运动指示器             */

    12.         status = vl53l5cx_motion_indicator_init(&pL5obj->Dev, &motion_config, VL53L5CX_RESOLUTION_8X8);
    13.         if(status)
    14.         {

    15.                 return status;
    16.         }
    17.         status = vl53l5cx_motion_indicator_set_distance_motion(&pL5obj->Dev, &motion_config, 1000, 2000);
    18.         if(status)
    19.         {

    20.                 return status;
    21.         }
    22.         /* 测距频率 */
    23.         status = vl53l5cx_set_ranging_frequency_hz(&pL5obj->Dev, 16);
    24.         if(status)
    25.         {
    26.                 return status;
    27.         }

    28.         /*          测距循环              */

    29.         status = vl53l5cx_start_ranging(&pL5obj->Dev);
    复制代码
    2.3 识别及控制部分代码:
    1.   status = vl53l5cx_check_data_ready(&pL5obj->Dev, &isReady);                        
    2.                 //如果前面
    3.                 if(isReady)
    4.                 {
    5.                         R_total =0;
    6.                         L_total = 0;
    7.                         /* 获取测距数据 */
    8.                         vl53l5cx_get_ranging_data(&pL5obj->Dev, &Results);
    9.                         for(i = 0; i < 16; i++)
    10.                         {
    11.                                 if(Results.motion_indicator.motion[motion_config.map_id[i]] >= 110)
    12.                                 {
    13.                                         check_sta ++;
    14.                                         break;//测试超过强度就跳出来
    15.                                 }
    16.                                 
    17.                         }
    18.                         if(check_sta > 0)  //做累积
    19.                         {
    20.                                 R_total = Results.motion_indicator.motion[motion_config.map_id[2]] +Results.motion_indicator.motion[motion_config.map_id[3]] + \
    21.                                                                         Results.motion_indicator.motion[motion_config.map_id[6]] + Results.motion_indicator.motion[motion_config.map_id[7]] + \
    22.                                                                         Results.motion_indicator.motion[motion_config.map_id[10]] + Results.motion_indicator.motion[motion_config.map_id[11]] +\
    23.                                                                         Results.motion_indicator.motion[motion_config.map_id[14]]  + Results.motion_indicator.motion[motion_config.map_id[15]];
    24.                                 L_total = Results.motion_indicator.motion[motion_config.map_id[0]] +Results.motion_indicator.motion[motion_config.map_id[1]] + \
    25.                                                                         Results.motion_indicator.motion[motion_config.map_id[4]] + Results.motion_indicator.motion[motion_config.map_id[5]] + \
    26.                                                                         Results.motion_indicator.motion[motion_config.map_id[11]] + Results.motion_indicator.motion[motion_config.map_id[12]] +\
    27.                                                                         Results.motion_indicator.motion[motion_config.map_id[12]]  + Results.motion_indicator.motion[motion_config.map_id[13]];
    28.                                                 //开始预测运动方向。
    29.                                 if(R_total>L_total && dir_move_sta == 0)
    30.                                 {
    31.                                         dir_move_sta = 1;
    32.                                 }
    33.                                 else if (R_total>L_total && dir_move_sta > 0)
    34.                                 {
    35.                                         dir_move_sta = 1;
    36.                                 }
    37.                                 else if(R_total < L_total && dir_move_sta > 0)
    38.                                 {
    39.                                         dir_move_sta = 2;
    40.                                 }
    41.                                 else
    42.                                 {
    43.                                         dir_move_sta = 0;
    44.                                 }
    45.                                 check_sta = 0;
    46.                         }        
    47.                         else
    48.                         {
    49.                                 //如果计算出符合预期,测做出运作
    50.                                 if(dir_move_sta == 2)
    51.                                 {
    52.                                         EN_high;
    53.                                         if(FWD == 0)
    54.                                         {
    55.                                                 DIR_high;
    56.                                                 FWD = 1;
    57.                                         }
    58.                                         else
    59.                                         {
    60.                                                 DIR_low;
    61.                                                 FWD = 0;
    62.                                         }
    63.                                         PwmNum = 500; //设定开门限度
    64.                                         HAL_TIM_PWM_Start_IT(&htim4,TIM_CHANNEL_1); //开启尾门
    65.                                         check_sta = 0;
    66.                                         dir_move_sta = 0;
    67.                                 }
    68.                                 else
    69.                                 {
    70.                                         dir_move_sta = 0;
    71.                                 }
    72.                                 
    73.                         }
    74.                 }               
    75.                 check_sta = 0;
    76.   }
    复制代码
    三、作品实物图
    全部的器件为:
    实物图1.png
    3.1 主控制为得捷采购的B-U585I-IOT02A 探索套件,其STM32U585AI 微控制器提供了一个完整的演示和开发**,其特点是 Arm Cortex‑M33 内核,带 Arm 信任区和 Armv8-M 主线安全扩展、2 MB 闪存和 786 KB SRAM 以及智能外围资源。B-U585I-IOT02A 探索套件通过利用低功率通信、多路传感和与云服务器的直接连接,实现了广泛的应用多样性。它包括 Wi-Fi 和蓝牙模块,以及麦克风、温度和湿度、磁力计、加速度计和陀螺仪、压力、飞行时间和手势检测传感器。此次采用[size=18.6667px]vl53l5cx飞行时间和手势检测传感器作为数据采集。
    主控.png
    3.2 步时电机驱动器
    驱动器.png
    3.3 步进电机及模拟汽车尾门,步进电机通过精准运动来实现尾门的开启与关闭。
    尾门.png
    四、作品视频介绍

    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-5-3 00:10 , Processed in 0.117039 second(s), 17 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.