A slope automatic obstacle avoidance and speed control system and method for electric wheelchair

By integrating components such as a drive module, an automatic obstacle avoidance module, and a self-balancing controller, and combining fuzzy control algorithms and linear active disturbance rejection control, the problems of obstacle avoidance and speed control on slopes for electric wheelchairs have been solved, achieving higher safety and stability.

CN116300900BActive Publication Date: 2026-05-29YANCHENG INST OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YANCHENG INST OF TECH
Filing Date
2023-02-17
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing electric wheelchairs have insufficient automatic obstacle avoidance function design under different slope conditions, resulting in speed differences on slopes, which may lead to the danger of tipping over or slipping backwards, and the speed cannot be effectively controlled.

Method used

It adopts a combination of drive module, automatic obstacle avoidance module, self-balancing controller module, speed sensor module, heart rate detection module, alarm module and central processing module. It uses ultrasonic and infrared sensors for ranging, combined with fuzzy control algorithm and linear active disturbance rejection control technology to realize automatic obstacle avoidance and speed control based on slope.

Benefits of technology

It improves the accuracy and stability of automatic obstacle avoidance on slopes for electric wheelchairs, ensuring the safety of passengers, reducing the danger of sudden speed changes to passengers, and increasing the utilization rate of electric wheelchairs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116300900B_ABST
    Figure CN116300900B_ABST
Patent Text Reader

Abstract

The application provides a slope automatic obstacle avoidance and speed control system and method of an electric wheelchair, and relates to the field of control systems.The control system comprises a driving module, an automatic obstacle avoidance module, a self-balancing controller module, a speed sensor module, a heart rate detection module, an alarm module, a speed reduction module and a central processing module.The driving module, the automatic obstacle avoidance module, the self-balancing controller module, the speed sensor module, the heart rate detection module, the alarm module and the speed reduction module are electrically connected with the central processing module.The application can remind the passenger to avoid the road section that the electric wheelchair cannot climb in advance, estimate the speed after 2s by measuring the acceleration and real-time speed, reduce the speed in advance before reaching the upper limit of the wheelchair climbing speed, measure the distance of the obstacle by ultrasonic sensors and infrared sensors, realize automatic obstacle avoidance by a fuzzy control algorithm, and realize the slope stability of the wheelchair by the self-balancing control module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention patent relates to the field of control systems, specifically a slope automatic obstacle avoidance and speed control system and method for an electric wheelchair. Background Technology

[0002] Wheelchairs available on the market are generally divided into three levels: low, medium, and high. Low-end wheelchairs are ordinary push-type wheelchairs; medium-end wheelchairs are electric wheelchairs; and high-end wheelchairs offer various special functions, such as those specifically designed for climbing stairs or those that can transform into a reclining position. Overall, current electric wheelchairs are not yet perfect, are still too expensive, and lack many intelligent features. Most electric wheelchairs' automatic obstacle avoidance functions are designed for a 0-degree incline, failing to consider the dangers posed by differences in speed and incline at different slopes. This can lead to the risk of tipping over when attempting automatic obstacle avoidance on slopes. Furthermore, because different electric wheelchairs have varying climbing abilities, they may slip and roll over on steep inclines, causing a dangerous situation.

[0003] Because the country has restrictions on the speed and slope of electric wheelchairs, it is necessary to control the speed of electric wheelchairs on slopes and to perform automatic obstacle avoidance functions while controlling the speed. Summary of the Invention

[0004] The purpose of this invention is to provide an automatic obstacle avoidance and speed control system and method for electric wheelchairs, which can realize speed control and automatic obstacle avoidance functions on slopes.

[0005] Technical Content: An automatic obstacle avoidance and speed control system for an electric wheelchair, the control system comprising a drive module, an automatic obstacle avoidance module, a self-balancing controller module, a speed sensor module, a heart rate detection module, an alarm module, a deceleration module, and a central processing module; the drive module, automatic obstacle avoidance module, self-balancing controller module, speed sensor module, heart rate detection module, alarm module, and deceleration module are all electrically connected to the central processing module.

[0006] Furthermore, the drive module includes a stepper motor for driving the wheelchair forward and backward; the alarm module includes a buzzer for hazard warning; the automatic obstacle avoidance module enables the electric wheelchair to automatically avoid obstacles on slopes; the automatic obstacle avoidance module includes ultrasonic and infrared sensors, which obtain the distance between the electric wheelchair and obstacles and transmit the information to the central processing module to achieve automatic obstacle avoidance; the self-balancing controller module includes a nonlinear PD controller, a tracking differentiator, and a linear extended observer, which uses the extended state observer to calculate and compensate for the total disturbance in real time. The electric wheelchair features self-balancing; the speed sensor module includes multiple triaxial accelerometers and a Hall sensor to obtain acceleration and speed information of the electric wheelchair and transmit the information to the central processing module; the heart rate detection module includes a pulse heart rate sensor to detect the rider's heart rate and transmit the information to the central processing module; the deceleration module includes a pulse timer to emit pulse frequency and control the stepper motor speed; the central processing module controls the operation of the drive module, deceleration module, and alarm module based on information from the automatic obstacle avoidance module, self-balancing controller module, speed sensor module, and heart rate detection module.

[0007] A method for automatic obstacle avoidance based on slope and speed control of an electric wheelchair includes the following steps:

[0008] Step 1: During the operation of the electric wheelchair, the triaxial accelerometer in the speed sensor module detects the acceleration of the electric wheelchair in real time, the Hall sensor detects the real-time speed of the electric wheelchair, and converts the acceleration and real-time speed information into digital signals and sends them to the central processing module; the pulse heart rate sensor in the heart rate detection module detects the rider's heart rate and transmits the information to the central processing module.

[0009] Step 2: The central processing module estimates the optimal slope of the electric wheelchair based on the acceleration information obtained from the detection.

[0010] Step 3: Set the upper limit of the slope for the electric wheelchair. Send the set upper limit of the slope and the optimal slope estimate calculated in Step 2 to the central processing module. If the optimal slope estimate calculated in Step 2 is higher than the upper limit of the slope for the electric wheelchair, the buzzer will sound to warn the rider to change the route.

[0011] Step 4: Based on the obtained acceleration, gradient, and velocity signals, the central processing module determines the braking method when the gradient is not zero, and handles the following situations respectively:

[0012] 1) If the speed and acceleration are both 0, it means the electric wheelchair has been successfully braked and no further action is required.

[0013] 2) If the speed is 0, the acceleration is not 0, and the rider's heart rate is abnormal, an emergency braking operation will be performed on the electric wheelchair to prevent the rider from unconsciously sliding down.

[0014] 3) If the speed is 0, the acceleration is not 0, and the passenger's heart rate is normal, then the electric wheelchair will be slowly accelerated by an algorithm for generating motor acceleration and deceleration pulses based on a pulse timer.

[0015] 4) The speed is not 0, the acceleration is not 0, the passenger's heart rate is normal. During the acceleration process, the central processing module estimates the speed two seconds later and judges whether the speed two seconds later exceeds the specified speed. If it exceeds the specified speed, the electric wheelchair is slowly decelerated by the motor acceleration and deceleration pulse generation algorithm based on the pulse timer.

[0016] Step 5: The distance to the obstacle is obtained through ultrasonic and infrared sensors, and the information is transmitted to the central processing module. The central processing module uses a fuzzy control algorithm to enable the electric wheelchair to automatically avoid obstacles.

[0017] Step Six: Throughout the entire operation of the electric wheelchair, the stability of the electric wheelchair is controlled using linear active disturbance rejection control technology.

[0018] Furthermore, the specific estimation method for the optimal slope estimate includes the following steps:

[0019] Step 1: Calculate the slope measured by the triaxial accelerometer:

[0020] Step 1.1: The vector sum of the accelerations along the three axes of the triaxial accelerometer equals the acceleration due to gravity, that is:

[0021]

[0022]

[0023] In the formula: A x A y A z These are the triaxial accelerations; g is the gravitational acceleration. Indicates the degree of inclination, measured in radians;

[0024] Step 1.2: Simplify the above equation and perform an inverse cosine operation to obtain:

[0025]

[0026] Step 1.3: Convert the tilt to radians. Multiply by a factor of 57.29 to convert to angle, which is the slope measured by the triaxial accelerometer.

[0027] Step 2: The central processing module processes the slope information obtained from all acceleration sensors and obtains the optimal estimates of slope and acceleration through a weighted data fusion algorithm.

[0028] Furthermore, the specific operation of the weighted data fusion algorithm in step 2 is as follows:

[0029] Step 2.1: For any two sensors p and q, the measurement result signals are denoted as Xp and Xq respectively; Xp = X + Vp; Xq = X + Vq, where X is the true signal, and Vp and Vq are the observation errors of sensors p and q respectively;

[0030] Step 2.2: Calculate the variance of any sensor. The variance of any sensor is the difference between its autocorrelation function and its cross-correlation function. The observation errors Vp and Vq can be regarded as zero-mean stationary noise. Based on this, for any sensor p, its variance is... Where E(*) is the mean;

[0031] Step 2.2.1: Cross-correlation function R between arbitrary sensors p and q pq And the autocorrelation function R of any sensor p pp The formula is as follows:

[0032] R pq =E(X) 2 )

[0033]

[0034] Step 2.2.2: First, average the measurement data from each sampling point to calculate the autocorrelation function and cross-correlation function of the sensor. The calculation formula is as follows:

[0035]

[0036]

[0037] Where n is the number of sensors; k is the number of sampling points; Rpp(k) is the autocorrelation function of sensor p at time k; and Rpq(k) is the cross-correlation function of sensors p and q at time k. Let be the average value of the autocorrelation function of sensor p at time k; Let be the average value of the cross-correlation function of the pq sensors at time k;

