技术领域technical field
本发明属于人体呼吸运动仿真技术领域,尤其涉及一种呼吸运动仿真系统及仿真方法、仿真模体。The invention belongs to the technical field of human breathing motion simulation, and in particular relates to a breathing motion simulation system, a simulation method, and a simulation phantom.
背景技术Background technique
在肿瘤放疗过程中,常通过CT、MRI对病灶进行断层扫描显示出病灶与坐标系各参照点的相对位置,治疗计划系统对CT、MRI扫描的图像进行处理,重建病灶及其周围组织的三维形态,计算出利用伽马刀等放疗需要的靶点数、靶点坐标、照射时间和每个靶点使用的准直器号等,电气控制系统依次将各靶点送到焦点处进行定量的照射,使之产生局灶性的坏死或功能改变而达到治疗肿瘤的目的。In the process of tumor radiotherapy, CT and MRI are often used to scan the lesion to show the relative position of the lesion and the reference points of the coordinate system. The treatment planning system processes the images scanned by CT and MRI to reconstruct the three-dimensional image of the lesion and its surrounding tissues. Morphology, calculate the number of targets required for radiotherapy using Gamma Knife, target coordinates, irradiation time, and the number of collimators used for each target, etc., and the electrical control system sequentially sends each target to the focal point for quantitative irradiation , so that it produces focal necrosis or functional changes to achieve the purpose of treating tumors.
做治疗计划时所用CT、MRI定位图像均为静态图像,而在实际治疗过程中病人总是处于呼吸状态下,其肺部、肝脏及纵膈处肿瘤总是随着呼吸运动而发生往复运动,即病人肿瘤实际照射位置、接受的照射剂量分布会因呼吸运动受到影响。为观察呼吸运动中肿瘤位置和体积的变化、精确评估呼吸运动对肿瘤位置和剂量的影响,常用加拿大QUASAR程控呼吸运动模体或美国SUN NUCLEAR公司的MotionSim来模拟人体呼吸运动,但这些模拟人体呼吸运动的仪器采用开环控制系统,运动精度不够高,系统调试完成后也不能根据人体的呼吸特征进行针对性拟合调整,其拟合程度也不高;除此之外,还需要专业人员对仪器进行调试,使用门槛高;并且无法直观的展示人体呼吸运动的运动曲线,也不能进行便捷的人机交互,不便于医学实验的进行。The CT and MRI positioning images used in the treatment plan are all static images, but in the actual treatment process, the patient is always in a breathing state, and the tumors in the lung, liver and mediastinum always reciprocate with the respiratory movement. That is, the actual irradiation position of the patient's tumor and the distribution of the received irradiation dose will be affected by respiratory movement. In order to observe the changes of tumor position and volume during respiratory movement, and accurately evaluate the influence of respiratory movement on tumor position and dose, Canadian QUASAR program-controlled respiratory movement phantom or MotionSim of SUN NUCLEAR Company in the United States are commonly used to simulate human respiratory movement, but these simulate human respiratory movement. The movement equipment adopts an open-loop control system, and the movement accuracy is not high enough. After the system is debugged, it cannot be adjusted according to the breathing characteristics of the human body, and the degree of fitting is not high. The debugging of the instrument has a high threshold for use; and it cannot intuitively display the movement curve of human breathing movement, nor can it perform convenient human-computer interaction, which is not convenient for medical experiments.
公布号为CN114849083A的中国发明专利公开了一种闭环控制的人体呼吸运动模拟系统,提高运动精度,且能显示模拟呼吸运动曲线,方便观测,但其模拟的人体呼吸运动模型较为简单,也只能模拟标准体重人的呼吸运动,不能反映各种不同特征人员的呼吸运动多样性。The Chinese invention patent with the publication number CN114849083A discloses a closed-loop control human breathing motion simulation system, which improves motion accuracy and can display simulated breathing motion curves for easy observation. However, the simulated human breathing motion model is relatively simple and can only Simulating the breathing motion of people with standard weight cannot reflect the diversity of breathing motion of people with different characteristics.
发明内容Contents of the invention
本发明的目的是克服上述现有技术的不足,提供一种呼吸运动仿真系统,能够根据待仿真人员的特征信息进行针对性拟合调整,搭建更为真实、多样的仿真环境。The purpose of the present invention is to overcome the deficiencies of the above-mentioned prior art, and provide a respiratory motion simulation system, which can carry out targeted fitting and adjustment according to the characteristic information of the person to be simulated, and build a more realistic and diverse simulation environment.
为实现上述目的,本发明采用了以下技术方案:To achieve the above object, the present invention adopts the following technical solutions:
一种呼吸运动仿真系统,包括控制模块和步进电机;所述控制模块用于控制所述步进电机的转向、速度和旋转角度,所述步进电机通过改变转向、速度和旋转角度来带动与其连接的部分模拟人体呼吸运动;A breathing motion simulation system, comprising a control module and a stepper motor; the control module is used to control the steering, speed and rotation angle of the stepper motor, and the stepper motor drives by changing the steering, speed and rotation angle The part connected to it simulates human breathing movement;
所述控制模块包括端口通信单元、参数调节单元、运动控制单元和专家库;The control module includes a port communication unit, a parameter adjustment unit, a motion control unit and an expert library;
所述端口通信单元用于获取n个不同特征的采样人员的呼吸运动参数作为样本,共获得n个样本,不同特征指性别、身高、体重、年龄,呼吸运动参数包括呼吸频率、胸腔在一个呼吸周期内不同时刻的纵向起伏幅值、胸腔在一个呼吸周期内不同时刻的纵向起伏速度,各个样本数据也即不同特征和这些特征对应的呼吸运动参数;所述端口通信单元与所述专家库相连接,所述端口通信单元将获取的n个样本数据传送到所述专家库中;The port communication unit is used to obtain the respiratory movement parameters of n sampling personnel with different characteristics as samples, and obtain n samples in total. The different characteristics refer to gender, height, weight, age, and the respiratory movement parameters include respiratory rate, chest cavity The amplitude of longitudinal fluctuations at different times in the cycle, the longitudinal fluctuation speed of the chest cavity at different times in a breathing cycle, and each sample data are different features and respiratory motion parameters corresponding to these features; the port communication unit is connected with the expert library connected, the port communication unit transmits the acquired n sample data to the expert database;
所述专家库用于将这n个样本数据进行归置处理,即基于标准体重人的呼吸运动模拟,根据n个样本数据,得到n组PID调节参数,设计正交试验,对试验结果进行极差分析,通过对分析结果的插补计算,拟合出不同特征与PID调节参数的关系曲线,PID调节参数包括比例调节参数Kp、积分调节参数Ki和微分调节参数Kd;The expert database is used to arrange and process the n sample data, that is, based on the breathing motion simulation of a person with a standard weight, obtain n groups of PID adjustment parameters according to the n sample data, design an orthogonal experiment, and analyze the test results. Difference analysis, through the interpolation calculation of the analysis results, the relationship curve between different characteristics and PID adjustment parameters is fitted. The PID adjustment parameters include proportional adjustment parameters Kp , integral adjustment parameters Ki and differential adjustment parameters Kd ;
所述端口通信单元还用于获取待仿真人员的特征信息,待仿真人员的特征信息包括性别、输入身高a、输入体重b、输入年龄c;所述端口通信单元将待仿真人员的特征信息传送到所述专家库;所述专家库将待仿真人员的特征信息分别代入各条不同特征与PID调节参数的关系曲线中进行计算,计算出的PID调节参数Kp(a)、Ki(b)和Kd(c)即为该待仿真人员最适合的PID调节参数;The port communication unit is also used to obtain the characteristic information of the person to be simulated, the characteristic information of the person to be simulated includes gender, input height a, input weight b, and input age c; the port communication unit transmits the characteristic information of the person to be simulated to the expert library; the expert library will substitute the feature information of the simulated personnel into the relationship curves of each different feature and PID adjustment parameters to calculate, and the calculated PID adjustment parameters Kp (a), Ki (b) and Kd(c) is the most suitable PID adjustment parameter for the person to be simulated;
所述专家库与所述参数调节单元相连接,用于将该待仿真人员最适合的PID调节参数传递到所述参数调节单元中,所述参数调节单元根据待仿真人员最适合的PID调节参数与标准体重人的呼吸运动,计算并模拟出待仿真人员的理论呼吸运动曲线;The expert library is connected with the parameter adjustment unit, and is used to transfer the most suitable PID adjustment parameters of the personnel to be simulated to the parameter adjustment unit, and the parameter adjustment unit adjusts the parameters according to the most suitable PID of the personnel to be simulated Calculate and simulate the theoretical breathing movement curve of the person to be simulated according to the breathing movement of a person with a standard weight;
所述端口通信单元还与所述运动控制单元相连接,用于向所述运动控制单元发送启停信号;The port communication unit is also connected to the motion control unit, and is used to send a start-stop signal to the motion control unit;
所述运动控制单元与所述步进电机相连接,用于通过脉冲控制所述步进电机进行运转;The motion control unit is connected with the stepping motor, and is used to control the stepping motor to run through pulses;
所述步进电机还与所述参数调节单元相连接,所述步进电机将实时转向、速度和旋转角度这些电机实际运行参数传送到所述参数调节单元内;所述参数调节单元将电机实际运行参数和理论呼吸运动曲线进行计算比较后,得出实时修正信息,并发送到所述运动控制单元中,所述运动控制单元控制所述步进电机在实时修正脉冲下运转。The stepper motor is also connected with the parameter adjustment unit, and the stepper motor transmits the actual operating parameters of the motor such as real-time steering, speed and rotation angle to the parameter adjustment unit; After calculating and comparing the operating parameters and the theoretical breathing motion curve, real-time correction information is obtained and sent to the motion control unit, which controls the stepper motor to operate under real-time correction pulses.
优选的,所述专家库根据男女性别不同,分别设置第一子库和第二子库,专家库将接收到的n个样本数据,根据性别,分入所述第一子库和第二子库中,各子库分别对落入其中的样本进行归置处理Preferably, the expert database sets up a first sub-database and a second sub-database respectively according to gender differences, and the expert database divides the received n sample data into the first sub-database and the second sub-database according to gender. In the library, each sub-library respectively arranges the samples falling into it
优选的,所述第一子库或第二子库基于标准体重人的呼吸运动模拟与n个样本数据,通过电机模拟,复现出各样本所代表的不同特征人员的呼吸运动;在复现出各样本所代表的不同特征人员的呼吸运动过程中,通过对电机的PID参数整定,得到各样本对应的PID调节参数,直到获取n个样本数据所对应的n组PID调节参数,第n个样本数据所对应的那一组PID调节参数记为(Kpn,Kin,Kdn)。Preferably, the first sub-library or the second sub-library is based on the breathing motion simulation of a standard weight person and n sample data, and reproduces the breathing motion of people with different characteristics represented by each sample through motor simulation; In the breathing movement process of persons with different characteristics represented by each sample, the PID adjustment parameters corresponding to each sample are obtained by tuning the PID parameters of the motor, until n sets of PID adjustment parameters corresponding to n sample data are obtained, the nth The set of PID adjustment parameters corresponding to the sample data is recorded as (Kpn , Kin , Kdn ).
优选的,选用年龄、体重、身高这三个可变因素,每个因素分别取m个水平区间,生成三因素m水平的正交试验表,将n个样本数据所对应的PID调节参数作为试验结果填入正交试验表中,保证各年龄的水平区间、体重的水平区间、身高的水平区间中至少包含一个样本,根据正交试验数据进行极差分析。Preferably, the three variable factors of age, body weight and height are selected, and m horizontal intervals are respectively taken for each factor to generate an orthogonal test table of three factor m levels, and the PID adjustment parameters corresponding to n sample data are used as the test Fill in the results in the orthogonal test table to ensure that at least one sample is included in each age level interval, weight level interval, and height level interval, and perform range analysis based on the orthogonal test data.
优选的,将n个样本数据中的身高与对应的比例调节参数Kp提取出来,作为离散的样本点,进行插补计算,拟合出身高与比例调节参数Kp之间的关系曲线:Preferably, the height and the corresponding proportional adjustment parameter Kp in the n sample data are extracted, as discrete sample points, interpolation calculation is performed, and the relationship curve between the birth height and the proportional adjustment parameter Kp is fitted:
a为自变量身高,即输入身高a,单位:厘米,精确到0.01厘米;Kp(a)为因变量比例调节参数,即输出的比例调节参数,精确到0.01;为拉格朗日插值计算公式,ai和aj均为不同样本点处的身高,0≤i≤n,0≤j≤n,i≠j;当输入身高与某个样本点身高之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kp值为Kp(y);当输入身高与某个样本点身高之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kp值为Kp(y-1);a is the independent variable height, that is, the input height a, unit: cm, accurate to 0.01 cm; Kp(a) is the proportional adjustment parameter of the dependent variable, that is, the output proportional adjustment parameter, accurate to 0.01; It is the calculation formula of Lagrangian interpolation, ai and aj are the heights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input height is between the height of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kp value corresponding to the sample point as Kp(y); when the input height and When the difference between the heights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, theKp value corresponding to the sample point is taken is Kp(y-1);
将n个样本数据中的体重与对应的积分调节参数Ki提取出来,作为离散的样本点,进行插补计算,拟合出体重与积分调节参数Ki之间的关系曲线:Extract the body weight and the corresponding integral adjustment parameter Ki from the n sample data, as discrete sample points, perform interpolation calculation, and fit the relationship curve between the body weight and the integral adjustment parameter Ki :
b为自变量体重,即输入体重b,单位:千克,精确到0.01千克;Ki(b)为因变量积分调节参数,即输出的积分调节参数,精确到0.1;为拉格朗日插值计算公式,bi和bj均为不同样本点处的体重,0≤i≤n,0≤j≤n,i≠j;当输入体重与某个样本点体重之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Ki值为Ki(y);当输入体重与某个样本点体重之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Ki值为Ki(y-1);b is the weight of the independent variable, that is, the input weight b, unit: kilogram, accurate to 0.01 kg; Ki(b) is the integral adjustment parameter of the dependent variable, that is, the output integral adjustment parameter, accurate to 0.1; It is the calculation formula of Lagrangian interpolation, bi and bj are the weights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input weight is between the weight of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Ki value corresponding to the sample point as Ki(y); when the input body weight and When the difference between the body weights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value of all the absolute values of the negative difference, the Ki value corresponding to the sample point is taken is Ki(y-1);
将n个样本数据中的年龄与对应的积分调节参数Kd提取出来,作为离散的样本点,进行插补计算,拟合出年龄与微分调节参数Kd之间的关系曲线:Extract the age and the corresponding integral adjustment parameter Kd from the n sample data, as discrete sample points, perform interpolation calculation, and fit the relationship curve between age and differential adjustment parameter Kd :
c为自变量年龄,即输入年龄c,单位:周岁,精确到1周岁;Kd(c)为因变量微分调节参数,即输出的微分调节参数,精确到0.1;为拉格朗日插值计算公式,ci和cj均为不同样本点处的年龄,0≤i≤n,0≤j≤n,i≠j;当输入年龄与某个样本点年龄之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kd值为Kd(y);当输入年龄与某个样本点年龄之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kd值为Kd(y-1)。c is the age of the independent variable, that is, the input age c, unit: one year old, accurate to 1 year old; Kd(c) is the differential adjustment parameter of the dependent variable, that is, the output differential adjustment parameter, accurate to 0.1; It is the calculation formula of Lagrangian interpolation, ci and cj are the ages at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input age is between the age of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kd value corresponding to the sample point as Kd(y); when the input age and When the difference between the ages of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, the Kd value corresponding to the sample point is taken is Kd(y-1).
优选的,所述运动控制单元包括控制板和驱动器,所述控制板接收所述端口通信单元传送来的启停信号与所述参数调节单元发送的实时修正信息,所述控制板对所述驱动器发出的脉冲信号进行实时修正,控制所述驱动器向所述步进电机输入修正后的修正脉冲。Preferably, the motion control unit includes a control board and a driver, the control board receives the start-stop signal sent by the port communication unit and the real-time correction information sent by the parameter adjustment unit, and the control board is responsible for the driver The pulse signal sent out is corrected in real time, and the driver is controlled to input the corrected correction pulse to the stepping motor.
优选的,所述控制模块还包括波形显示单元,所述波形显示单元分别与所述端口通信单元、参数调节单元相连接;Preferably, the control module further includes a waveform display unit, and the waveform display unit is respectively connected to the port communication unit and the parameter adjustment unit;
所述波形显示单元包括四个部分,第一个部分是基础设置部分,用于输入和显示端口通信单元所需的特征信息和参数;第二个部分是运动参数部分,用于接收所述参数调节单元内的各种参数信息,显示所述专家库中所计算出的最适合的PID调节参数、步进电机的实际运行参数,并对所述步进电机的运行参数进行调整;第三个部分是运动波形部分,通过接收所述参数调节单元内的参数信息,显示运动波形;第四个部分是启停控制部分,试验人员通过该部分下达所述步进电机的启停指令,通过端口通信单元将启停信号传送到所述运动控制单元,实现对所述步进电机启停的控制。The waveform display unit includes four parts, the first part is the basic setting part, which is used to input and display the characteristic information and parameters required by the port communication unit; the second part is the motion parameter part, which is used to receive the parameters Various parameter information in the adjustment unit, displaying the most suitable PID adjustment parameters calculated in the expert database, the actual operating parameters of the stepping motor, and adjusting the operating parameters of the stepping motor; the third The part is the movement waveform part, which displays the movement waveform by receiving the parameter information in the parameter adjustment unit; the fourth part is the start-stop control part, through which the tester issues the start-stop command of the stepping motor, through the port The communication unit transmits the start-stop signal to the motion control unit to control the start-stop of the stepping motor.
优选的,所述控制模块包括上位机和下位机,所述控制模块中的端口通信单元、参数调节单元、波形显示单元和专家库均通过上位机实现,上位机通过RS232通信接口发送指令给下位机;下位机为控制板,下位机将指令解析成脉冲信号发送给驱动器,所述驱动器将信号放大后用于所述步进电机的运转。Preferably, the control module includes a host computer and a lower computer, and the port communication unit, parameter adjustment unit, waveform display unit and expert library in the control module are all implemented by the upper computer, and the upper computer sends instructions to the lower computer through the RS232 communication interface. machine; the lower computer is a control board, and the lower computer resolves the command into a pulse signal and sends it to the driver, and the driver amplifies the signal for the operation of the stepping motor.
本发明还提供一种呼吸运动仿真系统的仿真方法,包括以下步骤:The present invention also provides a simulation method of a breathing motion simulation system, comprising the following steps:
S1,端口通信单元获取n个不同特征的采样人员的呼吸运动参数,即共获得n个样本,不同特征指性别、身高、体重、年龄;呼吸运动参数包括呼吸频率、胸腔在一个呼吸周期内不同时刻的纵向起伏幅值、胸腔在一个呼吸周期内不同时刻的纵向起伏速度;各个样本数据也即不同特征和这些特征对应的呼吸运动参数;端口通信单元将n个样本数据传送到专家库;S1, the port communication unit acquires the respiratory movement parameters of n samplers with different characteristics, that is, n samples are obtained in total, and the different characteristics refer to gender, height, weight, and age; the respiratory movement parameters include respiratory rate, and chest cavity is different in a breathing cycle. The amplitude of longitudinal fluctuations at any time, the longitudinal fluctuation speed of the chest cavity at different times within a respiratory cycle; each sample data is different features and the respiratory motion parameters corresponding to these features; the port communication unit transmits n samples of data to the expert database;
S2,专家库将n个样本数据进行归置处理,即根据n个样本数据和标准体重人的呼吸运动模拟,得到n组PID调节参数;设计正交试验,对试验结果进行极差分析;通过对分析结果的插补计算,拟合出不同特征与PID调节参数的关系曲线;S2, the expert database arranges n sample data, that is, obtains n groups of PID adjustment parameters based on n sample data and the breathing movement simulation of a person with a standard weight; designs an orthogonal test, and performs a range analysis on the test results; The interpolation calculation of the analysis results is used to fit the relationship curve between different features and PID adjustment parameters;
S3,端口通信单元获取待仿真人员的特征信息,包括性别、输入身高、输入体重、输入年龄;运动控制单元获取启动信号,控制步进电机启动运行;S3, the port communication unit obtains the characteristic information of the person to be simulated, including gender, input height, input weight, and input age; the motion control unit obtains the start signal, and controls the stepping motor to start running;
S4,专家库将待仿真人员的特征信息代入各条不同特征与PID调节参数的关系曲线中进行计算,计算出的PID调节参数Kp(a)、Ki(b)和Kd(c)即为该待仿真人员最适合的PID调节参数;S4, the expert database substitutes the characteristic information of the person to be simulated into the relationship curves between different characteristics and PID adjustment parameters for calculation, and the calculated PID adjustment parameters Kp(a), Ki(b) and Kd(c) are the The most suitable PID adjustment parameters for the simulated personnel;
S5,参数调节单元根据接收到的待仿真人员最适合的PID调节参数与标准体重人的呼吸运动,计算并模拟出待仿真人员的理论呼吸运动曲线;S5, the parameter adjustment unit calculates and simulates a theoretical respiratory movement curve of the person to be simulated according to the received most suitable PID adjustment parameters of the person to be simulated and the breathing movement of a person with a standard weight;
S6,参数调节单元获取步进电机的电机实际运行参数,包括实时转向、速度和旋转角度;参数调节单元将理论呼吸运动曲线与电机实际运行参数进行比对,根据比对误差输出实时修正信息;S6, the parameter adjustment unit obtains the actual operating parameters of the stepper motor, including real-time steering, speed and rotation angle; the parameter adjustment unit compares the theoretical breathing motion curve with the actual operating parameters of the motor, and outputs real-time correction information according to the comparison error;
S7,运动控制单元接收实时修正信息,控制板对驱动器发出的脉冲信号进行实时修正,驱动器向步进电机输入修正后的实时修正脉冲信号;S7, the motion control unit receives the real-time correction information, the control board corrects the pulse signal sent by the driver in real time, and the driver inputs the corrected real-time correction pulse signal to the stepping motor;
S8,重复S6~S7,直到理论呼吸运动曲线与电机实际运行参数中的误差小于误差设定值,即判定步进电机稳定运行,正式开展后续医学实验;S8, repeating S6-S7 until the error between the theoretical breathing motion curve and the actual operating parameters of the motor is less than the error setting value, that is, it is determined that the stepping motor is running stably, and the follow-up medical experiment is formally carried out;
S9,待仿真人员的特征信息改变后,重复S3~S8,开始新特征信息下的呼吸运动仿真。S9, after the characteristic information of the simulated person is changed, repeat S3-S8, and start the breathing movement simulation under the new characteristic information.
优选的,S2还包括以下步骤:Preferably, S2 also includes the following steps:
S21,根据男女性别不同,将n个样本分入第一子库或第二子库中;S21, divide n samples into the first sub-bank or the second sub-bank according to gender difference;
S22,在各子库中,在基于各样本数据、标准体重人的呼吸运动的基础上,通过电机模拟,复现出各样本所代表的不同特征人员的呼吸运动,在复现出各样本所代表的不同特征人员的呼吸运动过程中,通过对电机的PID参数整定,得到各样本对应的PID调节参数,即比例调节参数Kp、积分调节参数Ki和微分调节参数Kd,直到获取n个样本数据所对应的n组PID调节参数,第n个样本数据所对应的那一组PID调节参数记为(Kpn,Kin,Kdn);S22. In each sub-library, on the basis of each sample data and the breathing movement of a person with a standard weight, through motor simulation, reproduce the breathing movement of the person with different characteristics represented by each sample. In the process of respiratory movement of the represented persons with different characteristics, by adjusting the PID parameters of the motor, the PID adjustment parameters corresponding to each sample are obtained, that is, the proportional adjustment parameter Kp , the integral adjustment parameter Ki and the differential adjustment parameter Kd , until the n The n groups of PID adjustment parameters corresponding to the sample data, the group of PID adjustment parameters corresponding to the nth sample data is recorded as (Kpn , Kin , Kdn );
S23,设计正交试验,对试验结果进行极差分析;S23, designing an orthogonal test, and performing a range analysis on the test results;
S24,通过插补计算,拟合出不同特征与PID调节参数的关系曲线。S24, through interpolation calculation, fitting a relationship curve between different features and PID adjustment parameters.
优选的,S23还包括以下步骤:Preferably, S23 also includes the following steps:
S231,选定年龄、体重、身高作为三个可变因素,再设定各可变因素的水平区间,生成正交试验表;S231, selecting age, weight, and height as three variable factors, and then setting the level intervals of each variable factor to generate an orthogonal test table;
S232,根据正交试验表中的对应区间,将各区间所包含样本的PID调节参数作为试验结果填入正交试验表中,保证了各年龄的水平区间、体重的水平区间、身高的水平区间中至少包含一个样本,共计n个样本;S232, according to the corresponding intervals in the orthogonal test table, fill in the PID adjustment parameters of the samples contained in each interval as the test results in the orthogonal test table, ensuring the horizontal intervals of each age, weight, and height contains at least one sample, a total of n samples;
S233,对正交试验表进行极差分析分析,得到相关性结论:比例调节参数Kp主要取决于样本人员的身高,积分调节参数Ki主要取决于样本人员的体重,微分调节参数Kd主要取决于样本人员的年龄。S233, conduct range analysis on the orthogonal test table, and get the correlation conclusion: the proportional adjustment parameter Kp mainly depends on the height of the sample personnel, the integral adjustment parameter Ki mainly depends on the weight of the sample personnel, and the differential adjustment parameter Kd mainly depends on the weight of the sample personnel. Depends on the age of the sample persons.
优选的,S24还包括以下步骤:Preferably, S24 also includes the following steps:
S241,将n个样本中的身高与对应的比例调节参数Kp提取出来,作为离散的样本点,通过插补计算拟合出身高与比例调节参数Kp之间的关系曲线,计算公式为:S241, extracting the height and the corresponding proportional adjustment parameter Kp in the n samples, as discrete sample points, and fitting the relationship curve between the height and the proportional adjustment parameter Kp through interpolation calculation, the calculation formula is:
a为自变量身高(单位:厘米),即输入身高,精确到0.01厘米;Kp(a)为因变量比例调节参数,即输出的比例调节参数,精确到0.01;为拉格朗日插值计算公式,ai和aj均为不同样本点处的身高,0≤i≤n,0≤j≤n,i≠j;当输入身高与某个样本点身高之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kp值为Kp(y);当输入身高与某个样本点身高之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kp值为Kp(y-1);a is the independent variable height (unit: cm), that is, the input height, accurate to 0.01 cm; Kp(a) is the proportional adjustment parameter of the dependent variable, that is, the output proportional adjustment parameter, accurate to 0.01; It is the calculation formula of Lagrangian interpolation, ai and aj are the heights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input height is between the height of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kp value corresponding to the sample point as Kp(y); when the input height and When the difference between the heights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, theKp value corresponding to the sample point is taken is Kp(y-1);
S242,将n个样本中的体重与对应的积分调节参数Ki提取出来,作为离散的样本点,通过插补计算拟合出体重与积分调节参数Ki之间的关系曲线,计算公式如下:S242, extracting the body weight and the corresponding integral adjustment parameter Ki in the n samples, as discrete sample points, and fitting the relationship curve between the body weight and the integral adjustment parameter Ki through interpolation calculation, the calculation formula is as follows:
b为自变量体重(单位:千克),即输入体重,精确到0.01千克;Ki(b)为因变量积分调节参数,即输出的积分调节参数,精确到0.1;为拉格朗日插值计算公式,bi和bj均为不同样本点处的体重,0≤i≤n,0≤j≤n,i≠j;当输入体重与某个样本点体重之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Ki值为Ki(y);当输入体重与某个样本点体重之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Ki值为Ki(y-1);b is the weight of the independent variable (unit: kilogram), that is, the input weight, accurate to 0.01 kg; Ki(b) is the integral adjustment parameter of the dependent variable, that is, the output integral adjustment parameter, accurate to 0.1; It is the calculation formula of Lagrangian interpolation, bi and bj are the weights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input weight is between the weight of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Ki value corresponding to the sample point as Ki(y); when the input body weight and When the difference between the body weights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value of all the absolute values of the negative difference, the Ki value corresponding to the sample point is taken is Ki(y-1);
S243,将n个样本中的年龄与对应的微分调节参数Kd提取出来,作为离散的样本点,通过插补计算拟合出年龄与微分调节参数Kd之间的关系曲线,计算公式如下:S243, extracting the age and the corresponding differential adjustment parameter Kd from the n samples, as discrete sample points, and fitting the relationship curve between the age and the differential adjustment parameter Kd through interpolation calculation, the calculation formula is as follows:
c为自变量年龄(单位:周岁),即输入年龄,精确到1周岁;Kd(c)为因变量微分调节参数,即输出的微分调节参数,精确到0.1;为拉格朗日插值计算公式,ci和cj均为不同样本点处的年龄,0≤i≤n,0≤j≤n,i≠j;当输入年龄与某个样本点年龄之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kd值为Kd(y);当输入年龄与某个样本点年龄之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kd值为Kd(y-1)。c is the age of the independent variable (unit: one year old), that is, the input age, accurate to 1 year old; Kd(c) is the differential adjustment parameter of the dependent variable, that is, the output differential adjustment parameter, accurate to 0.1; It is the calculation formula of Lagrangian interpolation, ci and cj are the ages at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input age is between the age of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kd value corresponding to the sample point as Kd(y); when the input age and When the difference between the ages of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, the Kd value corresponding to the sample point is taken is Kd(y-1).
本发明还提供一种采用呼吸运动仿真系统的仿真模体,仿真模体包括所述控制模块和步进电机,以及与所述步进电机相连接的运动平台,还包括设置在所述步进电机和运动平台外部的仿真躯干,所述步进电机通过进行往返运动并改变转向、速度和旋转角度来带动所述运动平台,使仿真躯干模拟人体呼吸运动。The present invention also provides a simulation phantom using a respiratory motion simulation system, the simulation phantom includes the control module and a stepping motor, and a motion platform connected with the stepping motor, and also includes a The motor and the simulated torso outside the motion platform, the stepper motor drives the motion platform by performing reciprocating motion and changing the steering, speed and rotation angle, so that the simulated torso simulates human breathing movement.
本发明的有益效果在于:The beneficial effects of the present invention are:
(1)本发明的一种呼吸运动仿真系统将采样人员的呼吸运动参数作为样本,建立专家库,专家库对落入其中的样本数据进行归置处理,即基于各样本数据、标准体重人的呼吸运动模拟的基础上,通过电机模拟,复现出各样本所代表的不同特征人员的呼吸运动,在复现出各样本所代表的不同特征人员的呼吸运动过程中,通过对电机的PID参数整定,得到各样本对应的PID调节参数;设计正交试验,对试验结果进行极差分析;通过对分析结果的插补计算,拟合出不同特征与PID调节参数的关系曲线;使本发明的一种呼吸运动仿真系统在高精度闭环控制的同时,可以根据待仿真人员的特征信息进行针对性拟合调整,即模拟出非标准体重的人类呼吸运动,搭建更为真实、多样的仿真环境。(1) A kind of respiratory motion simulation system of the present invention takes the respiratory motion parameters of the sampler as a sample, and establishes an expert database, and the expert database performs placement processing on the sample data falling into it, that is, based on each sample data, standard weight person's On the basis of the breathing motion simulation, the breathing motion of the people with different characteristics represented by each sample is reproduced through the motor simulation. Set, obtain the corresponding PID adjustment parameter of each sample; Design orthogonal experiment, carry out extreme difference analysis to test result; By the interpolation calculation to analysis result, fit out the relational curve of different characteristics and PID adjustment parameter; Make the present invention A breathing motion simulation system can perform targeted fitting adjustments according to the characteristic information of the person to be simulated while performing high-precision closed-loop control, that is, to simulate the breathing motion of a human with a non-standard body weight, and build a more realistic and diverse simulation environment.
(2)本发明的专家库中在归置处理过程中,设计正交试验,并通过对正交试验结果的极差分析,得出年龄、体重、身高这三个可变因素对PID调节参数的影响;即使样本数量较少,对正交试验结果的极差分析也能较全面地反映出全面试验的结果,保证数据分析过程中的准确性和代表性;并且正交试验可以依托正交表的正交性,从全面试验中选取出均衡分散在大量样本中有代表性的点,尽可能减少为了得到样本而进行的试验次数,节约了人力,提高了试验效率;且各样本受到多因素的影响,采用正交试验,便于观察分析各因素的水平变化对PID调节参数的影响。(2) in the expert database of the present invention, in the placement processing process, design orthogonal test, and by the range analysis to orthogonal test result, draw these three variable factors of age, body weight, height to PID adjustment parameter Even if the number of samples is small, the range analysis of the results of the orthogonal test can reflect the results of the comprehensive test more comprehensively, ensuring the accuracy and representativeness of the data analysis process; and the orthogonal test can rely on the orthogonal The orthogonality of the table, select the representative points that are evenly dispersed in a large number of samples from the comprehensive test, reduce the number of tests to obtain the samples as much as possible, save manpower, and improve the test efficiency; and each sample is subject to multiple For the influence of factors, the orthogonal test is used to observe and analyze the influence of the level change of each factor on the PID adjustment parameters.
(3)本发明专家库根据正交试验对样本的结果分析,得到结论即比例调节参数Kp主要取决于样本人员的身高,积分调节参数Ki主要取决于样本人员的体重,微分调节参数Kd主要取决于样本人员年龄,再通过插补计算,拟合出人员特征与PID调节参数的关系曲线;插补计算与正交试验相互配合的归置处理方法,可以在仅有少量样本的情况下,尽可能地保证拟合出人员特征与PID调节参数的关系曲线的精确性;并且随着所需样本数量的增加,可以进一步提高其拟合出人员特征与PID调节参数的关系曲线的精度。(3) According to the result analysis of the samples by the orthogonal test, the expert library of the present invention draws a conclusion that the proportional adjustment parameterK mainly depends on the height of the sample personnel, the integral adjustment parameterK mainly depends on the weight of the sample personnel, and the differential adjustment parameter Kd mainly depends on the age of the sample personnel, and then through interpolation calculation, the relationship curve between personnel characteristics and PID adjustment parameters is fitted; Under this condition, the accuracy of fitting the relationship curve between personnel characteristics and PID adjustment parameters is guaranteed as much as possible; and as the number of required samples increases, the accuracy of fitting the relationship curve between personnel characteristics and PID adjustment parameters can be further improved .
(4)本发明专家库将仿真人员的特征信息代入各条不同特征与PID调节参数的关系曲线中进行计算,计算出的PID调节参数Kp(a)、Ki(b)和Kd(c)即为该待仿真人员最适合的PID调节参数,根据待仿真人员最适合的PID调节参数对标准体重人的呼吸运动进行调整和闭环控制、模拟出的待仿真人员的理论呼吸运动曲线更贴近该特征信息人员的实际呼吸运动。(4) The expert database of the present invention substitutes the characteristic information of the simulation personnel into the relationship curves of each different characteristic and the PID adjustment parameter to calculate, and the calculated PID adjustment parameters Kp (a), Ki (b) and Kd (c) are For the most suitable PID adjustment parameters for the person to be simulated, adjust and close-loop control the respiratory movement of a person with a standard weight according to the most suitable PID adjustment parameters for the person to be simulated, and the simulated theoretical respiratory movement curve of the person to be simulated is closer to this feature The actual breathing movement of the informant.
(5)本发明的一种呼吸运动仿真系统还具备人机交互的波形显示单元,不仅辅助完成专家库样本输入的交互工作,还可以显示本系统进行呼吸运动仿真过程中的各种特征信息和参数及呼吸波形,还可以通过该波形显示单元对整个系统进行参数和电机启停动作的人工干预,操作便捷,人机交互性高。(5) A respiratory motion simulation system of the present invention also has a waveform display unit for human-computer interaction, which not only assists in completing the interactive work of expert database sample input, but also displays various characteristic information and information during the respiratory motion simulation process of the system. Parameters and breathing waveforms, the waveform display unit can also be used to manually intervene in the parameters and motor start and stop actions of the entire system, which is convenient to operate and has high human-computer interaction.
(6)本发明降低了呼吸运动仿真试验的进行门槛,使呼吸运动仿真试验无需专业人员根据电机的运动情况进行全程调试,只需要试验人员在实验中输入待仿真人员的特征信息,专家库就会自动计算出该待仿真人员最适合的PID调节参数,使参数调节单元根据该待仿真人员最适合的PID调节参数以及步进电机的实际运行参数,通过运动控制单元对步进电机进行闭环控制,使电机带动与其连接的部分在极短的时间内精确地模拟出所需的理论呼吸运动,缩短医学实验中的准备时间,提高医学实验的效率,便于医学实验的进行。(6) The present invention reduces the threshold for carrying out the breathing motion simulation test, so that the breathing motion simulation test does not require professionals to carry out the whole process of debugging according to the motion of the motor, and only needs the test personnel to input the characteristic information of the person to be simulated in the experiment, and the expert database will It will automatically calculate the most suitable PID adjustment parameters for the person to be simulated, so that the parameter adjustment unit performs closed-loop control on the stepper motor through the motion control unit according to the most suitable PID adjustment parameters for the person to be simulated and the actual operating parameters of the stepper motor , so that the motor drives the part connected with it to accurately simulate the required theoretical breathing movement in a very short time, shortens the preparation time in the medical experiment, improves the efficiency of the medical experiment, and facilitates the medical experiment.
附图说明Description of drawings
图1为一种呼吸运动仿真系统结构示意图;Fig. 1 is a schematic structural diagram of a breathing motion simulation system;
图2为图1中专家库及周边单元间的信号传输示意图;Fig. 2 is a schematic diagram of signal transmission between the expert database and peripheral units in Fig. 1;
图3为拟合出的身高与比例调节参数Kp之间的关系曲线;Fig. 3 is the relationship curve between the fitted height and the proportional adjustment parameterK ;
图4为拟合出的体重与积分调节参数Ki之间的关系曲线;Fig. 4 is the relationship curve between the fitted body weight and the integral adjustment parameterK ;
图5为拟合出的年龄与积分调节参数Kd之间的关系曲线;Fig. 5 is the relationship curve between the fitted age and the integral adjustment parameterK ;
图6为一种呼吸运动仿真系统的仿真方法的流程图;Fig. 6 is a flowchart of a simulation method of a respiratory motion simulation system;
图7为一种采用呼吸运动仿真系统的仿真模体结构示意图。Fig. 7 is a schematic structural diagram of a simulation phantom using a breathing motion simulation system.
本发明各标号与部件名称的实际对应关系如下:The actual corresponding relationship between each label of the present invention and part name is as follows:
1、控制模块;11、端口通信单元;12、波形显示单元;13、参数调节单元;1. Control module; 11. Port communication unit; 12. Waveform display unit; 13. Parameter adjustment unit;
14、运动控制单元;141、控制板;142、驱动器;15、专家库;151、第一子库;152、第二子库;14. Motion control unit; 141. Control board; 142. Driver; 15. Expert database; 151. First sub-library; 152. Second sub-library;
2、步进电机;3、运动平台。2. Stepper motor; 3. Motion platform.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。本领域普通技术人员在没有做出创造性劳动前提下对本发明技术方案的技术特征进行等价替换和常规推理得出的方案均落入本发明的保护范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. The solutions obtained by those skilled in the art by performing equivalent replacement and conventional reasoning on the technical features of the technical solution of the present invention without making creative work all fall within the scope of protection of the present invention.
如图1所示,一种呼吸运动仿真系统,包括相连接的控制模块1和步进电机2;控制模块1用于控制步进电机2的转向、速度和旋转角度。步进电机2可以通过改变转向、速度和旋转角度来进行往返运动,带动与其连接的部分模拟人体呼吸运动。As shown in FIG. 1 , a respiratory motion simulation system includes a connected control module 1 and a stepper motor 2 ; the control module 1 is used to control the steering, speed and rotation angle of the stepper motor 2 . The stepping motor 2 can perform reciprocating motion by changing the direction of rotation, speed and rotation angle, and drives the part connected to it to simulate the breathing motion of the human body.
通过现场观测记录下采样人员的呼吸运动参数作为样本,共获得n个样本。选取不同特征的人员作为采样人员,不同特征指性别、身高、体重、年龄;呼吸运动参数包括呼吸频率、胸腔在一个呼吸周期内不同时刻的纵向起伏幅值、胸腔在一个呼吸周期内不同时刻的纵向起伏速度;各个样本数据也即不同特征和这些特征对应的呼吸运动参数。样本数据中的身高精确到0.01厘米,体重精确到0.01千克,年龄精确到1周岁。The respiratory movement parameters of the sampling personnel were recorded as samples through on-site observation, and a total of n samples were obtained. People with different characteristics are selected as sampling personnel, and different characteristics refer to gender, height, weight, and age; respiratory movement parameters include respiratory frequency, longitudinal fluctuation amplitude of chest cavity at different moments in a breathing cycle, and chest cavity at different moments in a breathing cycle. Longitudinal undulation velocity; each sample data is different features and respiratory motion parameters corresponding to these features. The height in the sample data is accurate to 0.01 cm, the weight is accurate to 0.01 kg, and the age is accurate to 1 year old.
控制模块1包括端口通信单元11、波形显示单元12、参数调节单元13、运动控制单元14和专家库15。The control module 1 includes a port communication unit 11 , a waveform display unit 12 , a parameter adjustment unit 13 , a motion control unit 14 and an expert library 15 .
端口通信单元11用于获取n个样本数据,端口通信单元11与专家库15相连接,将n个样本数据传送到专家库15。The port communication unit 11 is used to acquire n sample data, and the port communication unit 11 is connected with the expert database 15 to transmit the n sample data to the expert database 15 .
如图2所示,专家库15中根据男女性别不同,分设第一子库151和第二子库152;专家库15将接收到的n个样本数据,根据性别不同分入第一子库151或第二子库152中,如图2所示,各个样本数据的信息传输用带箭头的虚线表示。As shown in Figure 2, in the expert database 15, according to the gender difference of men and women, a first sub-database 151 and a second sub-database 152 are set up; the expert database 15 divides the n sample data received into the first sub-database 151 according to gender differences Or in the second sub-library 152 , as shown in FIG. 2 , the information transmission of each sample data is represented by a dotted line with an arrow.
各子库分别对落入其中的样本数据进行归置处理,即:根据n个样本数据,得到n组PID调节参数;设计正交试验,对试验结果进行极差分析;通过对分析结果的插补计算,拟合出不同特征与PID调节参数的关系曲线。具体如下:Each sub-library separately arranges the sample data falling into it, that is: according to n sample data, get n groups of PID adjustment parameters; design an orthogonal experiment, and conduct a range analysis on the test results; Complementary calculation to fit the relationship curve between different features and PID adjustment parameters. details as follows:
1、根据n个样本数据,得到n组PID调节参数1. According to n sample data, get n sets of PID adjustment parameters
基于各样本数据、标准体重人的呼吸运动模拟的基础上,通过电机模拟,复现出各样本所代表的不同特征人员的呼吸运动。标准体重人的呼吸运动模拟,以及基于样本数据,通过电机模拟复现呼吸运动均为现有技术,已在公开号为CN114849083A的专利中记载,这里不再赘述。Based on the data of each sample and the simulation of breathing movement of people with standard weight, the breathing movement of people with different characteristics represented by each sample is reproduced through motor simulation. The breathing movement simulation of a person with a standard body weight, and the reproduction of breathing movement through motor simulation based on sample data are all existing technologies, which have been recorded in the patent publication number CN114849083A, and will not be repeated here.
人类不同性别、年龄、身高所对应的标准体重可通过世卫组织公布的标准体重计算公式计算出:The standard weight corresponding to different genders, ages and heights of human beings can be calculated by the standard weight calculation formula published by WHO:
男性标准体重=(身高cm-80)×70%,身高单位:厘米,体重单位:千克;Male standard weight = (height cm-80) × 70%, height unit: cm, weight unit: kg;
女性标准体重=(身高cm-70)×60%,身高单位:厘米,体重单位:千克;Female standard weight = (height cm-70) × 60%, height unit: cm, weight unit: kg;
在复现出各样本所代表的不同特征人员的呼吸运动过程中,通过对电机的PID参数整定,得到各样本对应的PID调节参数,即比例调节参数Kp、积分调节参数Ki和微分调节参数Kd,直到获取n个样本数据所对应的n组PID调节参数;比例调节参数Kp精确到0.01,积分调节参数Ki精确到0.1,微分调节参数Kd精确到0.1;第n个样本数据所对应的那一组PID调节参数记为(Kpn,Kin,Kdn)。PID参数整定的方法为现有技术,这里不再赘述。In the process of reproducing the respiratory movement of the people with different characteristics represented by each sample, the PID adjustment parameters corresponding to each sample are obtained by tuning the PID parameters of the motor, that is, the proportional adjustment parameter Kp , the integral adjustment parameter Ki and the differential adjustment parameter parameter Kd , until the n sets of PID adjustment parameters corresponding to n sample data are obtained; the proportional adjustment parameter Kp is accurate to 0.01, the integral adjustment parameter Ki is accurate to 0.1, and the differential adjustment parameter Kd is accurate to 0.1; the nth sample The set of PID adjustment parameters corresponding to the data is recorded as (Kpn , Kin , Kdn ). The method of PID parameter tuning is the prior art, and will not be repeated here.
2、设计正交试验,对试验结果进行极差分析2. Design an orthogonal test and conduct a range analysis on the test results
在本实施例中,选用年龄、体重、身高这三个可变因素,每个因素分别取三个水平区间,生成三因素三水平的正交试验表:In this embodiment, the three variable factors of age, body weight and height are selected, and each factor takes three horizontal intervals respectively to generate an orthogonal test table of three factors and three levels:
年龄的水平区间取[20,40)、[40,60)、[60,80),单位:周岁;The horizontal range of age is [20, 40), [40, 60), [60, 80), unit: one year old;
体重的水平区间取[40,60)、[60,80)、[80,100),单位:千克;The horizontal range of body weight is [40, 60), [60, 80), [80, 100), unit: kilogram;
身高的水平区间取[130,150)、[150,170)、[170,190),单位:厘米;The horizontal range of height is [130, 150), [150, 170), [170, 190), unit: cm;
试验结果为各组PID调节参数。The test results are the PID adjustment parameters of each group.
被传送到专家库15的样本是前期针对性地对于各因素各水平区间的样本采集,即保证了各年龄的水平区间、体重的水平区间、身高的水平区间中至少包含一个样本数据,在生成三因素三水平的正交试验表中将对应各因素水平区间的PID调节参数作为试验结果填入正交试验表中即可。本实施例的三因素三水平的正交试验表如下所示:The samples sent to the expert database 15 are targeted sample collections for each level interval of each factor in the early stage, that is, to ensure that at least one sample data is included in the horizontal interval of each age, weight, and height. In the three-factor three-level orthogonal test table, the PID adjustment parameters corresponding to the level intervals of each factor can be filled in the orthogonal test table as the test results. The orthogonal test table of the three factors and three levels of the present embodiment is as follows:
如果前期收集的样本未能保证各因素水平区间内至少包含一个样本,则需要根据生成的正交试验表补充采集对应身高、体重、年龄区间的样本数据,并通过上述方法得到这些样本数据对应的PID调节参数。If the samples collected in the previous period cannot ensure that at least one sample is included in the level interval of each factor, it is necessary to supplement the sample data corresponding to the height, weight, and age intervals according to the generated orthogonal test table, and obtain the corresponding values of these sample data through the above method. PID tuning parameters.
正交试验表可以使用Minitab等软件进行生成,属于现有技术,这里不再赘述。The orthogonal test table can be generated using software such as Minitab, which belongs to the prior art and will not be repeated here.
本实施例所取的可变因素、可变因素数量、各可变因素所取的水平区间均不能作为对本发明的限制;例如本发明还可以选用“机体强健程度”作为第四个可变因素,在采样时也将“机体强健程度”作为不同特征之一,各因素还可以划分成三个以上的水平区间。The variable factors taken in this embodiment, the number of variable factors, and the level intervals taken by each variable factor can not be used as restrictions on the present invention; for example, the present invention can also select "body robustness" as the fourth variable factor , the "physical fitness" is also taken as one of the different characteristics during sampling, and each factor can be divided into more than three horizontal intervals.
采用正交试验,可以依托正交表的正交性从全面试验中选取出均衡分散在大量样本中有代表性的点进行试验,得到样本,这些得到的样本能较全面地反映出全面试验的结果,保证数据准确且具有代表性的同时,尽可能减少为了得到样本而进行的试验次数,节约了人力,提高了试验效率;并且各样本受到多因素的影响,采用正交试验,便于观察分析各因素的水平变化对PID调节参数的影响。Using the orthogonal test, we can rely on the orthogonality of the orthogonal table to select representative points that are evenly dispersed in a large number of samples from the comprehensive test for testing, and obtain samples, which can more comprehensively reflect the comprehensive test. As a result, while ensuring the accuracy and representativeness of the data, the number of tests to obtain samples was reduced as much as possible, which saved manpower and improved test efficiency; and each sample was affected by multiple factors, and orthogonal tests were used to facilitate observation and analysis The influence of the level change of each factor on the PID adjustment parameters.
本发明实际的正交试验表中各因素所取的水平区间远超3个水平区间,试验总数也远超过9次,即实际的正交试验数量也是巨大的;根据实际的正交试验数据进行极差分析得到:比例调节参数Kp主要取决于样本人员的身高,积分调节参数Ki主要取决于样本人员的体重,微分调节参数Kd主要取决于样本人员年龄。正交试验的极差分析是现有技术,这里不再赘述。In the actual orthogonal test table of the present invention, the horizontal intervals taken by each factor far exceed 3 horizontal intervals, and the total number of tests also far exceeds 9 times, that is, the actual orthogonal test quantity is also huge; according to the actual orthogonal test data, the The range analysis shows that the proportional adjustment parameter Kp mainly depends on the height of the sample personnel, the integral adjustment parameter Ki mainly depends on the weight of the sample personnel, and the differential adjustment parameter Kd mainly depends on the age of the sample personnel. The range analysis of the orthogonal test is a prior art, and will not be repeated here.
3、通过对分析结果的插补计算,拟合出不同特征与PID调节参数的关系曲线3. Through the interpolation calculation of the analysis results, the relationship curve between different characteristics and PID adjustment parameters is fitted
因为比例调节参数Kp主要取决于样本人员的身高,将n个样本数据中的身高与比例调节参数Kp提取出来,作为离散的样本点,以身高(单位:厘米)为自变量a,精确到0.01厘米;比例调节参数Kp为因变量Kp(a),精确到0.01;通过对离散样本点的插补计算拟合出身高与比例调节参数Kp之间的关系曲线。身高与比例调节参数Kp之间的插补计算公式如下:Because the proportional adjustment parameter Kp mainly depends on the height of the sample personnel, the height and the proportional adjustment parameter Kp in the n sample data are extracted as discrete sample points, and the height (unit: cm) is taken as the independent variable a. to 0.01 cm; the proportional adjustment parameter Kp is the dependent variable Kp(a), accurate to 0.01; the relationship curve between the height and the proportional adjustment parameter Kp is fitted through the interpolation calculation of discrete sample points. The interpolation calculation formula between height and proportional adjustment parameter Kp is as follows:
a为自变量身高,即输入身高a;Kp(a)为因变量比例调节参数,即输出的比例调节参数;为拉格朗日插值计算公式,ai和aj均为不同样本点处的身高,0≤i≤n,0≤j≤n,i≠j;当输入身高与某个样本点身高之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kp值为Kp(y);当输入身高与某个样本点身高之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kp值为Kp(y-1)。a is the independent variable height, that is, the input height a; Kp(a) is the proportional adjustment parameter of the dependent variable, that is, the output proportional adjustment parameter; It is the calculation formula of Lagrangian interpolation, ai and aj are the heights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input height is between the height of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kp value corresponding to the sample point as Kp(y); when the input height and When the difference between the heights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, theKp value corresponding to the sample point is taken is Kp(y-1).
如输入身高为a=160.00厘米,假设样本点一共有四个,各样本点所对应的身高分别是a1=145.00厘米、a2=157.50厘米、a3=162.50厘米、a4=168.00厘米。则a与a1之间的差值为正向15.00厘米的差值,a与a2之间的差值为正向2.50厘米的差值,a与a3之间的差值为负向2.50厘米的差值,a与a4之间的差值为负向8.00厘米的差值。If the input height is a=160.00 cm, assuming that there are four sample points in total, the heights corresponding to each sample point are a1 =145.00 cm, a2 =157.50 cm, a3 =162.50 cm, a4 =168.00 cm. Then the difference between a and a1 is the difference of 15.00 cm in the positive direction, the difference between a and a2 is the difference of 2.50 cm in the positive direction, and the difference between a and a3 is 2.50 in the negative direction The difference in centimeters, the difference between a and a4 is a negative 8.00 centimeter difference.
显然,只有a2=157.50厘米时,才满足输入身高与该样本点身高之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值,即取a2=157.50厘米时对应的Kp值才是Kp(y);只有a3=162.50厘米时,才满足输入身高与某个样本点身高之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值,即取a3=162.50厘米时对应的Kp值才是Kp(y-1)。Obviously, only when a2 =157.50 cm, the difference between the input height and the height of the sample point is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, That is, when a2 = 157.50 cm, the correspondingKp value is Kp(y); only when a3 = 162.50 cm, can the difference between the input height and the height of a certain sample point be non-positive. difference, and the negative difference is the minimum value among the absolute values of all negative differences, that is, when a3 =162.50 cm, the corresponding Kp value is Kp(y-1).
如图3所示,图中虚线为通过插补计算拟合出的Kp与身高关系曲线,可见图中离散的样本点基本都落在通过插补计算拟合出Kp与身高关系曲线上;为了方便观察,图3中还用实线画出了直线拟合出的Kp与身高关系;从图3中可以看出,通过插补计算拟合出的Kp与身高关系曲线的拟合精度要明显高于直线拟合。As shown in Figure 3, the dotted line in the figure is the Kp and height relationship curve fitted by interpolation calculation. It can be seen that the discrete sample points in the figure basically fall on the Kp and height relationship curve fitted by interpolation calculation ; For the convenience of observation, in Fig. 3, the relationship betweenKp and height fitted by a straight line is also drawn with a solid line; as can be seen from Fig. 3, the approximate relationship betweenKp and height relationship curve fitted by interpolation calculation The accuracy of fitting is significantly higher than that of straight line fitting.
同理,因为积分调节参数Ki主要取决于样本人员的体重,将n个样本中的体重与对应的积分调节参数Ki提取出来,作为离散的样本点,以体重(单位:千克)为自变量b,精确到0.01千克;积分调节参数Ki为因变量Ki(b),精确到0.1;通过对离散样本点的插补计算拟合出体重与积分调节参数Ki之间的关系曲线。体重与积分调节参数Ki之间的插补计算公式如下:Similarly, because the integral adjustment parameter Ki mainly depends on the weight of the sample personnel, the weight in n samples and the corresponding integral adjustment parameter Ki are extracted as discrete sample points, with the body weight (unit: kilogram) as the self The variable b is accurate to 0.01 kg; the integral adjustment parameter Ki is the dependent variable Ki(b), accurate to 0.1; the relationship curve between the body weight and the integral adjustment parameter Ki is fitted through the interpolation calculation of discrete sample points. The interpolation calculation formula between body weight and integral adjustment parameter Ki is as follows:
b为自变量体重,即输入体重b;Ki(b)为因变量积分调节参数,即输出的积分调节参数;为拉格朗日插值计算公式,bi和bj均为不同样本点处的体重,0≤i≤n,0≤j≤n,i≠j;当输入体重与某个样本点体重之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Ki值为Ki(y);当输入体重与某个样本点体重之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Ki值为Ki(y-1)。b is the independent variable body weight, that is, the input body weight b; Ki(b) is the integral adjustment parameter of the dependent variable, that is, the output integral adjustment parameter; It is the calculation formula of Lagrangian interpolation, bi and bj are the weights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input weight is between the weight of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Ki value corresponding to the sample point as Ki(y); when the input body weight and When the difference between the body weights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value of all the absolute values of the negative difference, the Ki value corresponding to the sample point is taken is Ki(y-1).
如图4所示,图中虚线为通过插补计算拟合出的Ki与体重关系曲线,可见图中离散的样本点基本都落在通过插补计算拟合出Ki与体重关系曲线上;为了方便观察,图4中还用实线画出了直线拟合出的Ki与体重关系;从图4中可以看出,通过插补计算拟合出的Ki与体重关系曲线的拟合精度要明显高于直线拟合。As shown in Figure 4, the dotted line in the figure is the Ki and body weight relationship curve fitted by interpolation calculation. It can be seen that the discrete sample points in the figure basically fall on the Ki and body weight relationship curve fitted by interpolation calculation ; For the convenience of observation, in Fig. 4, the relationship between Ki and body weight fitted by a straight line is also drawn with a solid line; as can be seen from Fig. 4, the Ki fitted by interpolation calculation and the relationship between body weight The accuracy of fitting is significantly higher than that of straight line fitting.
同理,因为微分调节参数Kd主要取决于样本人员的年龄,将n个样本中的年龄与对应的微分调节参数Kd提取出来,作为离散的样本点,以年龄(单位:周岁)为自变量c,精确到1周岁;微分调节参数Kd为因变量Kd(c),精确到0.1;通过对离散样本点的插补计算拟合出年龄与微分调节参数Kd之间的关系曲线。年龄与微分调节参数Kd之间的插补计算公式如下:In the same way, because the differential adjustment parameter Kd mainly depends on the age of the sample personnel, the age in n samples and the corresponding differential adjustment parameter Kd are extracted as discrete sample points, with age (unit: one year old) as the self The variable c is accurate to 1 year old; the differential adjustment parameter Kd is the dependent variable Kd(c), accurate to 0.1; the relationship curve between age and differential adjustment parameter Kd is fitted through the interpolation calculation of discrete sample points. The interpolation calculation formula between age and differential adjustment parameter Kd is as follows:
c为自变量年龄,即输入年龄c;Kd(c)为因变量微分调节参数,即输出的微分调节参数;为拉格朗日插值计算公式,ci和cj均为不同样本点处的年龄,0≤i≤n,0≤j≤n,i≠j;当输入年龄与某个样本点年龄之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kd值为Kd(y);当输入年龄与某个样本点年龄之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kd值为Kd(y-1)。c is the independent variable age, that is, the input age c; Kd(c) is the differential adjustment parameter of the dependent variable, that is, the output differential adjustment parameter; It is the calculation formula of Lagrangian interpolation, ci and cj are the ages at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input age is between the age of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kd value corresponding to the sample point as Kd(y); when the input age and When the difference between the ages of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, the Kd value corresponding to the sample point is taken is Kd(y-1).
如图5所示,图中虚线为通过插补计算拟合出的Kd与年龄关系曲线,可见图中离散的样本点基本都落在通过插补计算拟合出Kd与年龄关系曲线上;为了方便观察,图5中还用实线画出了直线拟合出的Kd与年龄关系;从图5中可以看出,通过插补计算拟合出的Kd与年龄关系曲线的拟合精度要明显高于直线拟合。As shown in Figure 5, the dotted line in the figure is the Kd and age relationship curve fitted by interpolation calculation. It can be seen that the discrete sample points in the figure basically fall on the Kd and age relationship curve fitted by interpolation calculation ; For the convenience of observation, the relationship between Kd and age fitted by a straight line is also drawn with a solid line in Fig. 5; as can be seen from Fig. 5, the Kd and age relationship curve fitted by interpolation calculation The accuracy of fitting is significantly higher than that of straight line fitting.
如图1-图2所示,端口通信单元11还用于获取待仿真人员的特征信息,待仿真人员的特征信息包括性别、输入身高a、输入体重b、输入年龄c;端口通信单元11将待仿真人员的特征信息传送到专家库15中。专家库15根据待仿真人员的特征信息中的性别不同,将待仿真人员的特征信息送入第一子库151或第二子库152中,各子库中会将待仿真人员的特征信息中的输入身高a、输入体重b、输入年龄c分别代入各条不同特征与PID调节参数的关系曲线中进行计算,计算出的PID调节参数Kp(a)、Ki(b)和Kd(c)即为该待仿真人员最适合的PID调节参数。As shown in Figures 1-2, the port communication unit 11 is also used to obtain the characteristic information of the person to be simulated. The characteristic information of the person to be simulated includes gender, input height a, input weight b, and input age c; the port communication unit 11 will The characteristic information of the person to be simulated is transmitted to the expert database 15 . The expert database 15 sends the characteristic information of the personnel to be simulated into the first sub-database 151 or the second sub-database 152 according to the gender difference in the characteristic information of the personnel to be simulated, and the characteristic information of the personnel to be simulated will be included in each sub-bank. The input height a, input weight b, and input age c are respectively substituted into the relationship curves between different characteristics and PID adjustment parameters for calculation, and the calculated PID adjustment parameters Kp(a), Ki(b) and Kd(c) are Adjust the parameters of the most suitable PID for the person to be simulated.
端口通信单元11还与运动控制单元14相连接,用于向运动控制单元14发送启停信号。The port communication unit 11 is also connected to the motion control unit 14 for sending a start-stop signal to the motion control unit 14 .
专家库15与参数调节单元13相连接,专家库15将根据待仿真人员的特征信息所计算出的该待仿真人员最适合的PID调节参数传递到参数调节单元13中。The expert library 15 is connected to the parameter adjustment unit 13 , and the expert library 15 transmits the most suitable PID adjustment parameters of the person to be simulated calculated according to the characteristic information of the person to be simulated to the parameter adjustment unit 13 .
如图1所示,参数调节单元13还分别与步进电机2、运动控制单元14相连接;运动控制单元14与步进电机2相连接。运动控制单元14在接收到端口通信单元11传送来的启动信号后,会发送启动信号,启动步进电机2。具体来说,运动控制单元14中包括控制板141和驱动器142,控制板141在接收到端口通信单元11传送来的启动信号后,控制驱动器142向步进电机2输入脉冲信号,控制步进电机2进行运转,模拟人类呼吸运动。As shown in FIG. 1 , the parameter adjustment unit 13 is also connected to the stepping motor 2 and the motion control unit 14 respectively; the motion control unit 14 is connected to the stepping motor 2 . After receiving the start signal from the port communication unit 11 , the motion control unit 14 sends a start signal to start the stepper motor 2 . Specifically, the motion control unit 14 includes a control board 141 and a driver 142. After the control board 141 receives the start signal transmitted by the port communication unit 11, it controls the driver 142 to input a pulse signal to the stepper motor 2 to control the stepper motor. 2 to run, simulating human breathing movement.
步进电机2在运转的过程中,将实时转向、速度和旋转角度这些电机实际运行参数传送到参数调节单元13内;参数调节单元13根据待仿真人员最适合的PID调节参数与标准体重人的呼吸运动,计算并模拟出待仿真人员的理论呼吸运动曲线;参数调节单元13将理论呼吸运动曲线与电机实际运行参数之间的比较后,给运动控制单元14中的控制板141发送实时修正信息;控制板141根据接收到的实时修正信息对驱动器142发出的脉冲信号进行实时修正,控制驱动器142向步进电机2输入修正后的修正脉冲,使步进电机2在实时修正脉冲下运转。During the operation of the stepper motor 2, the actual operating parameters of the motor such as the real-time steering, speed and rotation angle are transmitted to the parameter adjustment unit 13; the parameter adjustment unit 13 adjusts the parameters according to the most suitable PID of the person to be simulated and the standard weight Breathing movement, calculate and simulate the theoretical breathing movement curve of the person to be simulated; the parameter adjustment unit 13 sends real-time correction information to the control board 141 in the motion control unit 14 after comparing the theoretical breathing movement curve with the actual operating parameters of the motor The control panel 141 corrects the pulse signal sent by the driver 142 according to the received real-time correction information, and the control driver 142 inputs the corrected correction pulse to the stepper motor 2, so that the stepper motor 2 runs under the real-time correction pulse.
波形显示单元12分别与端口通信单元11、参数调节单元13相连接。波形显示单元12作为人机交互界面,分为四个部分,第一个部分是基础设置部分,用于输入和显示端口通信单元11所需的特征信息和参数;第二个部分是运动参数部分,用于接收参数调节单元13内的各种参数信息,可以显示专家库15中所计算出的最适合的PID调节参数、步进电机2的实际运行参数,并可以对步进电机2的运行参数进行调整;第三个部分是运动波形部分,通过接收参数调节单元13内的参数信息,显示运动波形;第四个部分是启停控制部分,试验人员通过该部分下达步进电机2的启停指令,通过端口通信单元11将启停信号传送到运动控制单元14,实现对步进电机2启停的控制。The waveform display unit 12 is connected to the port communication unit 11 and the parameter adjustment unit 13 respectively. Waveform display unit 12 is divided into four parts as man-machine interaction interface, and the first part is the basic setting part, is used for inputting and displaying the characteristic information and parameter required by port communication unit 11; The second part is the motion parameter part , used to receive various parameter information in the parameter adjustment unit 13, can display the most suitable PID adjustment parameters calculated in the expert library 15, the actual operating parameters of the stepper motor 2, and can control the operation of the stepper motor 2 parameters are adjusted; the third part is the movement waveform part, which displays the movement waveform by receiving the parameter information in the parameter adjustment unit 13; The stop command transmits the start-stop signal to the motion control unit 14 through the port communication unit 11 to realize the control of the start-stop of the stepping motor 2 .
控制模块1在硬件上包括运动控制软件即上位机、控制板141即下位机。上位机通过RS232通信接口发送指令给下位机,下位机将指令解析成脉冲信号发送给驱动器142,驱动器142将信号放大后用于步进电机2的运转。In terms of hardware, the control module 1 includes motion control software, that is, a host computer, and a control board 141, that is, a lower computer. The upper computer sends instructions to the lower computer through the RS232 communication interface, and the lower computer parses the instructions into pulse signals and sends them to the driver 142. The driver 142 amplifies the signals for the operation of the stepping motor 2.
本发明的一种呼吸运动仿真系统通过建立专家库15,将体重、身高、性别、年龄这些会对呼吸运动造成影响的特征和这些特征对应的PID调节参数进行归置处理后,设计正交试验,完成试验结果分析,并通过对分析结果的插补计算,拟合出人不同特征与PID调节参数的关系曲线,使本发明的一种呼吸运动仿真系统在高精度闭环控制的同时,可以根据待仿真人员的特征信息进行针对性的拟合调整,即模拟出非标准体重的人类呼吸运动,搭建更为真实、多样的仿真环境;且本发明降低了呼吸运动仿真试验的进行门槛,使呼吸运动仿真试验无需专业人员根据电机的运动情况进行全程调试,只需要试验人员在实验中输入待仿真人员的特征信息,专家库15就会自动计算出最适合的PID调节参数,使参数调节单元13根据最适合的PID调节参数以及步进电机2的实际运行参数,通过运动控制单元14对步进电机2进行闭环控制,实现自适应仿真呼吸运动,便于医学实验的进行。专家库15内的样本处理方法可以在仅有少量样本的情况下,尽可能地保证拟合出的人员特征与PID调节参数的关系曲线的精确性;随着所需样本数量的增加,还可以进一步提高其拟合出人员特征与PID调节参数的关系曲线的精度。A respiratory motion simulation system of the present invention establishes an expert database 15, and after the characteristics of weight, height, gender, and age that affect respiratory motion and the PID adjustment parameters corresponding to these features are processed, an orthogonal experiment is designed. , complete the analysis of the test results, and through the interpolation calculation of the analysis results, fit the relationship curve between different characteristics of people and the PID adjustment parameters, so that a breathing motion simulation system of the present invention can be controlled according to the high-precision closed-loop control. The characteristic information of the person to be simulated is subjected to targeted fitting adjustments, that is, the breathing movement of a human with a non-standard weight is simulated, and a more realistic and diverse simulation environment is built; and the present invention lowers the threshold for performing a breathing movement simulation test, making breathing The motion simulation test does not require professionals to conduct full debugging according to the motion of the motor. It only needs the tester to input the characteristic information of the person to be simulated in the experiment, and the expert database 15 will automatically calculate the most suitable PID adjustment parameters, so that the parameter adjustment unit 13 According to the most suitable PID adjustment parameters and the actual operating parameters of the stepping motor 2, the motion control unit 14 performs closed-loop control on the stepping motor 2 to realize self-adaptive simulated breathing movement, which is convenient for medical experiments. The sample processing method in the expert library 15 can ensure the accuracy of the relationship curve between the fitted personnel characteristics and the PID adjustment parameters as much as possible when there are only a small number of samples; Further improve the accuracy of fitting the relationship curve between personnel characteristics and PID adjustment parameters.
本发明的一种呼吸运动仿真系统的仿真方法,如图6所示,包括以下步骤:The simulation method of a kind of respiratory motion simulation system of the present invention, as shown in Figure 6, comprises the following steps:
S1,端口通信单元11获取n个不同特征的采样人员的呼吸运动参数,即共获得n个样本,不同特征指性别、身高、体重、年龄;呼吸运动参数包括呼吸频率、胸腔在一个呼吸周期内不同时刻的纵向起伏幅值、胸腔在一个呼吸周期内不同时刻的纵向起伏速度;各个样本数据也即不同特征和这些特征对应的呼吸运动参数;身高精确到0.01厘米,体重精确到0.01千克,年龄精确到1周岁,呼吸频率精确到1次,纵向起伏幅值精确到0.1厘米,纵向起伏速度精确到0.1厘米/秒;端口通信单元11将n个样本数据传送到专家库15;S1, the port communication unit 11 acquires the respiratory movement parameters of n samplers with different characteristics, that is, obtains n samples in total, and the different characteristics refer to gender, height, weight, and age; the respiratory movement parameters include respiratory rate, chest cavity in a respiratory cycle The amplitude of longitudinal fluctuations at different moments, the longitudinal fluctuation speed of the chest cavity at different moments in a breathing cycle; the data of each sample are different characteristics and the respiratory movement parameters corresponding to these characteristics; height is accurate to 0.01 cm, weight is accurate to 0.01 kg, age It is accurate to 1 year old, the respiratory rate is accurate to 1 time, the amplitude of longitudinal fluctuation is accurate to 0.1 cm, and the speed of longitudinal fluctuation is accurate to 0.1 cm/s; the port communication unit 11 transmits n sample data to the expert database 15;
S2,专家库15将n个样本数据进行归置处理,即根据n个样本数据,得到n组PID调节参数;设计正交试验,对试验结果进行极差分析;通过对分析结果的插补计算,拟合出不同特征与PID调节参数的关系曲线;S2还包括以下步骤:S2, the expert database 15 arranges the n sample data, that is, obtains n groups of PID adjustment parameters according to the n sample data; designs an orthogonal experiment, and performs a range analysis on the test results; calculates by interpolating the analysis results , fit the relationship curve between different features and PID adjustment parameters; S2 also includes the following steps:
S21,根据男女性别不同,将n个样本分入第一子库151或第二子库152中;S21, divide the n samples into the first sub-bank 151 or the second sub-bank 152 according to the gender differences;
S22,在各子库中,在基于各样本数据、标准体重人的呼吸运动的基础上,通过电机模拟,复现出各样本所代表的不同特征人员的呼吸运动,在复现出各样本所代表的不同特征人员的呼吸运动过程中,通过对电机的PID参数整定,得到各样本对应的PID调节参数,即比例调节参数Kp、积分调节参数Ki和微分调节参数Kd,直到获取n个样本数据所对应的n组PID调节参数,第n个样本数据所对应的那一组PID调节参数记为(Kpn,Kin,Kdn);S22. In each sub-library, on the basis of each sample data and the breathing movement of a person with a standard weight, through motor simulation, reproduce the breathing movement of the person with different characteristics represented by each sample. In the process of respiratory movement of the represented persons with different characteristics, by adjusting the PID parameters of the motor, the PID adjustment parameters corresponding to each sample are obtained, that is, the proportional adjustment parameter Kp , the integral adjustment parameter Ki and the differential adjustment parameter Kd , until the n n groups of PID adjustment parameters corresponding to the sample data, the group of PID adjustment parameters corresponding to the nth sample data is recorded as (Kpn , Kin , Kdn );
S23,设计正交试验,对试验结果进行极差分析;S23还包括以下步骤:S23, designing an orthogonal test, and performing a range analysis on the test results; S23 also includes the following steps:
S231,选定年龄、体重、身高作为三个可变因素,再设定各可变因素的水平区间,生成正交试验表;S231, selecting age, weight, and height as three variable factors, and then setting the level intervals of each variable factor to generate an orthogonal test table;
S232,根据正交试验表中的对应区间,将各区间所包含样本的PID调节参数作为试验结果填入正交试验表中,保证了各年龄的水平区间、体重的水平区间、身高的水平区间中至少包含一个样本,共计n个样本;S232, according to the corresponding intervals in the orthogonal test table, fill in the PID adjustment parameters of the samples contained in each interval as the test results in the orthogonal test table, ensuring the horizontal intervals of each age, weight, and height contains at least one sample, a total of n samples;
S233,对正交试验表进行极差分析,得到相关性结论:比例调节参数Kp主要取决于样本人员的身高,积分调节参数Ki主要取决于样本人员的体重,微分调节参数Kd主要取决于样本人员的年龄;S233, conduct range analysis on the orthogonal test table, and get the correlation conclusion: the proportional adjustment parameter Kp mainly depends on the height of the sample personnel, the integral adjustment parameter Ki mainly depends on the weight of the sample personnel, and the differential adjustment parameter Kd mainly depends on the age of the sample person;
S24,通过插补计算,拟合出不同特征与PID调节参数的关系曲线;S24还包括以下步骤:S24, through interpolation calculation, fitting the relationship curve between different features and PID adjustment parameters; S24 also includes the following steps:
S241,将n个样本中的身高与对应的比例调节参数Kp提取出来,作为离散的样本点,通过插补计算拟合出身高与比例调节参数Kp之间的关系曲线,计算公式为:S241, extracting the height and the corresponding proportional adjustment parameter Kp in the n samples, as discrete sample points, and fitting the relationship curve between the height and the proportional adjustment parameter Kp through interpolation calculation, the calculation formula is:
a为自变量身高(单位:厘米),即输入身高,精确到0.01厘米;Kp(a)为因变量比例调节参数,即输出的比例调节参数,精确到0.01;为拉格朗日插值计算公式,ai和aj均为不同样本点处的身高,0≤i≤n,0≤j≤n,i≠j;当输入身高与某个样本点身高之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kp值为Kp(y);当输入身高与某个样本点身高之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kp值为Kp(y-1);a is the independent variable height (unit: cm), that is, the input height, accurate to 0.01 cm; Kp(a) is the proportional adjustment parameter of the dependent variable, that is, the output proportional adjustment parameter, accurate to 0.01; It is the calculation formula of Lagrangian interpolation, ai and aj are the heights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input height is between the height of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kp value corresponding to the sample point as Kp(y); when the input height and When the difference between the heights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, theKp value corresponding to the sample point is taken is Kp(y-1);
S242,将n个样本中的体重与对应的积分调节参数Ki提取出来,作为离散的样本点,通过插补计算拟合出体重与积分调节参数Ki之间的关系曲线,计算公式如下:S242, extracting the body weight and the corresponding integral adjustment parameter Ki in the n samples, as discrete sample points, and fitting the relationship curve between the body weight and the integral adjustment parameter Ki through interpolation calculation, the calculation formula is as follows:
b为自变量体重(单位:千克),即输入体重,精确到0.01千克;Ki(b)为因变量积分调节参数,即输出的积分调节参数,精确到0.1;为拉格朗日插值计算公式,bi和bj均为不同样本点处的体重,0≤i≤n,0≤j≤n,i≠j;当输入体重与某个样本点体重之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Ki值为Ki(y);当输入体重与某个样本点体重之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Ki值为Ki(y-1);b is the weight of the independent variable (unit: kilogram), that is, the input weight, accurate to 0.01 kg; Ki(b) is the integral adjustment parameter of the dependent variable, that is, the output integral adjustment parameter, accurate to 0.1; It is the calculation formula of Lagrangian interpolation, bi and bj are the weights at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input weight is between the weight of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Ki value corresponding to the sample point as Ki(y); when the input body weight and When the difference between the body weights of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value of all the absolute values of the negative difference, the Ki value corresponding to the sample point is taken is Ki(y-1);
S243,将n个样本中的年龄与对应的微分调节参数Kd提取出来,作为离散的样本点,通过插补计算拟合出年龄与微分调节参数Kd之间的关系曲线,计算公式如下:S243, extracting the age and the corresponding differential adjustment parameter Kd from the n samples, as discrete sample points, and fitting the relationship curve between the age and the differential adjustment parameter Kd through interpolation calculation, the calculation formula is as follows:
c为自变量年龄(单位:周岁),即输入年龄,精确到1周岁;Kd(c)为因变量微分调节参数,即输出的微分调节参数,精确到0.1;为拉格朗日插值计算公式,ci和cj均为不同样本点处的年龄,0≤i≤n,0≤j≤n,i≠j;当输入年龄与某个样本点年龄之间的差值为非负数的正向差值,且该正向差值为所有正向差值中的最小值时,取该样本点所对应的Kd值为Kd(y);当输入年龄与某个样本点年龄之间的差值为非正数的负向差值,且该负向差值为所有负向差值绝对值中的最小值时,取该样本点所对应的Kd值为Kd(y-1);c is the age of the independent variable (unit: one year old), that is, the input age, accurate to 1 year old; Kd(c) is the differential adjustment parameter of the dependent variable, that is, the output differential adjustment parameter, accurate to 0.1; It is the calculation formula of Lagrangian interpolation, ci and cj are the ages at different sample points, 0≤i≤n, 0≤j≤n, i≠j; when the input age is between the age of a certain sample point When the difference is a non-negative positive difference, and the positive difference is the minimum value of all positive differences, take the Kd value corresponding to the sample point as Kd(y); when the input age and When the difference between the ages of a certain sample point is a non-positive negative difference, and the negative difference is the minimum value in the absolute value of all negative differences, the Kd value corresponding to the sample point is taken is Kd(y-1);
S3,端口通信单元11获取待仿真人员的特征信息,包括性别、输入身高、输入体重、输入年龄;运动控制单元14获取启动信号,控制步进电机2启动运行;S3, the port communication unit 11 acquires the characteristic information of the person to be simulated, including gender, input height, input weight, and input age; the motion control unit 14 acquires a starting signal, and controls the stepper motor 2 to start running;
S4,专家库15将待仿真人员的特征信息代入各条不同特征与PID调节参数的关系曲线中进行计算,计算出的PID调节参数Kp(a)、Ki(b)和Kd(c)即为该待仿真人员最适合的PID调节参数;S4, the expert library 15 substitutes the characteristic information of the person to be simulated into the relationship curve between each different characteristic and the PID adjustment parameter for calculation, and the calculated PID adjustment parameters Kp(a), Ki(b) and Kd(c) are The most suitable PID adjustment parameters for the person to be simulated;
S5,参数调节单元13根据接收到的待仿真人员最适合的PID调节参数与标准体重人的呼吸运动,计算并模拟出待仿真人员的理论呼吸运动曲线;S5, the parameter adjustment unit 13 calculates and simulates the theoretical respiratory movement curve of the person to be simulated according to the received most suitable PID adjustment parameters of the person to be simulated and the breathing movement of a person with a standard weight;
S6,参数调节单元13获取步进电机2的电机实际运行参数,包括实时转向、速度和旋转角度;参数调节单元13将理论呼吸运动曲线与电机实际运行参数进行比较后,根据比对误差输出实时修正信息;S6, the parameter adjustment unit 13 obtains the motor actual operating parameters of the stepper motor 2, including real-time steering, speed and rotation angle; after the parameter adjustment unit 13 compares the theoretical breathing motion curve with the actual operating parameters of the motor, it outputs the real-time output according to the comparison error. Amendment information;
S7,运动控制单元14接收实时修正信息,控制板141对驱动器142发出的脉冲信号进行实时修正,驱动器142向步进电机2输入修正后的实时修正脉冲信号;S7, the motion control unit 14 receives the real-time correction information, the control board 141 corrects the pulse signal sent by the driver 142 in real time, and the driver 142 inputs the corrected real-time correction pulse signal to the stepping motor 2;
S8,重复S6~S7,直到理论呼吸运动曲线与电机实际运行参数中的误差小于误差设定值,即判定步进电机2稳定运行,正式开展后续医学实验;误差设定值包括角度误差为±0.05°、转速误差为±5转/分钟;S8, repeating S6-S7 until the error between the theoretical breathing motion curve and the actual operating parameters of the motor is less than the error setting value, that is, it is determined that the stepping motor 2 is running stably, and the follow-up medical experiment is formally carried out; the error setting value includes the angle error of ± 0.05°, speed error is ±5 rpm;
S9,待仿真人员的特征信息改变后,重复S3~S8,开始新特征信息下的呼吸运动仿真。S9, after the characteristic information of the simulated person is changed, repeat S3-S8, and start the breathing movement simulation under the new characteristic information.
本发明的一种采用呼吸运动仿真系统的仿真模体,除了相连接的控制模块1和步进电机2外,还包括运动平台3和设置在运动平台3和步进电机2外部的仿真躯干,步进电机2通过改变转向、速度和旋转角度的往返运动带动与其连接的运动平台3使仿真躯干模拟人体呼吸运动。控制模块1和步进电机2的部分不再赘述。运动平台3还包括蜗杆、滑台、调零器、限位器等,步进电机2的运转带动丝杠转动,滑台跟随丝杠进行运动,限位器和调零器用于限制滑台的运动。A kind of emulation phantom that adopts respiratory motion emulation system of the present invention, except the control module 1 that is connected with stepper motor 2, also comprises motion platform 3 and the simulation torso that is arranged on the exterior of motion platform 3 and stepper motor 2, The stepper motor 2 drives the motion platform 3 connected to it through the reciprocating motion of changing the steering, speed and rotation angle to make the simulated torso simulate the breathing motion of the human body. The parts of the control module 1 and the stepper motor 2 will not be described in detail. The motion platform 3 also includes a worm, a slide table, a zero adjuster, a limiter, etc. The operation of the stepping motor 2 drives the screw to rotate, and the slide table follows the lead screw to move, and the limiter and the zero adjuster are used to limit the movement of the slide table. sports.
本发明未详细描述的技术、形状、构造部分均为公知技术。The technologies, shapes and construction parts not described in detail in the present invention are all known technologies.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310334785.5ACN116643507B (en) | 2023-03-31 | 2023-03-31 | Respiratory motion simulation system, simulation method and simulation die body |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310334785.5ACN116643507B (en) | 2023-03-31 | 2023-03-31 | Respiratory motion simulation system, simulation method and simulation die body |
| Publication Number | Publication Date |
|---|---|
| CN116643507Atrue CN116643507A (en) | 2023-08-25 |
| CN116643507B CN116643507B (en) | 2025-05-27 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310334785.5AActiveCN116643507B (en) | 2023-03-31 | 2023-03-31 | Respiratory motion simulation system, simulation method and simulation die body |
| Country | Link |
|---|---|
| CN (1) | CN116643507B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118587960A (en)* | 2024-08-06 | 2024-09-03 | 嘉兴元贝贝科技有限公司 | A device and system for simulating human heartbeat and breathing using electromagnetic force |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103366625A (en)* | 2013-07-25 | 2013-10-23 | 中山大学 | Device and control method for simulating spontaneous respiratory movement of human lung |
| JP2017080141A (en)* | 2015-10-29 | 2017-05-18 | Tdk株式会社 | Respiration analysis device, respiration analysis method, and program |
| CN108897212A (en)* | 2018-10-16 | 2018-11-27 | 太原理工大学 | Multivariable PID control strategy is realized in PLS frame based on Gaussian process model |
| CN109940618A (en)* | 2019-04-04 | 2019-06-28 | 天津理工大学 | A Motion Control Method for Serial Manipulator Drive System Based on Orthogonal Fuzzy PID |
| CN112704791A (en)* | 2020-12-29 | 2021-04-27 | 湖南明康中锦医疗科技发展有限公司 | CPAP (continuous positive airway pressure) mode air delivery control method of respiratory support equipment and respiratory support equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103366625A (en)* | 2013-07-25 | 2013-10-23 | 中山大学 | Device and control method for simulating spontaneous respiratory movement of human lung |
| JP2017080141A (en)* | 2015-10-29 | 2017-05-18 | Tdk株式会社 | Respiration analysis device, respiration analysis method, and program |
| CN108897212A (en)* | 2018-10-16 | 2018-11-27 | 太原理工大学 | Multivariable PID control strategy is realized in PLS frame based on Gaussian process model |
| CN109940618A (en)* | 2019-04-04 | 2019-06-28 | 天津理工大学 | A Motion Control Method for Serial Manipulator Drive System Based on Orthogonal Fuzzy PID |
| CN112704791A (en)* | 2020-12-29 | 2021-04-27 | 湖南明康中锦医疗科技发展有限公司 | CPAP (continuous positive airway pressure) mode air delivery control method of respiratory support equipment and respiratory support equipment |
| Title |
|---|
| R. BRACIO: "Hybrid modelling and simulation of the human respiratory system", PROCEEDINGS OF THE FIRST JOINT BMESEMBS CONFERENCE, 6 August 2002 (2002-08-06), pages 350* |
| 张坤: "主动模拟肺的运动及控制部分仿真研究", 医疗卫生装备, vol. 32, no. 8, 31 August 2011 (2011-08-31), pages 1 - 3* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118587960A (en)* | 2024-08-06 | 2024-09-03 | 嘉兴元贝贝科技有限公司 | A device and system for simulating human heartbeat and breathing using electromagnetic force |
| Publication number | Publication date |
|---|---|
| CN116643507B (en) | 2025-05-27 |
| Publication | Publication Date | Title |
|---|---|---|
| CN110415785A (en) | The method and system of artificial intelligence guidance radiotherapy planning | |
| US11043142B2 (en) | Virtual radiation oncology clinic and methods of use thereof | |
| CN102389366B (en) | Human body back acupuncture point positioning system | |
| CN105931262B (en) | Tumour position prediction apparatus | |
| CN108764120A (en) | A kind of human body specification action evaluation method | |
| CN104548371B (en) | Human body breathing motion simulation device | |
| CN111540437B (en) | Dose verification method and system based on artificial intelligence | |
| CN116643507A (en) | Respiratory motion simulation system, simulation method and simulation die body | |
| CN109621229B (en) | A dynamic phantom for adult chest and abdominal dose verification | |
| CN109859817A (en) | Dosimetric assessment methods and assessment systems for organs at risk in esophageal radiation therapy planning | |
| CN105167788A (en) | Dual-image C-shaped arm system | |
| CN109785962A (en) | A kind of method and system based on launched field parameter in learning model intelligent predicting radiotherapy | |
| CN105955918A (en) | Experimental multi-instrument system | |
| CN207401111U (en) | Smart motion health data collection apparatus | |
| CN203090271U (en) | Medical three-dimensional simulated motion platform | |
| CN108648553A (en) | The operating system and method for radiotherapy physics teacher's Training and Learning are used for based on virtual reality | |
| CN109544530B (en) | Method and system for automatically positioning structural feature points of X-ray head radiography measurement image | |
| CN203790448U (en) | Die for head, neck, thorax and abdomen tumor radiotherapy simulation and detection structure | |
| CN204379991U (en) | Human body breathing motion simulation device | |
| CN103861210A (en) | Mold for head, neck, chest and abdomen tumor radiotherapy simulation and detection structure | |
| CN115518247A (en) | A system and method for maintaining regular breathing of tumor radiotherapy patients | |
| CN114849083B (en) | A simulation system and method for human respiratory motion | |
| CN113975662A (en) | Accurate radiotherapy platform of nasopharyngeal darcinoma based on data mining technique | |
| CN117576973A (en) | Virtual simulation teaching system for magnetic resonance equipment structure | |
| CN116612853B (en) | Radiotherapy verification plan dose generation method, system, electronic equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |