A method and system for determining going up or down stairs based on a barometer combined with gait
Patent Information
- Application Number
- CN202611446428.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-10-23
AI Technical Summary
基于气压计的方案利用气压随海拔高度变化的原理,通过设备内置气压计获取人体行走过程中的高度变化,进而判断上下楼状态,其结构简单、成本低,但气压测量对气流扰动极为敏感,户外风吹会引起气压值的瞬时波动,导致高度解算结果出现毛刺,容易造成上下楼状态的误判与频繁跳变;基于视觉的方案通过摄像头采集环境图像识别楼梯,识别结果直观,但需要额外配置视觉传感器与图像处理单元,结构复杂、成本较大,且受光照条件影响明显,同时也需要对现有外骨骼结构进行改动
1.本申请的方法由外骨骼机器人的控制器执行,其输入为电机角度与气压值等外骨骼机器人传感器的实测物理量,其输出直接用于控制外骨骼机器人助力模式的切换,属于对外骨骼机器人控制技术的改进;通过用步态判断纠正气压计判断,消除了风吹对气压计识别的影响,解决了气流扰动下上下楼误判的技术问题;
Smart Images

Figure CN122956479A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of exoskeleton robot control technology, and in particular to a method and system for determining going up and down stairs based on a barometer and gait. Background Technology
[0002] Exoskeleton robots, as wearable devices designed to enhance user mobility, are used in a variety of complex scenarios. Among these, going up and down stairs and slopes are common scenarios, requiring different assistance methods compared to flat ground: a greater assist torque is needed when going up stairs, while a corresponding support and cushioning torque is needed when going down stairs. Therefore, exoskeleton robots need to accurately and in real-time identify whether the wearer is on flat ground, going up or down stairs, in order to switch assistance modes accordingly. Otherwise, they may not only fail to provide effective assistance but also pose safety hazards due to a mismatch between the assistance mode and the walking status.
[0003] Currently, there are two main types of stair climbing recognition solutions: barometer-based and vision-based. Barometer-based solutions utilize the principle that air pressure changes with altitude, using a built-in barometer to measure height changes during walking and thus determine whether a person is climbing or descending stairs. These solutions are simple in structure and low in cost. However, air pressure measurement is extremely sensitive to airflow disturbances; outdoor wind can cause instantaneous fluctuations in air pressure, leading to spikes in the height calculation results and easily causing misjudgments and frequent jumps in stair climbing status. Vision-based solutions use cameras to capture environmental images to recognize stairs, providing intuitive results. However, they require additional visual sensors and image processing units, resulting in a complex structure, higher cost, and significant susceptibility to lighting conditions. They also require modifications to existing exoskeleton structures.
[0004] Therefore, how to eliminate the impact of airflow disturbances such as wind on barometer recognition and achieve accurate and reliable judgment of going up and down stairs without increasing hardware costs or changing the equipment structure has become an urgent technical problem to be solved in the assisted control of exoskeleton robots. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a method and system for determining whether to go up or down stairs based on a barometer and gait analysis. By combining barometer analysis with gait analysis, the gait analysis result is used to correct the barometer analysis result. This eliminates the influence of wind without increasing additional costs, and achieves an accurate determination of whether to go up or down stairs within approximately 3 steps.
[0006] Firstly, the method for determining going up and down stairs based on a barometer and gait analysis provided in this application adopts the following technical solution: A method for determining whether to go up or down stairs based on barometer readings and gait, the method being executed by the controller of an exoskeleton robot, comprising: The robot can acquire in real time the motor angles of the left and right legs corresponding to the wearer's walking process and the air pressure value collected by the barometer, which is built into the exoskeleton robot. The gait is determined based on the motor angle to obtain the first stair-climbing state: taking one step with the left leg plus one step with the right leg as a gait, the maximum and minimum values of the right leg angle corresponding to each gait are obtained in real time, the maximum value is subtracted from the minimum value to obtain the right leg angle width value of the gait, the right leg angle width value and its change amount of each gait are calculated, and the first stair-climbing state is determined based on the change amount. Based on the air pressure value, the air pressure is determined to obtain the second up-and-down state: the height value corresponding to the air pressure value is filtered to obtain a filtered height value. After the filtered height value stabilizes, a local height base value is obtained. The filtered height value is subtracted from the local height base value to obtain the relative height change. The relative height change is incrementally filtered and statistical features are extracted. The second up-and-down state is determined based on the statistical features. Based on the relative height change, the first stair-climbing state, and the second stair-climbing state, a final stair-climbing state is obtained: when the relative height change meets the height threshold condition corresponding to the target state for a preset duration, and at least one of the first stair-climbing state and the second stair-climbing state is the target state, the final stair-climbing state is switched to the target state, so as to control the exoskeleton robot to switch to the corresponding assistance mode according to the final stair-climbing state.
[0007] Optionally, the right leg angle width value is determined according to equation (1): (1) Where WR(k) is the right leg angle width value for the k-th gait. , These are the maximum and minimum values of the right leg angle within the k-th gait, respectively; The change is the difference in the right leg angle width between two adjacent gaits, determined according to equation (2): (2) in, Let be the change in the right leg angle width during the k-th gait.
[0008] Optionally, determining the first upstairs / downstairs state based on the change includes: making a state transition judgment by direction based on the current first upstairs / downstairs state and the change; When the current first stair-climbing state is a flat ground state: if the absolute value of the change is not greater than the first state threshold, it indicates that the walking leg swing amplitude has not changed significantly, and the flat ground state is maintained; if the change is less than the negative value of the first state threshold, it indicates that the walking leg swing amplitude has decreased, and the first stair-climbing state is switched to the downstairs state; if the change is greater than the first state threshold, it indicates that the walking leg swing amplitude has increased, and the first stair-climbing state is switched to the upstairs state. When the current first stair-going state is the stair-going state: if the change is not greater than the second gait threshold, it indicates that the walking leg swing amplitude has decreased, and the first stair-going state is switched to the flat ground state; otherwise, the stair-going state is maintained. When the current first stair-going state is the downstairs state: if the change is not less than the third gait threshold, it indicates that the walking leg swing amplitude has rebounded, and the first stair-going state is switched to the flat ground state; otherwise, the downstairs state is maintained; wherein, the third gait threshold is a negative value; Wherein, the absolute values of the second gait threshold and the third gait threshold are both less than the first gait threshold, so that the switching between the first stair-climbing state and the flat ground state forms a hysteresis, avoiding frequent state jumps when the change fluctuates near the threshold; the first gait threshold, the second gait threshold and the third gait threshold are calibrated based on measured walking data.
[0009] Optionally, the step of filtering the altitude value corresponding to the air pressure value to obtain a filtered altitude value, and obtaining a local altitude base value after the filtered altitude value stabilizes, includes: At the moment of power-on, the altitude value corresponding to the air pressure value rises sharply to near the local value, and the altitude value is obtained by low-pass filtering. When the fluctuation range of the filtered height value within the preset observation window is less than the stable threshold, the filtered height value is determined to be stable, and the current filtered height value is used as the local height base value. The relative height change is determined according to equation (3): (3) in, This is the current filtered height value. The local height base value, This represents the change in relative altitude at the current moment.
[0010] Optionally, the incremental filtering and statistical feature extraction of the relative height change includes: The incremental sequence of the relative height change is filtered, and statistical features are extracted within a sliding time window. The statistical features include peak value, trough value, mean, and slope. The mean is determined according to equation (4), and the slope is determined according to equation (5). (4) (5) Where N is the number of sampling points in the sliding time window, The sampling period is This is the mean at the current moment. The slope at the current moment.
[0011] Optionally, determining the second upstairs / downstairs status based on the statistical characteristics includes: When the current second stair-climbing state is a flat ground state: if the mean value is within the first mean value interval or the slope is within the first slope interval, it indicates that the air pressure fluctuation is not large and walking tends to be flat ground. Set the second stair-climbing state to the flat ground state and record the corresponding flat ground transition sub-state. When the current second stair-climbing state is a flat ground state: if the mean value is greater than the first mean threshold or the slope is greater than the first slope threshold, the second stair-climbing state is set to the first trend state; When the current second stair-climbing state is a flat ground state: if the mean is less than the third mean threshold or the slope is less than the third slope threshold, the second stair-climbing state is set to the second trend state; When the current second up / down stair state is the downstair state: if the average value is not less than the second average value threshold or the absolute value of the slope is not greater than the second slope threshold, it indicates that the air pressure value is still increasing and is still in a downstair trend. A first trend transition sub-state is recorded to maintain the first trend state; if the average value is less than the second average value threshold or the slope is less than the third slope threshold, it indicates that the air pressure value has fallen back to the horizontal position. The second up / down stair state is switched to the flat ground state. When the current second up-and-down state is the up-and-down state: if the average value is not greater than the fourth average threshold or the absolute value of the slope is not greater than the fourth slope threshold, it indicates that the air pressure value continues to decrease and is still in the up-and-down trend. A second trend transition sub-state is recorded to maintain the second trend state; if the average value is greater than the fourth average threshold or the slope is greater than the first slope threshold, it indicates that the air pressure value has fallen back to the horizontal position. The second up-and-down state is switched to the flat ground state.
[0012] After classifying and mapping each trend state with its corresponding transition sub-state, the second upstairs / downstairs state is output: the flat ground state is mapped to the flat ground transition sub-state as the flat ground state, the first trend state is mapped to the first trend transition sub-state as the downstairs state, and the second trend state is mapped to the second trend transition sub-state as the upstairs state. That is, the second upstairs / downstairs state is the upstairs state, the downstairs state, or the flat ground state.
[0013] Optionally, the fusion judgment adopts a three-state machine, and the final upstairs / downstairs state includes an upstairs state, a downstairs state, and a level ground state; wherein, the relative height change increases with the increase of the air pressure value, the relative height change in the downstairs direction is positive, and the relative height change in the upstairs direction is negative; the state switching conditions include: Switching from flat ground state to downstairs state: The relative height change is greater than a first height threshold and lasts for the preset duration, and either the first upstairs / downstairs state is the downstairs state or the second upstairs / downstairs state is the downstairs state; Switching from flat ground state to upstairs state: The relative height change is less than the negative value of the first height threshold and continues for the preset duration, and either the first upstairs / downstairs state is upstairs state or the second upstairs / downstairs state is upstairs state; Switching from an upstairs or downstairs state to a flat ground state: the absolute value of the relative height change is not greater than the first height threshold and continues for the preset duration, and the first upstairs or downstairs state is a flat ground state or the second upstairs or downstairs state is a flat ground state; Switching directly from going upstairs to going downstairs: The relative height change is greater than the first height threshold and lasts for the preset duration, and the first upstairs / downstairs state is the downstairs state or the second upstairs / downstairs state is the downstairs state; Switching directly from going downstairs to going upstairs: The relative height change is less than the negative value of the first height threshold and lasts for the preset duration, and the first upstairs / downstairs state is the upstairs state or the second upstairs / downstairs state is the upstairs state; If no state transition condition is met, the current final upstairs / downstairs state remains unchanged.
[0014] Optionally, when the instantaneous air pressure fluctuation caused by the wind causes the relative height change to briefly exceed the first height threshold, since the duration of exceeding the first height threshold is less than the preset duration, and the first up-and-down state does not provide a state corresponding to the instantaneous air pressure fluctuation, the state switching condition is not met, and the final up-and-down state remains unchanged, so as to eliminate the influence of the wind on the up-and-down judgment by correcting the air pressure judgment through the gait judgment.
[0015] Optionally, controlling the exoskeleton robot to switch to the corresponding assistance mode based on the final stair-climbing state includes: When the final up-and-down state is the up-and-down state, control the exoskeleton robot to switch to the up-and-down assist mode and output hip joint assist torque according to the up-and-down assist curve; When the final state of going up and down stairs is the state of going down stairs, control the exoskeleton robot to switch to the mode of going down stairs assisting, and output the hip joint assisting torque according to the down stairs assisting curve; When the final state of going up and down stairs is a flat ground state, control the exoskeleton robot to switch to flat ground assist mode.
[0016] Secondly, this application provides a system for determining whether to go up or down stairs based on a barometer and gait, deployed in the controller of an exoskeleton robot, comprising: The data acquisition module is used to acquire in real time the motor angles corresponding to the left and right legs of the wearer during walking, as well as the air pressure value collected by the barometer, which is built into the exoskeleton robot. The gait determination module is used to determine the gait based on the motor angle to obtain the first up and down stairs state; The air pressure judgment module is used to judge the air pressure based on the air pressure value to obtain the second upstairs / downstairs status; The fusion judgment module is used to perform a fusion judgment based on the relative height change, the first up-and-down state and the second up-and-down state to obtain the final up-and-down state. The assist control module is used to control the exoskeleton robot to switch to the corresponding assist mode based on the final up-and-down state.
[0017] In summary, this application includes at least one of the following beneficial technical effects: 1. The method of this application is executed by the controller of the exoskeleton robot. Its input is the measured physical quantities of the exoskeleton robot sensors, such as motor angle and air pressure value. Its output is directly used to control the switching of the exoskeleton robot's assist mode, which is an improvement of the exoskeleton robot control technology. By using gait judgment to correct the barometer judgment, the influence of wind on barometer recognition is eliminated, and the technical problem of misjudgment when going up and down stairs under airflow disturbance is solved. 2. Gait judgment is based on the right leg angle width value and its variation in each gait. It is judged at the granularity of one gait, and is not affected by individual gait speed differences and airflow disturbances. It complements and corroborates air pressure judgment, improving the accuracy and robustness of the judgment of going up and down stairs. 3. The fusion judgment requires that the relative height change meets the height threshold condition and continues for a preset duration, and that at least one of the gait judgment and air pressure judgment gives the target state before switching is allowed. This mechanism filters out the instantaneous air pressure spikes caused by wind and avoids frequent state jumps. 4. The entire solution utilizes only the existing motor angle sensor and built-in barometer of the exoskeleton robot, without requiring structural modifications or additional hardware costs. Actual staircase tests show that at a normal speed, it takes about 3 steps to accurately determine whether a person is going up or down a staircase, and the results are accurately compared with the actual situation. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the first embodiment of the method for determining going up and down stairs based on a barometer and gait according to this application; Figure 2 This is a flowchart of the gait judgment algorithm for going up and down stairs based on the first embodiment of the method for judging going up and down stairs based on barometer and gait in this application. In this flowchart, 2-a shows the judgment logic for transitioning from flat ground state to upstairs state or downstairs state, 2-b shows the judgment logic for transitioning from upstairs state back to flat ground state, and 2-c shows the judgment logic for transitioning from downstairs state back to flat ground state. Figure 3 This is a flowchart of the barometer-based method for determining whether a person is going up or down stairs, based on a barometer and gait, in the first embodiment of this application. It includes four sub-logic: transitioning from a flat ground state to an upward or downward trend, transitioning from a downward trend back to a flat ground state, transitioning from an upward trend back to a flat ground state, and multi-state classification mapping. Figure 4 This is a flowchart of the first embodiment of the method for determining whether to go up or down stairs based on barometer and gait, as described in this application; Figure 5 This is a structural block diagram of the first embodiment of the system for determining going up and down stairs based on a barometer and gait, as described in this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0020] This application provides a method for determining whether someone is going up or down stairs based on a barometer and gait analysis, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for determining whether to go up or down stairs based on a barometer and gait according to this application. In this embodiment, the method includes the following steps: Step S10: Real-time acquisition of the motor angles corresponding to the left and right legs of the wearer during walking, as well as the air pressure value collected by the barometer.
[0021] It should be noted that both the left and right leg joints of the exoskeleton robot are equipped with drive motors. Angle sensors attached to these motors provide real-time feedback on the motor angles, which change periodically with the wearer's leg movements, reflecting the wearer's real-time gait. A barometer is built into the exoskeleton robot to collect ambient air pressure values in real time. These pressure values are converted to corresponding altitude values using a pressure-altitude conversion relationship: as altitude increases, air pressure decreases and the corresponding altitude value increases; conversely, as altitude decreases, air pressure increases and the corresponding altitude value decreases. The controller synchronously collects the left and right leg motor angles and air pressure values at a fixed sampling period, for example, 10ms.
[0022] Step S20: Gait judgment is performed based on the motor angle to obtain the first upstairs / downstairs state.
[0023] Reference Figure 2 , Figure 2 This is a schematic diagram of the algorithm for determining whether someone is going up or down stairs based on their gait.
[0024] In this step, a gait is defined as one step with the left leg plus one step with the right leg, and the maximum value of the right leg angle corresponding to each gait is obtained in real time. and minimum value The difference between the maximum and minimum values is used as the right leg angle width value for that gait. : (1) in, Let θmax(k) be the right leg angle width value in the k-th gait, and θmin(k) be the maximum and minimum values of the right leg angle in the k-th gait, respectively. Then, calculate the right leg angle width value and its variation for each gait. That is, the difference in the right leg angle width between two adjacent gaits: (2) in, The change in the angle width of the right leg in the k-th gait; the first up / down state Gait_updown_state is determined based on the change.
[0025] The judgment mechanism is as follows: when going upstairs, the wearer needs to lift their leg to step onto the step, and the leg swing amplitude is significantly increased compared to walking on flat ground. The right leg angle width value increases accordingly, and the change is positive and the amplitude is large. When going downstairs, the leg swing amplitude is reduced compared to walking on flat ground, and the right leg angle width value decreases accordingly, and the change is negative. When walking on flat ground, the leg swing amplitude of adjacent gaits is basically the same, and the change fluctuates around zero.
[0026] In this embodiment, the value of the first up / down state (Gait_updown_state) is defined as follows: 0 represents the upstairs state, 1 represents the flat ground state, and 2 represents the downstairs state. Gait determination uses a three-state machine, which performs directional state transitions based on the current up / down state and its changes. Reference Figure 2 In section 2-a, when the current first stair-going state is on flat ground: if the absolute value of the change is not greater than the first state threshold (e.g., 1.5 degrees), it indicates that the leg swing amplitude has not changed significantly, and the flat ground state is maintained; if the change is less than the negative value of the first state threshold (e.g., less than -1.5 degrees), it indicates that the leg swing amplitude has decreased, and the state is switched to going downstairs; if the change is greater than the first state threshold (e.g., greater than 1.5 degrees), it indicates that the leg swing amplitude has increased, and the state is switched to going upstairs. Reference Figure 2 In step 2-b, when the current first up-and-down state is the up-and-down state: if the change is not greater than the second gait threshold (e.g., 1.0 degrees), it indicates that the leg swing amplitude has fallen back to the flat ground level and the state is switched to the flat ground state; otherwise, the up-and-down state is maintained. Reference Figure 2 In step 2-c, when the current first step down / up / down state is down / down state: if the change is not less than the third gait threshold (e.g., -1.0 degrees), it indicates that the leg swing amplitude has returned to the level of the ground and the state is switched to the level of the ground; otherwise, the down / up / down state is maintained.
[0027] The absolute values of the second and third gait thresholds are both smaller than the first gait threshold, causing hysteresis during state transitions: transitioning from flat ground to going up or down stairs requires a larger change in leg swing amplitude, while returning from going up or down stairs to flat ground only requires a smaller change, thus avoiding erratic state fluctuations when the change amplitude hovers around the threshold. In practice, a moving average filter can be applied to the change amplitude sequence to suppress random noise in gait measurements. The aforementioned first, second, and third gait thresholds can be calibrated based on actual walking data to adapt to different wearers and different device models.
[0028] It should be noted that gait judgment outputs results with gait as the granularity, and it is based on the mechanical movement characteristics of human walking. It is completely unaffected by airflow disturbances such as wind, which forms the basis for this application to correct barometer judgment.
[0029] Step S30: Determine the air pressure based on the air pressure value to obtain the second upstairs / downstairs status.
[0030] Reference Figure 3 , Figure 3 This is a flowchart illustrating the algorithm for using a barometer to determine whether a floor is up or down. This step includes three sub-processes: (1) Base value acquisition: The altitude value realheight corresponding to the air pressure value rises sharply to near the local value at the moment of power-on. The filtered altitude value is obtained by low-pass filtering realheight. ,when When the fluctuation amplitude within the preset observation window is less than the stability threshold, it is determined that... It is stable now, take the current one. As the local height base value This leads to the relative height change. : (3) in, This is the current filtered height value. This is the local height base value. This represents the relative altitude change at the current moment. By subtracting the local baseline value, the influence of differences in air pressure baselines at different locations and under different weather conditions is eliminated, allowing subsequent judgments to rely solely on altitude.
[0031] (2) Feature extraction: for relative height change Incremental filtering is performed on the incremental sequence to extract statistical features, including peak values, within a sliding time window. trough value mean With slope The mean and slope are calculated according to equations (4) and (5), respectively: (4) (5) Where N is the number of sampling points in the sliding time window, The sampling period is specified. Incremental filtering can highlight highly variable trend components and suppress gradual drift and high-frequency glitches.
[0032] (3) State determination According to the mean With slope The system combines the current internal air pressure state (barstate) to determine the state transition in different directions, and outputs the second up / down state (Out_barstate) after state classification and mapping. It should be noted that in this embodiment, the relative height change and its statistical characteristics increase with increasing air pressure; that is, the mean and slope are positive in the downhill direction (increasing air pressure, decreasing altitude), and negative in the uphill direction (decreasing air pressure, increasing altitude). The values of the internal air pressure state (barstate) are defined as follows: 0 represents the uphill trend state, 1 represents the flat ground state, 2 represents the downhill trend state, 10 represents the flat ground transition sub-state, 20 represents the downhill trend transition sub-state, and 30 represents the uphill trend transition sub-state.
[0033] The logic for judging whether a trend is shifting from flat ground to an upward or downward trend (corresponding to...) Figure 3 (the branch where barstate==1). If the mean is within the first mean interval (±1) or the slope is within the first slope interval (±0.7), it indicates that the air pressure fluctuation is not large and the walking is tending to be flat. Maintain the flat state and record the corresponding flat transition sub-state (barstate is recorded as 10, and the next step of up / down / flat can be determined based on this). If the mean is greater than the first mean threshold (1) or the slope is greater than the first slope threshold (0.7), it indicates that the air pressure value is rising rapidly and the walking tends to go downstairs. The internal air pressure state is set to the first trend state (barstate=2, corresponding to the direction of going downstairs). If the mean is less than the third mean threshold (-1) or the slope is less than the third slope threshold (-0.7), it indicates that the air pressure value is dropping rapidly and walking tends to go upstairs. The internal air pressure state is set to the second trend state (barstate=0, corresponding to the upstairs direction). The logic for determining whether a downward trend will reverse back to a flat state (corresponding to) Figure 3 (the branch where barstate==2). If the mean is not less than the second mean threshold (1.5) or the absolute value of the slope is not greater than the second slope threshold (0.7), it indicates that the air pressure is still increasing and is still in a downward trend. Record the first trend transition sub-state (barstate 20) to maintain the first trend state. If the mean is less than the second mean threshold (1.5) or the slope is less than the third slope threshold (-0.7), it indicates that the air pressure value has rapidly dropped back to the horizontal position, and the internal air pressure state is switched to the flat state (barstate=1). The logic for judging the transition from an upward trend to a flat state (corresponding to) Figure 3 (the branch where barstate==0). If the mean is not greater than the fourth mean threshold (-1.5) or the absolute value of the slope is not greater than the fourth slope threshold (0.7), it indicates that the air pressure value continues to decrease and is still in the upward trend. Record the second trend transition sub-state (barstate is 30) to maintain the second trend state. If the mean is greater than the fourth mean threshold (-1.5) or the slope is greater than the first slope threshold (0.7), it indicates that the air pressure value has rapidly dropped back to a horizontal position, and the internal air pressure state is switched to the flat ground state (barstate=1). Finally, state classification mapping is performed. When the internal air pressure state is the flat ground state or the flat ground transition sub-state (barstate is 1 or 10), the output Out_barstate=1, that is, the second up / down staircase state is the flat ground state; when the internal air pressure state is the first trend state or the first trend transition sub-state (barstate is 2 or 20), the output Out_barstate=2, that is, the second up / down staircase state is the downstairs state; when the internal air pressure state is the second trend state or the second trend transition sub-state (barstate is 0 or 30), the output Out_barstate=0, that is, the second up / down staircase state is the upstairs state. That is, the value of the second up / down staircase state Out_barstate output externally is defined as: 1 represents flat ground, 0 represents upstairs, and 2 represents downstairs. The setting of transition sub-states enables the trend to be maintained once it is formed, avoiding the state from fluctuating back and forth when the statistical characteristics fluctuate slightly around the threshold.
[0034] Step S40: Based on the relative height change, the first stair-climbing state and the second stair-climbing state, a final stair-climbing state is obtained, and the exoskeleton robot is controlled to switch to the corresponding assist mode.
[0035] Reference Figure 4 , Figure 4 This is a schematic diagram of the algorithm for determining whether a person is going up or down stairs using a barometer and gait analysis. The fusion judgment uses a three-state machine. The final state (State) for going up or down stairs is defined as follows: 0 represents going upstairs, 1 represents level ground, and 2 represents going downstairs, consistent with the value conventions of the first state (Gait_updown_state) and the second state (Out_barstate). State transitions must simultaneously satisfy height, duration, and verification conditions. Switching from flat ground state (State==1) to downstairs state: The relative height change H0 (i.e. Hslow) is greater than the first height threshold a and lasts for a preset duration T milliseconds, and the first upstairs / downstairs state is downstairs state (Gait_updown_state==2) or the second upstairs / downstairs state is downstairs state (Out_barstate==2). Switching from flat ground state (State==1) to upstairs state: The relative height change is less than the negative value of the first height threshold -a and lasts for a preset duration of T milliseconds, and the first upstairs / downstairs state is upstairs state (Gait_updown_state==0) or the second upstairs / downstairs state is upstairs state (Out_barstate==0). Switching from going upstairs or going downstairs to flat ground: The absolute value of the relative height change is not greater than the first height threshold and lasts for a preset duration, and the first or second going upstairs / downstairs state is flat ground; Furthermore, direct switching is allowed between the upstairs and downstairs states: when the current state is upstairs (State==0), if the relative height change is greater than the first height threshold 'a' and lasts for a preset duration of T milliseconds, and the first upstairs / downstairs state is downstairs or the second upstairs / downstairs state is downstairs, then the state is directly switched to downstairs (State=2); when the current state is downstairs (State==2), if the relative height change is less than the negative value of the first height threshold - 'a' and lasts for a preset duration of T milliseconds, and the first upstairs / downstairs state is upstairs or the second upstairs / downstairs state is upstairs, then the state is directly switched to upstairs (State=0). If no state transition condition is met, the current final upstairs / downstairs state remains unchanged.
[0036] In the aforementioned fusion mechanism, the corrective effect of gait judgment on air pressure judgment is manifested in the following ways: although the instantaneous fluctuation of air pressure caused by wind may cause the relative height change to briefly exceed the first height threshold, on the one hand, its duration is less than the preset duration T milliseconds; on the other hand, the wearer's gait does not change at this time, and the gait judgment still gives the original state, so the verification condition is not met. Therefore, the final state of going up or down stairs will not be mistakenly switched due to wind. Conversely, when the wearer actually starts going up or down stairs, the height change and gait change occur simultaneously and verify each other. The state machine can complete the switch within approximately one gait order of magnitude. It should be noted that the above verification condition adopts "OR" logic, which allows switching to be supported if either the gait judgment or the air pressure judgment gives the correct trend first, ensuring the real-time nature of the recognition. The dual constraints of the height threshold and duration ensure anti-interference capability. Together, these two constitute one of the core inventive points of this application.
[0037] After obtaining the final up-and-down state, the controller controls the exoskeleton robot to switch to the corresponding assistance mode: when the final up-and-down state is up-and-down, it switches to the up-and-down assistance mode and outputs hip joint assistance torque according to the up-and-down assistance curve; when it is down-and-down, it switches to the down-and-down assistance mode and outputs hip joint assistance torque according to the down-and-down assistance curve; when it is flat ground, it switches to the flat ground assistance mode, thereby achieving on-demand assistance.
[0038] In practical implementation, the method of this embodiment can achieve the following beneficial effects: gait judgment and air pressure judgment corroborate each other, eliminating the influence of wind on barometer recognition, and the judgment of going up and down stairs is accurate and reliable; it only uses the existing motor angle sensor and built-in barometer of the exoskeleton robot, without modifying the structure or increasing additional costs; the judgment delay is only 1 to 2 gaits, which meets the requirements of real-time switching of exoskeleton assistance mode.
[0039] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the system for determining going up and down stairs based on a barometer and gait according to this application.
[0040] like Figure 5 As shown in the embodiment of this application, the system for determining going up and down stairs based on barometer and gait analysis includes: The data acquisition module 10 is used to acquire in real time the motor angles corresponding to the left and right legs of the wearer during walking, as well as the air pressure value collected by the barometer, which is built into the exoskeleton robot. The gait judgment module 20 is used to judge the gait based on the motor angle to obtain the first stair-climbing state: taking one step with the left leg plus one step with the right leg as a gait, obtaining the maximum and minimum values of the right leg angle corresponding to each gait in real time, subtracting the minimum value from the maximum value to obtain the right leg angle width value of the gait, calculating the right leg angle width value and its change for each gait, and determining the first stair-climbing state based on the change. The air pressure judgment module 30 is used to judge the air pressure based on the air pressure value and obtain the second up-and-down state: filter the height value corresponding to the air pressure value to obtain a filtered height value, obtain a local height base value after the filtered height value stabilizes, subtract the local height base value from the filtered height value to obtain the relative height change, perform incremental filtering on the relative height change and extract statistical features, and determine the second up-and-down state based on the statistical features; The fusion judgment module 40 is used to perform fusion judgment based on the relative height change, the first up-and-down state and the second up-and-down state to obtain the final up-and-down state: when the relative height change meets the height threshold condition corresponding to the target state and continues for a preset time, and at least one of the first up-and-down state and the second up-and-down state is the target state, the final up-and-down state is switched to the target state. The assist control module 50 is used to control the exoskeleton robot to switch to the corresponding assist mode according to the final up-and-down state.
[0041] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solution of this application. In specific applications, those skilled in the art can make settings as needed, and this application does not impose any restrictions on this.
[0042] The specific implementation of the system described in this embodiment is largely the same as that of the method embodiment described above, and will not be repeated here.
[0043] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In practical applications, those skilled in the art can select some or all of it to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0044] In addition, for technical details not described in detail in this embodiment, please refer to the method for determining going up and down stairs based on barometer and gait provided in any embodiment of this application, which will not be repeated here.
[0045] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0046] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0047] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application. The above are only preferred embodiments of this application and do not limit the patent scope of this application. All equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for determining whether to go up or down stairs based on barometer readings and gait, characterized in that, The method is executed by the controller of the exoskeleton robot and includes: The robot can acquire in real time the motor angles of the left and right legs corresponding to the wearer's walking process and the air pressure value collected by the barometer, which is built into the exoskeleton robot. The gait is determined based on the motor angle to obtain the first stair-climbing state: taking one step with the left leg plus one step with the right leg as a gait, the maximum and minimum values of the right leg angle corresponding to each gait are obtained in real time, the maximum value is subtracted from the minimum value to obtain the right leg angle width value of the gait, the right leg angle width value and its change amount of each gait are calculated, and the first stair-climbing state is determined based on the change amount. Based on the air pressure value, the air pressure is determined to obtain the second up-and-down state: the height value corresponding to the air pressure value is filtered to obtain a filtered height value. After the filtered height value stabilizes, a local height base value is obtained. The filtered height value is subtracted from the local height base value to obtain the relative height change. The relative height change is incrementally filtered and statistical features are extracted. The second up-and-down state is determined based on the statistical features. Based on the relative height change, the first stair-climbing state, and the second stair-climbing state, a final stair-climbing state is obtained: when the relative height change meets the height threshold condition corresponding to the target state for a preset duration, and at least one of the first stair-climbing state and the second stair-climbing state is the target state, the final stair-climbing state is switched to the target state, so as to control the exoskeleton robot to switch to the corresponding assistance mode according to the final stair-climbing state.
2. The method according to claim 1, characterized in that, The angle width of the right leg is determined according to formula (1): (1) Where WR(k) is the right leg angle width value for the k-th gait. , These are the maximum and minimum values of the right leg angle within the k-th gait, respectively; The change is the difference in the right leg angle width between two adjacent gaits, determined according to equation (2): (2) in, Let be the change in the right leg angle width during the k-th gait.
3. The method according to claim 2, characterized in that, Determining the first upstairs / downstairs state based on the change includes: Based on the current first upstairs / downstairs state and the change amount, a state transition judgment is made in different directions; When the current first stair-climbing state is a flat ground state: if the absolute value of the change is not greater than the first state threshold, it indicates that the walking leg swing amplitude has not changed significantly, and the flat ground state is maintained; if the change is less than the negative value of the first state threshold, it indicates that the walking leg swing amplitude has decreased, and the first stair-climbing state is switched to the downstairs state; if the change is greater than the first state threshold, it indicates that the walking leg swing amplitude has increased, and the first stair-climbing state is switched to the upstairs state. When the current first stair-going state is the stair-going state: if the change is not greater than the second gait threshold, it indicates that the walking leg swing amplitude has decreased, and the first stair-going state is switched to the flat ground state; otherwise, the stair-going state is maintained. When the current first stair-going state is the downstairs state: if the change is not less than the third gait threshold, it indicates that the walking leg swing amplitude has rebounded, and the first stair-going state is switched to the flat ground state; otherwise, the downstairs state is maintained; wherein, the third gait threshold is a negative value; Wherein, the absolute values of the second gait threshold and the third gait threshold are both less than the first gait threshold, so that the switching between the first stair-climbing state and the flat ground state forms a hysteresis, avoiding frequent state jumps when the change fluctuates near the threshold; the first gait threshold, the second gait threshold and the third gait threshold are calibrated based on measured walking data.
4. The method according to claim 1, characterized in that, The process of filtering the altitude value corresponding to the air pressure value to obtain a filtered altitude value, and obtaining a local altitude base value after the filtered altitude value stabilizes, includes: At the moment of power-on, the altitude value corresponding to the air pressure value rises sharply to near the local value, and the altitude value is obtained by low-pass filtering. When the fluctuation range of the filtered height value within the preset observation window is less than the stable threshold, the filtered height value is determined to be stable, and the current filtered height value is used as the local height base value. The relative height change is determined according to equation (3): (3) in, This is the current filtered height value. The local height base value, This represents the change in relative altitude at the current moment.
5. The method according to claim 4, characterized in that, The incremental filtering and statistical feature extraction of the relative height change includes: The incremental sequence of the relative height change is filtered, and statistical features are extracted within a sliding time window. The statistical features include peak value, trough value, mean, and slope. The mean is determined according to equation (4), and the slope is determined according to equation (5). (4) (5) Where N is the number of sampling points in the sliding time window, The sampling period is This is the mean at the current moment. The slope at the current moment.
6. The method according to claim 5, characterized in that, Determining the second upstairs / downstairs status based on the statistical characteristics includes: When the current second stair-climbing state is a flat ground state: if the mean value is within the first mean value interval or the slope is within the first slope interval, it indicates that the air pressure fluctuation is not large and walking tends to be flat ground. Set the second stair-climbing state to the flat ground state and record the corresponding flat ground transition sub-state. When the current second stair-climbing state is a flat ground state: if the mean value is greater than the first mean threshold or the slope is greater than the first slope threshold, the second stair-climbing state is set to the first trend state; When the current second stair-climbing state is a flat ground state: if the mean is less than the third mean threshold or the slope is less than the third slope threshold, the second stair-climbing state is set to the second trend state; When the current second up / down stair state is the downstair state: if the average value is not less than the second average value threshold or the absolute value of the slope is not greater than the second slope threshold, it indicates that the air pressure value is still increasing and is still in a downstair trend. A first trend transition sub-state is recorded to maintain the first trend state; if the average value is less than the second average value threshold or the slope is less than the third slope threshold, it indicates that the air pressure value has fallen back to the horizontal position. The second up / down stair state is switched to the flat ground state. When the current second up-and-down state is the up-and-down state: if the average value is not greater than the fourth average threshold or the absolute value of the slope is not greater than the fourth slope threshold, it indicates that the air pressure value continues to decrease and is still in the up-and-down trend. A second trend transition sub-state is recorded to maintain the second trend state; if the average value is greater than the fourth average threshold or the slope is greater than the first slope threshold, it indicates that the air pressure value has fallen back to the horizontal position. The second up-and-down state is switched to the flat ground state. After classifying and mapping each trend state with its corresponding transition sub-state, the second upstairs / downstairs state is output: the flat ground state is mapped to the flat ground transition sub-state as the flat ground state, the first trend state is mapped to the first trend transition sub-state as the downstairs state, and the second trend state is mapped to the second trend transition sub-state as the upstairs state. That is, the second upstairs / downstairs state is the upstairs state, the downstairs state, or the flat ground state.
7. The method according to claim 1, characterized in that, The fusion judgment adopts a three-state machine, and the final up / down state includes upstairs state, downstairs state, and level ground state; wherein, the relative height change increases with the increase of the air pressure value, the relative height change in the downstairs direction is positive, and the relative height change in the upstairs direction is negative; the state switching conditions include: Switching from flat ground state to downstairs state: The relative height change is greater than a first height threshold and lasts for the preset duration, and either the first upstairs / downstairs state is the downstairs state or the second upstairs / downstairs state is the downstairs state; Switching from flat ground state to upstairs state: The relative height change is less than the negative value of the first height threshold and continues for the preset duration, and either the first upstairs / downstairs state is upstairs state or the second upstairs / downstairs state is upstairs state; Switching from an upstairs or downstairs state to a flat ground state: the absolute value of the relative height change is not greater than the first height threshold and continues for the preset duration, and the first upstairs or downstairs state is a flat ground state or the second upstairs or downstairs state is a flat ground state; Switching directly from going upstairs to going downstairs: The relative height change is greater than the first height threshold and lasts for the preset duration, and the first upstairs / downstairs state is the downstairs state or the second upstairs / downstairs state is the downstairs state; Switching directly from going downstairs to going upstairs: The relative height change is less than the negative value of the first height threshold and lasts for the preset duration, and the first upstairs / downstairs state is the upstairs state or the second upstairs / downstairs state is the upstairs state; If no state transition condition is met, the current final upstairs / downstairs state remains unchanged.
8. The method according to claim 7, characterized in that, When the instantaneous air pressure fluctuation caused by the wind causes the relative height change to briefly exceed the first height threshold, the state switching condition is not met because the duration of exceeding the first height threshold is less than the preset duration, and the first up-and-down state does not provide a state corresponding to the instantaneous air pressure fluctuation. The final up-and-down state remains unchanged, so as to eliminate the influence of the wind on the up-and-down judgment by correcting the air pressure judgment through the gait judgment.
9. The method according to claim 1, characterized in that, The step of controlling the exoskeleton robot to switch to the corresponding assistance mode based on the final stair-climbing status includes: When the final up-and-down state is the up-and-down state, control the exoskeleton robot to switch to the up-and-down assist mode and output hip joint assist torque according to the up-and-down assist curve; When the final state of going up and down stairs is the state of going down stairs, control the exoskeleton robot to switch to the mode of going down stairs assisting, and output the hip joint assisting torque according to the down stairs assisting curve; When the final state of going up and down stairs is a flat ground state, control the exoskeleton robot to switch to flat ground assist mode.
10. A system for determining whether to go up or down stairs based on a barometer and gait, characterized in that, The controller deployed on the exoskeleton robot includes: The data acquisition module is used to acquire in real time the motor angles corresponding to the left and right legs of the wearer during walking, as well as the air pressure value collected by the barometer, which is built into the exoskeleton robot. The gait judgment module is used to judge the gait based on the motor angle to obtain the first stair-climbing state: taking one step with the left leg plus one step with the right leg as a gait, the maximum and minimum values of the right leg angle corresponding to each gait are obtained in real time, the maximum value is subtracted from the minimum value to obtain the right leg angle width value of the gait, the right leg angle width value and its change amount of each gait are calculated, and the first stair-climbing state is determined based on the change amount; The air pressure judgment module is used to judge the air pressure based on the air pressure value and obtain the second up-and-down state: the height value corresponding to the air pressure value is filtered to obtain a filtered height value, and after the filtered height value stabilizes, a local height base value is obtained. The filtered height value is subtracted from the local height base value to obtain the relative height change. The relative height change is incrementally filtered and statistical features are extracted. The second up-and-down state is determined based on the statistical features. The fusion judgment module is used to perform fusion judgment based on the relative height change, the first up-and-down state and the second up-and-down state to obtain the final up-and-down state: when the relative height change meets the height threshold condition corresponding to the target state and continues for a preset time, and at least one of the first up-and-down state and the second up-and-down state is the target state, the final up-and-down state is switched to the target state. The assist control module is used to control the exoskeleton robot to switch to the corresponding assist mode based on the final up-and-down state.