[0038] Step 2.2.3 and The difference is an unbiased estimate of the observation variance of sensor p at time k. The calculation formula is as follows:

[0039]

[0040] in, The variance of the observations is calculated for the i-th sampling point; the larger k is, the more accurate the variance estimate.

[0041] Step 2.3: After obtaining the unbiased estimate of the sensor's observation variance, calculate the sensor weight estimate. Then, the optimal estimate of the sensor at time point k is calculated. The calculation formula is as follows:

[0042]

[0043]

[0044] in, For the optimal valuation, X p (k) refers to the data measured by the sensor at time k.

[0045] Furthermore, the algorithm for generating motor acceleration / deceleration pulses based on a pulse timer includes the following steps:

[0046] 1) Determine the parameters as initial velocity V0, final velocity Vmax, acceleration acctime, and total number of pulses L;

[0047] 2) Determine a pulse sequence and a velocity sequence, i.e., the load value of the timer;

[0048] The timer's load value is changed in 1ms increments to alter its frequency. The program stores the number of pulses to be output per millisecond and the timer's auto-load value within that millisecond in a lookup table. When the timer is running, it first interrupts the timer according to the initial load value. After outputting the pulses corresponding to the load value, the load value is updated. This process is repeated until the entire acceleration / deceleration process is complete.

[0049] 3) After the system continuously updates the pulse value, it controls the speed of the stepper motor, thereby achieving the functions of slow acceleration and slow deceleration.

[0050] Furthermore, the steps of the fuzzy control algorithm are as follows:

[0051] 1) Divide the front of the electric wheelchair into 3 areas, with the middle one being the wheelchair's central axis. Extend the central axis to a width of 50cm. Input the nearest distance to the obstacle in each of the 3 areas, which can be represented as LD, FD, and RD.

[0052] 2) Let v represent the running speed of the electric wheelchair and β represent the steering angle. The fuzzy control model is represented as follows: y = f(u); where the input is u, u = {LD, FD, RD}, and the output is y, y = {v, β}.

[0053] 3) The distance information input to the controller is represented by the three fuzzy languages ​​{F, M, N} as {LD, FD, RD}, where {F, M, N} represents {far, medium, near}; the universe of discourse for the distance to obstacles in the three regions is determined; the fuzzy language set {fast, medium, slow} = {Q, M, S}, and its set is the speed information V input by the central processing module; the universe of discourse for the speed information V is determined.

[0054] 4) Acceleration 'a' is the output, represented using fuzzy language {D, SD, O, SA, A}, where D represents deceleration, SD represents gradual deceleration, O represents constant speed, SA represents gradual acceleration, and A represents acceleration; and the domain of discourse is determined. β is the steering angle, which can be represented using fuzzy language {BL, SL, NO, SR, BR}, where BL represents left turn, SL represents fine adjustment, NO represents straight ahead, SR represents fine adjustment, and BR represents right turn; and the domain of discourse for the steering angle is determined.

[0055] 5) Establish fuzzy rules:

[0056] When the electric wheelchair is less than 0.5m away from an obstacle in front, it needs to slow down, and the turning angle will increase. When the electric wheelchair is 15m or more away from an obstacle on the left or right, and the obstacle in front of the electric wheelchair is within 0.5-15m, it needs to slow down, and the turning angle will also increase. When there is no obstacle in front of the electric wheelchair, but the distance between the electric wheelchair and the obstacle on the sides is less than 0.5m, it also needs to slow down.

[0057] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0058] (1) The present invention is equipped with a speed sensor module, a central processing module and an alarm module. The acceleration is measured by the sensor, the slope is estimated by the weighted data fusion algorithm, and then the optimal slope estimate is estimated. When the optimal slope estimate exceeds the maximum value set by the electric wheelchair, the alarm module issues an alarm, which can remind the passenger to avoid the road section that the electric wheelchair cannot climb in advance. By measuring the acceleration and real-time speed, the speed after 2 seconds is estimated, and the speed is reduced in advance before reaching the upper limit of the wheelchair's climbing speed. The distance of the obstacle is measured by the ultrasonic sensor and the infrared sensor, and automatic obstacle avoidance is realized by the fuzzy control algorithm. The slope stabilization of the wheelchair is realized by the self-balancing control module.

[0059] (2) The present invention selects a fuzzy control algorithm when automatically avoiding obstacles to improve the accuracy of automatic obstacle avoidance of electric wheelchairs. The addition of linear active disturbance rejection control technology during wheelchair operation improves the stability of electric wheelchairs, ensures the safety of passengers to a greater extent, and improves the utilization rate of electric wheelchairs.

[0060] (3) The present invention uses a motor acceleration and deceleration pulse generation algorithm when decelerating. This algorithm can make the motor have an acceleration and deceleration process when the starting speed reaches the given feed speed, so that it can transition smoothly and avoid sudden changes in motor speed that could cause damage to passengers. The deceleration will also be smoother, avoiding the inertia that could cause passengers to be thrown forward, and reducing the danger to passengers' bodies caused by sudden speed changes. Attached Figure Description

[0061] Figure 1 This is a block diagram of the control method of the present invention;

[0062] Figure 2 This is a structural diagram of a self-balancing controller. Detailed Implementation

[0063] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings and specific implementation examples.

[0064] This invention discloses an automatic slope obstacle avoidance and speed control system and method for electric wheelchairs.

[0065] An automatic obstacle avoidance and speed control system for an electric wheelchair includes: a drive module, an automatic obstacle avoidance module, a self-balancing controller module, a speed sensor module, a heart rate detection module, an alarm module, a deceleration module, and a central processing module; the drive module, automatic obstacle avoidance module, self-balancing controller module, speed sensor module, heart rate detection module, alarm module, and deceleration module are all electrically connected to the central processing module.

[0066] 1) Drive module: including a stepper motor, used to drive the wheelchair forward and backward;

[0067] 2) Automatic obstacle avoidance module: used to enable the electric wheelchair to automatically avoid obstacles on slopes; includes ultrasonic sensors and infrared sensors, which obtain the distance between the electric wheelchair and obstacles and transmit the information to the central processing module to realize the automatic obstacle avoidance of the electric wheelchair.

[0068] 3) Self-balancing controller module: The core component consists of a nonlinear PD controller, a tracking differentiator, and a linear extended state observer (LESO). The extended state observer (LESO) is used to calculate and compensate for the total disturbance in real time, achieving self-balancing of the electric wheelchair and improving its stability on slopes.

[0069] 4) Speed ​​sensor module: includes multiple triaxial accelerometers and one Hall sensor, used to obtain acceleration and speed information of the electric wheelchair and transmit it to the central processing module; the triaxial accelerometers and Hall sensors are randomly and dispersedly installed on the electric wheelchair;

[0070] 5) Heart rate detection module: This invention selects the commonly available open-source pulse heart rate sensor, Pulse Sensor, to detect the heart rate of passengers and transmit the information to the central processing module;

[0071] 6) Alarm module: including a buzzer for hazard warning;

[0072] 7) Reduction module: includes a pulse timer, used to generate pulse frequency to control the stepper motor speed;

[0073] 8) The central processing module: The central processing module controls the operation of the drive module, deceleration module and alarm module based on the information from the automatic obstacle avoidance module, the self-balancing controller module, the speed sensor module and the heart rate detection module.

[0074] An STM32 controller is used to achieve automatic obstacle avoidance based on information from the automatic obstacle avoidance module using a fuzzy control algorithm; the self-balancing controller module drives the electric wheelchair to achieve automatic balancing; a pulse timer-based motor acceleration and deceleration pulse generation algorithm is used to control the speed of the electric wheelchair drive module; a weighted data fusion algorithm is used to achieve optimal estimation of the slope based on information from the speed sensor module; when the optimal slope value, the heart rate measured by the heart rate detection module, and the speed exceed the set values, the central processing unit module controls the alarm module to sound an alarm.

[0075] The control method for the above-mentioned automatic obstacle avoidance and speed control system for electric wheelchairs includes the following steps:

[0076] Step 1: During the operation of the electric wheelchair, the triaxial accelerometer in the speed sensor module detects the acceleration of the electric wheelchair in real time, the Hall sensor detects the real-time speed of the electric wheelchair, and converts the acceleration and real-time speed information into digital signals and sends them to the central processing module; the pulse heart rate sensor in the heart rate detection module detects the rider's heart rate and transmits the information to the central processing module.

[0077] Step 2: The central processing module estimates the optimal slope of the electric wheelchair based on the acceleration information obtained from the detection.

[0078] The specific estimation steps for the optimal slope estimate are as follows:

[0079] Step 1: Calculate the slope measured by the triaxial accelerometer:

[0080] Step 1.1: In a static force field where only gravity acts, the accelerations generated by the three axes of the triaxial accelerometer are all projections of the gravity vector onto that axis. Since the three axes are placed perpendicular to each other, the sum of the acceleration vectors of the three axes equals the gravitational acceleration, i.e.

[0081]

[0082]

[0083] In the formula: A x A y A z These are the triaxial accelerations; g is the gravitational acceleration. The value represents the degree of inclination, expressed in radians; Step 1.2: Simplify the above formula and perform an inverse cosine operation to obtain...

[0084]

[0085] Step 1.3: Convert the tilt to radians. Multiply by a factor of 57.29 to convert to angle.

[0086] Step 2: The central processing module uses the slope and acceleration information obtained in Step 1 to obtain the optimal estimates of slope and acceleration through a weighted data fusion algorithm.

[0087] The specific operation of the weighted data fusion algorithm is as follows:

[0088] Step 2.1 For any two sensors p and q, there are measurement result signals Xp and Xq. Generally, these measurement results consist of the true signal X and the observation errors Vp and Vq, denoted as Xp = X + Vp and Xq = X + Vq.

[0089] Step 2.2: Calculate the variance of any sensor. The variance of any sensor is the difference between its autocorrelation function and its cross-correlation function.

[0090] The observation errors Vp and Vq can be considered as zero-mean stationary noise. Based on this, for any sensor p, its variance is... Where E(*) is the mean;

[0091] Step 2.2.1: Since the sensors are independent of each other, the observation errors between two sensors are uncorrelated, the mean of the observation error is 0, and it is uncorrelated with the true signal; the cross-correlation function R between any sensors p and q... pq And the autocorrelation function R of any sensor p pq The formula can be expressed as:

[0092] R pq =E(X)2 )

[0093]

[0094] Step 2.2.2: First, take the average value of the measurement data at each sampling point to obtain the autocorrelation function and cross-correlation function of the sensor.

[0095] Since this invention uses multiple sensors to measure signals, all functions need to be processed. To make the autocorrelation function and cross-correlation function as accurate as possible, the autocorrelation function and cross-correlation function of the sensors are first calculated by averaging the measurement data of each sampling point. Then, the average value of the autocorrelation function and cross-correlation function of the sensors is calculated by averaging the measurement data of each sensor. The calculation formula is as follows:

[0096]

[0097]

[0098] Where n is the number of sensors; k is the number of sampling points; Rpp(k) is the autocorrelation function of sensor p at time k; and Rpq(k) is the cross-correlation function of sensors p and q at time k. Let be the average value of the autocorrelation function of sensor p at time k; Let be the average value of the cross-correlation function of the pq sensors at time k;

[0099] Step 2.2.3 and The difference, that is, an unbiased estimate of the observation variance of sensor p at time k. The calculation formula is as follows:

[0100]

[0101] in, This is the observation variance obtained for the i-th sampling point; it should be noted that the larger k is, the more accurate the variance estimate.

[0102] Step 2.3: After obtaining the unbiased estimate of the sensor's observation variance, calculate the sensor weight estimate. Then, the optimal estimate of the sensor at time point k is calculated. The calculation formula is as follows:

[0103]

[0104]

[0105] in, For the optimal valuation, Xp (k) refers to the data measured by the sensor at time k.

[0106] Step 3: Set the upper limit of the slope for the electric wheelchair. Send the set upper limit of the slope and the optimal slope estimate calculated in Step 2 to the central processing module. If the optimal slope estimate calculated in Step 2 is higher than the upper limit of the slope for the electric wheelchair, the buzzer will sound to warn the rider to change the route.

[0107] Since each electric wheelchair has a different climbing ability, the maximum slope must be set manually.

[0108] Step 4: The central processing module selects an appropriate braking method based on the obtained acceleration, gradient, and velocity signals, provided that the gradient is not zero.

[0109] There are several types of braking methods:

[0110] 1) If the speed is 0 and the acceleration is 0, it means that the electric wheelchair has been successfully braked and no operation is required;

[0111] 2) If the speed is 0, the acceleration is not 0, and the passenger's heart rate is abnormal (below 50 beats / min or the heart rate change exceeds 30 beats / min), then an emergency braking operation should be performed on the electric wheelchair to prevent the passenger from unconsciously sliding down.

[0112] 3) If the speed is 0, the acceleration is not 0, and the passenger's heart rate is normal, the electric wheelchair will be slowly accelerated by an algorithm for generating motor acceleration and deceleration pulses based on a pulse timer to avoid the passenger falling due to excessive acceleration.

[0113] 4) The speed is not 0, the acceleration is not 0, the passenger's heart rate is normal. During the acceleration process, the central processing module estimates the speed two seconds later and judges whether the speed two seconds later exceeds 6km / h. If it exceeds the specified speed, the electric wheelchair is slowly decelerated by the motor acceleration and deceleration pulse generation algorithm based on the pulse timer to keep the electric wheelchair from exceeding the speed limit, thereby achieving speed control of the electric wheelchair slope.

[0114] In the braking method, the motor acceleration / deceleration pulse generation algorithm based on a pulse timer includes the following steps:

[0115] 1) Determine the parameters as initial velocity V0, final velocity Vmax, acceleration acctime, and total number of pulses L;

[0116] 2) Determine a pulse sequence and a velocity sequence (timer ARR value);

[0117] The method involves changing the timer's reload value in 1ms increments to alter its frequency. The program stores the number of pulses to be output per millisecond and the timer's auto-reload value within that millisecond in a lookup table.

[0118] When the timer is working, it first interrupts according to the initial load value. After outputting the pulse corresponding to the set load value, it updates the load value. This process repeats until the entire acceleration / deceleration process is completed.

[0119] 3) After the system continuously updates the pulse value, it controls the speed of the stepper motor, thereby achieving the functions of slow acceleration and slow deceleration.

[0120] The speed of a stepper motor is directly proportional to the pulse frequency received by the stepper motor driver. The higher the pulse frequency emitted by the central processing module, the faster the stepper motor rotates. Utilizing this characteristic, controlling the stepper motor speed by setting the emitted pulse frequency is an effective method. The speed of the output pulse is controlled by changing the value of the timer ARR; the pulse acceleration / deceleration uses a common trapezoidal acceleration / deceleration method, with parameters including initial speed V0 and final speed V... max The acceleration (acctime) is determined. Once these parameters are set, a pulse sequence and a velocity sequence (timer ARR value) can be defined. The timer's load value is changed in 1ms increments to alter its frequency. The program stores the number of pulses to be output per millisecond and the timer's auto-reload value within that millisecond in a lookup table. When the timer operates, it first interrupts according to the initial load value. After outputting the pulses corresponding to the set load value, the load value is updated. This process repeats until the entire acceleration / deceleration process is complete. The timer initialization parameters are given by the following formula:

[0121]

[0122] So, the timer load value is:

[0123] Because the timer frequency should be twice the pulse frequency, the actual timer load value is:

[0124] `psc` and `arr` represent the values ​​stored in two registers. The timer uses an up-counting mode, accumulating from zero to a set value before overflowing. The set value is set by the user and stored in the `ARR` (Automatic Reload Register). An interrupt is triggered when the set value is reached. Each time a timer interrupt is triggered, a specific I / O port of the microcontroller is toggled, generating a pulse. The frequency of the output pulse can be controlled by changing the timer interrupt duration, i.e., the `ARR` value. To prevent overflow due to the value in the `ARR` register exceeding 16 bits, the `TIMx_PSC` (Prescaler Register) is used. This control register has a buffer and can be changed during operation. The new prescaler parameters are used when the next update event occurs.

[0125] Step 5: The distance to the obstacle is obtained through ultrasonic and infrared sensors, and the information is transmitted to the central processing module. The central processing module uses a fuzzy control algorithm to achieve automatic obstacle avoidance for the electric wheelchair.

[0126] The steps of the fuzzy control algorithm are as follows:

[0127] 1) Divide the front of the electric wheelchair into 3 areas, with the middle one being the wheelchair's central axis. Extend the central axis to a width of 50cm. Input the nearest distance to the obstacle in each of the 3 areas, which can be represented as LD, FD, and RD.

[0128] 2) Let v represent the operating speed of the electric wheelchair and β represent the steering angle. The fuzzy control model can then be represented as follows:

[0129] y = f(u)

[0130] The input in this formula is u, where u = {LD, FD, RD}, and the output is y, where y = {v, β}.

[0131] 3) The distance information input to the central control module is represented by the three fuzzy languages ​​{F, M, N} as {LD, FD, RD}; {F, M, N} represents {far, medium, near}; the domain of discourse for the distance of obstacles in the three regions is determined as [0.5m, 15m]. During the detection process, if the distance is greater than 15m, it is marked as 15m.

[0132] The fuzzy language set {fast, medium, slow} = {Q, M, S}, and its set is the speed information V input by the central processing module; the domain range of the speed information V can be determined as [0m / s, 3m / s].

[0133] In the function curve, Gaussian membership is relatively smooth, and the membership function selected in this invention is of the Gaussian type.

[0134] 4) The acceleration 'a' is the output, which can be represented using fuzzy language {D, SD, O, SA, A}, where D represents deceleration, SD represents gradual deceleration, O represents constant speed, SA represents gradual acceleration, and A represents acceleration. The universe of discourse for acceleration 'a' can be determined as [-1.5 m / s²]. 2 15m / s 2 ];

[0135] β is the steering angle, which can be represented using the fuzzy language {BL, SL, NO, SR, BR}, where BL is left turn, SL is fine-tuning, NO is straight, SR is fine-tuning, and BR is right turn; the domain of discourse for the steering angle is determined as [-45°, 45°].

[0136] To facilitate calculation, the membership function is segmented.

[0137] 5) Establishing fuzzy rules:

[0138] When an electric wheelchair is close to an obstacle (less than or equal to 0.5m), it needs to slow down, at which point the steering angle will increase.

[0139] When the electric wheelchair is far from the obstacle on the left or right (greater than or equal to 15m), and the obstacle in front of the electric wheelchair is within 0.5-15m, it is necessary to slow down and increase the steering angle.

[0140] Even when there are no obstacles in front of the electric wheelchair, but the obstacles on both sides of the electric wheelchair are close together (less than 0.5m), you should still slow down.

[0141] The following is a partial fuzzy logic, with rules numbered 1-9. The inputs are distributed as LD, FD, and RD, and the outputs are V, a, and β. The fuzzy control rules are: LD1-9 are F; FD1-9 are F; RD1-3 are F; 4-6 are M; 7-9 are N; 1-9 are S, M, F, S, M, F, S, M, F; a1-9 are A, SA, C, A, SA, SD, SA, C, D; β1-9 are M, M, M, M, L, L, M, L, XL.

[0142] Step Six: Throughout the entire operation of the electric wheelchair, stability is controlled using linear active disturbance rejection control technology. The self-balancing controller structure designed in this invention is as follows: Figure 2 As shown.

[0143] Various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims.

Claims

1. A method for automatic obstacle avoidance and speed control of an electric wheelchair based on slope, characterized in that, Includes the following steps: Step 1: During the operation of the electric wheelchair, the triaxial accelerometer in the speed sensor module detects the acceleration of the electric wheelchair in real time, the Hall sensor detects the real-time speed of the electric wheelchair, and converts the acceleration and real-time speed information into digital signals for the central processing module. The heart rate detection module's pulse heart rate sensor detects the passenger's heart rate and transmits the information to the central processing module; Step 2: The central processing module estimates the optimal slope of the electric wheelchair based on the acceleration information obtained from the detection. Step 3: Set the upper limit of the slope for the electric wheelchair. Send the set upper limit of the slope and the optimal slope estimate calculated in Step 2 to the central processing module. If the optimal slope estimate calculated in Step 2 is higher than the upper limit of the slope for the electric wheelchair, the buzzer will sound to warn the rider to change the route. Step 4: Based on the obtained acceleration, gradient, and velocity signals, the central processing module determines the braking method when the gradient is not zero, and handles the following situations respectively: 1) If the speed and acceleration are both 0, it means the electric wheelchair has been successfully braked and no further action is required. 2) If the speed is 0, the acceleration is not 0, and the rider's heart rate is abnormal, an emergency braking operation will be performed on the electric wheelchair to prevent the rider from unconsciously sliding down. 3) If the speed is 0, the acceleration is not 0, and the passenger's heart rate is normal, then the electric wheelchair will be slowly accelerated by an algorithm for generating motor acceleration and deceleration pulses based on a pulse timer. 4) The speed is not 0, the acceleration is not 0, the passenger's heart rate is normal. During the acceleration process, the central processing module estimates the speed two seconds later and judges whether the speed two seconds later exceeds the specified speed. If it exceeds the specified speed, the electric wheelchair is slowly decelerated by the motor acceleration and deceleration pulse generation algorithm based on the pulse timer. Step 5: The distance to obstacles is obtained through ultrasonic and infrared sensors, and the information is transmitted to the central processing module. The central processing module uses a fuzzy control algorithm to enable the electric wheelchair to automatically avoid obstacles. Step Six: Throughout the entire operation of the electric wheelchair, the stability of the electric wheelchair is controlled using linear active disturbance rejection control technology; The specific estimation method for the optimal slope estimate includes the following steps: Step 1: Calculate the slope measured by the triaxial accelerometer: Step 1.1: The vector sum of the accelerations along the three axes of the triaxial accelerometer equals the acceleration due to gravity, that is: ; ; In the formula: A x A y A z These are the triaxial accelerations; g is the gravitational acceleration. Indicates the degree of inclination, measured in radians; Step 1.2: Simplify the above equation and perform an inverse cosine operation to obtain: ; Step 1.3: Convert the tilt to radians. Multiply by a factor of 57.29 to convert to angle, which is the slope measured by the triaxial accelerometer. Step 2: The central processing module processes the slope information obtained from all acceleration sensors and obtains the optimal estimates of slope and acceleration through a weighted data fusion algorithm.

2. The method for automatic obstacle avoidance and speed control of an electric wheelchair according to claim 1, characterized in that, In step 2, the specific operation of the weighted data fusion algorithm is as follows: Step 2.1: For any two accelerometers p and q, the measurement result signals are denoted as Xp and Xq respectively; Xp = X + Vp; Xq = X + Vq, where X is the true signal, and Vp and Vq are the observation errors of accelerometers p and q. Step 2.2: Calculate the variance of any accelerometer. The variance of any accelerometer is the difference between its autocorrelation function and its cross-correlation function. The observation errors Vp and Vq can be regarded as zero-mean stationary noise. Based on this, for any accelerometer p, its variance is... Where E(*) is the mean; Step 2.2.1: Cross-correlation function between arbitrary acceleration sensors p and q and the autocorrelation function of any acceleration sensor p. The formula is as follows: ; ; Step 2.2.2: First, average the measurement data from each sampling point to calculate the autocorrelation function and cross-correlation function of the accelerometer. The calculation formula is as follows: ; ; Where n is the number of accelerometers; k is the number of sampling points; Rpp(k) is the autocorrelation function of accelerometer p at time k; and Rpq(k) is the cross-correlation function of accelerometers p and q at time k. Let be the average value of the autocorrelation function of the accelerometer p at time k; Let be the average value of the cross-correlation function of the accelerometers p and q at time k; Step 2.2.3 and The difference is an unbiased estimate of the observation variance of the accelerometer sensor p at time k. The calculation formula is as follows: ; in, The variance of the observations is calculated for the i-th sampling point; the larger k is, the more accurate the variance estimate. Step 2.3: After obtaining the unbiased estimate of the observation variance of the accelerometer, calculate the weight estimate of the accelerometer. Then, the optimal estimate of the accelerometer at time point k is calculated. The calculation formula is as follows: ; ; in, For optimal valuation, This refers to the data measured by the k-time acceleration sensor p.

3. The method for automatic obstacle avoidance and speed control of an electric wheelchair according to claim 1, characterized in that, The algorithm for generating motor acceleration / deceleration pulses based on a pulse timer comprises the following steps: 1) Determine the parameters as initial velocity V0, final velocity Vmax, acceleration acctime, and total number of pulses L; 2) Determine a pulse sequence and a speed sequence, i.e., the load value of the timer; The timer's load value is changed in 1ms increments to alter its frequency. The program stores the number of pulses to be output per millisecond and the auto-reload value of the timer within that millisecond in a lookup table. When the timer is working, it first interrupts according to the initial load value. After the pulses set according to the corresponding load value are output, the load value is updated. This process is repeated until the entire acceleration and deceleration process is completed. 3) After the system continuously updates the pulse value, it controls the speed of the stepper motor, thereby achieving the functions of slow acceleration and slow deceleration.

4. The method for automatic obstacle avoidance and speed control of an electric wheelchair according to claim 1, characterized in that, The steps of the fuzzy control algorithm are as follows: 1) Divide the front of the electric wheelchair into 3 areas, with the middle one being the wheelchair's central axis. Extend the central axis to a width of 50cm. Input the nearest distance to an obstacle in each of the 3 areas, which can be represented as LD, FD, and RD. 2) Let v represent the running speed of the electric wheelchair and β represent the steering angle. The fuzzy control model is represented as follows: y=f(u); where the input is u, u={LD, FD, RD}, and the output is y, y={v, β}. 3) The distance information input to the controller is represented by the three fuzzy languages ​​{F, M, N} as {LD, FD, RD}, where {F, M, N} represent {far, medium, near}; the universe of discourse for the distance to obstacles in the three regions is determined; the fuzzy language set {fast, medium, slow} = {Q, M, S}, which is the velocity information V input by the central processing module; the universe of discourse for the velocity information V is determined. 4) The acceleration 'a' is the output, represented using fuzzy language {D, SD, O, SA, A}, where D represents deceleration, SD represents gradual deceleration, O represents constant speed, SA represents gradual acceleration, and A represents acceleration; and the domain of discourse is determined. β is the steering angle, which can be represented using fuzzy language {BL, SL, NO, SR, BR}, where BL represents left turn, SL represents fine adjustment, NO represents straight ahead, SR represents fine adjustment, and BR represents right turn; and the domain of discourse for the steering angle is determined. 5) Establish fuzzy rules: When the electric wheelchair is less than 0.5m away from an obstacle in front, it needs to slow down, and the turning angle will increase. When the electric wheelchair is 15m or more away from an obstacle on the left or right, and the obstacle in front of the electric wheelchair is within 0.5-15m, it needs to slow down, and the turning angle will also increase. When there is no obstacle in front of the electric wheelchair, but the distance between the electric wheelchair and the obstacle on the sides is less than 0.5m, it also needs to slow down.

5. The method for automatic slope obstacle avoidance and speed control of an electric wheelchair according to claim 1, characterized in that, The control method is based on the slope automatic obstacle avoidance and speed control system of the electric wheelchair. The control system includes a drive module, an automatic obstacle avoidance module, a self-balancing controller module, a speed sensor module, a heart rate detection module, an alarm module, a deceleration module, and a central processing module. The drive module, automatic obstacle avoidance module, self-balancing controller module, speed sensor module, heart rate detection module, alarm module, and deceleration module are all electrically connected to the central processing module.

6. The method for automatic obstacle avoidance and speed control of an electric wheelchair according to claim 5, characterized in that, The drive module includes a stepper motor for driving the wheelchair forward and backward; the alarm module includes a buzzer for hazard warning; the automatic obstacle avoidance module enables the electric wheelchair to automatically avoid obstacles on slopes; the automatic obstacle avoidance module includes ultrasonic and infrared sensors, which obtain the distance between the electric wheelchair and obstacles and transmit the information to the central processing module to achieve automatic obstacle avoidance; the self-balancing controller module includes a nonlinear PD controller, a tracking differentiator, and a linear extended observer, which uses the extended state observer to calculate and compensate for the total disturbance in real time to achieve automatic obstacle avoidance. The system includes a self-balancing mechanism for the electric wheelchair; a speed sensor module comprising multiple triaxial accelerometers and a Hall sensor for acquiring acceleration and speed information of the electric wheelchair and transmitting the information to the central processing module; a heart rate detection module comprising a pulse heart rate sensor for detecting the rider's heart rate and transmitting the information to the central processing module; a deceleration module comprising a pulse timer for emitting pulse frequency to control the stepper motor speed; and a central processing module controlling the operation of the drive module, deceleration module, and alarm module based on information from the automatic obstacle avoidance module, the self-balancing controller module, the speed sensor module, and the heart rate detection module.