CN109374475B - software development method for food rheological property detection system - Google Patents

software development method for food rheological property detection system Download PDF

Info

Publication number
CN109374475B
CN109374475B CN201811183527.7A CN201811183527A CN109374475B CN 109374475 B CN109374475 B CN 109374475B CN 201811183527 A CN201811183527 A CN 201811183527A CN 109374475 B CN109374475 B CN 109374475B
Authority
CN
China
Prior art keywords
food sample
food
module
detected
creep
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811183527.7A
Other languages
Chinese (zh)
Other versions
CN109374475A (en
Inventor
汤修映
徐虎博
胡闰智
方熊琪
董俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Agricultural University
Original Assignee
China Agricultural University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Agricultural University filed Critical China Agricultural University
Publication of CN109374475A publication Critical patent/CN109374475A/en
Application granted granted Critical
Publication of CN109374475B publication Critical patent/CN109374475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N11/00Investigating flow properties of materials, e.g. viscosity, plasticity; Analysing materials by determining flow properties

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Strength Of Materials By Application Of Mechanical Stress (AREA)

Abstract

the invention belongs to the technical field of food detection, and relates to a software development method of a food rheological property detection system, which comprises the following steps: A. establishing basic package of food rheological property detection system software; B. establishing an initial interface program of food rheological property detection system software; C. establishing a software sub-module interface program of the food rheological property detection system; D. and designing a software interface of the food rheological property detection system corresponding to the initial interface program and the sub-module interface program. Interface development is carried out by using c + + language by controlling a laser displacement sensor, an electric proportional valve and an electromagnetic force balance sensor, so that effective human-computer interaction is realized; the development is convenient, and the interface is beautiful and elegant. A Cortex A8 microprocessor and a Linux system are used, and a program is written by multiple threads; drawing by using a qwtPLot drawing part of Qt creator software, and displaying through a window; finally, detection of food rheological properties including creep property, stress relaxation property, transient signal response property and sinusoidal signal response property is realized.

Description

Software development method for food rheological property detection system
Technical Field
the invention belongs to the technical field of food detection, relates to a software development method for a food rheological property detection system, and particularly relates to a software development method for controlling a pneumatic-laser food rheological property detection system.
background
The rheological properties of food products are closely related to their own properties, mainly including viscosity and elasticity, collectively referred to as viscoelastic properties. The viscoelastic property is closely related to the processing property and the storage property of food; therefore, the research on the rheological property of the food has important significance on various links such as food production, processing, storage and the like.
The pneumatic-laser food rheological detection technology has the advantages of high detection precision, non-contact, capability of avoiding cross infection, flexible control and the like, and is widely applied to intraocular pressure detection, varicosity detection and the like in the medical field; exploratory research is also carried out in the field of food quality detection, such as meat freshness, water retention capacity and tenderness detection.
the invention mainly relates to a method for carrying out software control on a food rheological property detection system, which mainly comprises a creep property detection software system, a stress relaxation property detection software system, a transient response property detection module software system and a sine response property software system of food, wherein a response data curve can be displayed in real time in the software system interface, the acquired data is stored through a storage path provided by the software system, and the storage format of a file is csv; the stored file can be opened through Excel and notebook software for further analysis and processing.
The invention mainly aims at a pneumatic-laser detection system used for detecting rheological properties of food, realizes effective control on key components such as a laser displacement sensor, an electric proportional valve, an electromagnetic force balance sensor and the like, simultaneously designs a software operation interface, realizes effective man-machine interaction, and finally realizes effective detection on rheological properties of food, and mainly comprises creep property detection, stress relaxation property detection, transient signal response property detection, sinusoidal signal response property detection and the like.
disclosure of Invention
the method comprises two parts, wherein one part is the writing of a control program, and the writing tool is C + +; and the other part is the design of a software interface. And writing the program codes by using a qt creator platform, and designing the user interface by using a qt designer module under the platform. Briefly described as follows:
the food rheological property detection system software mainly comprises the following sub-modules:
The creep characteristic detection module based on the pneumatic regulation model is characterized in that a user sets a constant pneumatic value, creep duration time (constant pneumatic holding time) and creep recovery time corresponding to a stress value required by creep characteristic detection according to the detection requirement of the rheological characteristic of the food to be researched, displays a time-strain curve in a creep characteristic detection module interface, and provides a path for storing collected data.
And secondly, a creep characteristic detection module based on a lifting experiment table system, wherein a user sets a constant gas value, creep duration time and creep recovery time corresponding to a stress value required by characteristic detection according to the detection requirement of rheological characteristics of the food to be researched, displays a time-strain curve in a creep characteristic detection module interface, and provides a path for storing collected data.
And a stress relaxation characteristic detection module, wherein a user sets a stress relaxation characteristic detection constant strain value, stress relaxation loading time and stress relaxation recovery time according to the detection requirement of the rheological characteristic of the food to be researched, displays a time-pressure curve in a stress relaxation characteristic detection module interface, and provides a path for storing the acquired data.
and fourthly, a sinusoidal signal response characteristic detection module, wherein a user sets a sinusoidal signal period, a sinusoidal signal initial phase angle, an air pressure lower limit (a sinusoidal signal negative amplitude), an air pressure upper limit (a sinusoidal signal positive amplitude) and cycle times according to the detection requirement of the rheological characteristic of the food to be researched. And displaying a time-strain curve in a sinusoidal signal response characteristic detection module interface and providing a path for storing the acquired data.
The specific technical scheme is as follows:
a software development method for a food rheological property detection system comprises the following steps:
A. establishing basic package of food rheological property detection system software;
B. Establishing an initial interface program of food rheological property detection system software;
C. Establishing a software sub-module interface program of the food rheological property detection system;
D. designing a software interface of the food rheological property detection system corresponding to an initial interface program and a sub-module interface program of the food rheological property detection system software;
step A, the basic encapsulation comprises a laser displacement sensor control basic function, an electromagnetic force balance sensor control basic function, a D/A conversion module basic function, a stepping motor movement control basic function and a serial port communication basic function;
The laser displacement sensor controls a basic function to read the position information of the surface of the food sample 4 to be measured through a laser displacement sensor file descriptor;
The electromagnetic force balance sensor controls a basic function to read pressure information of the surface of the food sample 4 to be measured through the file descriptor of the electromagnetic force balance sensor;
the D/A conversion module basic function controls the output voltage of the D/A control conversion module 22 of the electric proportional valve through a D/A control conversion module file descriptor of the electric proportional valve, and further adjusts the adjusting air pressure p of the electric proportional valve;
The stepping motor movement control basis function is used for setting the rotating speed, the steering direction and the movement distance of the stepping motor 2 so as to control the lifting of the lifting platform 9, and comprises a lifting platform lifting module, a lifting platform descending module and a lifting platform accurate movement module;
The lifting platform lifting module is used for continuously lifting the lifting platform 9 until the lifting platform lifting module is stopped or the lifting platform 9 reaches an upper limit position;
The lifting platform descending module is used for continuously descending the lifting platform 9 until the lifting platform descending module is stopped or the lifting platform 9 reaches a lower limit position;
The lifting platform precise moving module is used for continuously lifting the lifting platform 9 to a specified position;
the serial communication basic function comprises a serial communication basic function I and a serial communication basic function II;
the serial port communication basic function is used for setting the baud rate of serial port communication;
The serial communication basic function is used for setting data digits, stop bits and check modes of serial communication;
B, the software initial interface program of the food rheological property detection system is used for entering each sub-module, and comprises a creep property detection module interface, a stress relaxation property detection module interface, a transient signal response property detection module interface and a sinusoidal signal response property detection module interface in the form of the software initial interface of the rheological property detection system;
The specific process for establishing the software initial interface program of the food rheological property detection system comprises the following steps:
B1, starting a software initial interface program of the food rheological property detection system;
b2, initializing an opening device, the device comprising: the electromagnetic force balance sensor 11, the electric proportional valve D/A control conversion module 22 and the laser displacement sensor 18;
B3, setting serial port communication parameters of the equipment in the step B2 through a serial port communication basic function;
b4, by starting the corresponding module interface, hiding the initial interface of the rheological property detection system software, and displaying the corresponding module interface;
the software sub-module of the food rheological characteristic detection system in the step C comprises a creep characteristic detection module, a stress relaxation characteristic detection module, a transient signal response characteristic detection module and a sinusoidal signal response characteristic detection module;
The creep characteristic detection module is used for carrying out creep characteristic detection on the food sample 4 to be detected;
The stress relaxation characteristic detection module is used for detecting the stress relaxation characteristic of the food sample 4 to be detected;
the transient signal responsiveness detection module is used for detecting the transient signal responsiveness of the food sample 4 to be detected;
the sinusoidal signal response characteristic detection module is used for detecting the sinusoidal signal response characteristic of the food sample 4 to be detected;
The software initial interface program of the rheological property detection system is also used for controlling the lifting platform 9 to a special position, and comprises the following steps: a zeroing module and a resetting module;
The zeroing module is used for moving the lifting platform 9 to a working zero point position;
The reset module is used for moving the lifting platform 9 to the homing position.
on the basis of the technical scheme, the creep characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module and an emergency stop module; the height measuring module is used for measuring the height of the food sample 4 to be measured;
the specific flow of the creep characteristic detection module interface program is as follows:
ca1, start creep property detection module;
ca2, measuring the height of the food sample 4 to be measured by using the height measuring module;
ca3, lifting the lifting platform 9 to the working zero position by using the stepping motor movement control basic function;
ca4, setting a constant gas value, creep duration time, creep recovery time and creep cycle number corresponding to a stress value required by creep;
ca5, opening the electromagnetic valve 23, spraying airflow to the surface of the food sample 4 to be measured through the nozzle 12, simultaneously establishing a timer, starting, recording a time sequence, reading the position information of the surface of the food sample 4 to be measured by using the laser displacement sensor to control a basis function, obtaining the distance d between the surface of the food sample 4 to be measured and the air outlet of the nozzle 12, and reading the pressure information of the surface of the food sample 4 to be measured by using the electromagnetic force balance sensor to control the basis function;
Ca6, adjusting the air pressure p by adjusting the electric proportional valve to ensure that the surface of the food sample 4 to be measured reaches a constant air pressure value corresponding to the set stress value required by creep deformation;
Ca7, in the process that the pressure of the surface of the food sample 4 to be detected is kept constant, the food sample 4 to be detected generates a creep behavior, and when the pressure of the surface of the food sample 4 to be detected slightly changes, the electromagnetic force balance sensor controls a basis function to read the pressure information of the surface of the food sample 4 to be detected; obtaining the adjusting air pressure p of the electric proportional valve according to a constant air force value and an air force adjusting model corresponding to the set stress value required by creep deformation;
ca8, adjusting the air pressure p according to the obtained electric proportional valve, and adjusting the air flux of the electric proportional valve 25 to keep the surface of the food sample 4 to be measured as a constant air pressure value;
Ca9, when creep duration is reached, solenoid valve 23 is closed; continuously using the laser displacement sensor to control the basic function to read the position information of the surface of the food sample 4 to be measured;
ca10, when the set creep recovery time is reached, if the creep cycle times are not reached, continuously and circularly performing the steps Ca 5-Ca 9; when the set creep recovery time is reached and the creep cycle number is reached, the creep characteristic detection is finished;
Ca11, and the following steps are carried out while the steps Ca 5-Ca 10 are carried out:
newly building a working thread, starting a new timer, unloading the position information of the surface of the food sample 4 to be tested, which is read by the basic function controlled by the laser displacement sensor, and unloading the time sequence in the step Ca 5;
Obtaining strain information of the food sample 4 to be detected according to the position information of the unloading and the height of the food sample 4 to be detected, and drawing and displaying a time-strain curve according to the unloading time sequence;
and when the creep characteristic detection is not performed any more, closing the creep characteristic detection module by the Ca12, and returning to the initial interface of the food rheological characteristic detection system software.
On the basis of the technical scheme, the creep characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module and an emergency stop module; the height measuring module is used for measuring the height of the food sample 4 to be measured;
the specific flow of the creep characteristic detection module interface program is as follows:
cb1, starting a creep characteristic detection module;
cb2, measuring the height of the food sample 4 to be measured by using the height measuring module;
cb3, lifting the lifting platform 9 to the working zero position by using the stepping motor movement control basic function;
cb4, setting a constant air force value, creep duration time, creep recovery time and creep cycle number corresponding to the stress value required by creep;
Cb5, opening the electromagnetic valve 23, spraying air flow to the surface of the food sample 4 to be measured through the nozzle 12, simultaneously establishing a timer, starting, recording a time sequence, and reading the position information of the surface of the food sample 4 to be measured by using the laser displacement sensor to control a basic function; reading pressure information of the surface of the food sample 4 to be measured by using an electromagnetic force balance sensor to control a basis function;
cb6, adjusting the electric proportional valve to adjust the air pressure p, so that the surface of the food sample 4 to be measured reaches a constant air pressure value corresponding to the set stress value required by creep deformation;
cb7, in the process that the pressure on the surface of the food sample 4 to be detected is kept constant, the food sample 4 to be detected is subjected to creep behavior, when the pressure on the surface of the food sample 4 to be detected is slightly changed, the laser displacement sensor controls a basis function to read position information on the surface of the food sample 4 to be detected, the position information is transmitted to the embedded microprocessor, the embedded microprocessor calculates the pulse number required by the stepping motor driver 16 for driving the lifting platform 9 through the stepping motor 2 and sends the pulse number to the stepping motor driver 16, the lifting platform 9 is controlled to lift through the stepping motor 2, the distance between the surface of the food sample 4 to be detected and the air outlet of the nozzle 12 is kept constant, and the surface of the food sample 4 to be detected is;
Cb8, when creep duration is reached, the solenoid valve 23 is closed; continuously using the laser displacement sensor to control the basic function to read the position information of the surface of the food sample 4 to be measured;
Cb9, when the set creep recovery time is reached, if the creep cycle times are not reached, continuously performing the steps Cb 5-Cb 8 in a circulating manner; when the set creep recovery time is reached and the creep cycle number is reached, the creep characteristic detection is finished;
cb10, performing the steps Cb 5-Cb 9 and simultaneously performing the following steps:
newly building a working thread, starting a new timer, unloading the position information of the surface of the food sample 4 to be tested, which is read by the basic function controlled by the laser displacement sensor, and unloading the time sequence in the step Cb 5;
obtaining strain information of the food sample 4 to be detected according to the position information of the unloading and the height of the food sample 4 to be detected, and drawing and displaying a time-strain curve according to the unloading time sequence;
Cb11, when the creep characteristic detection is not carried out any more, closing the creep characteristic detection module, and returning to the initial interface of the food rheological characteristic detection system software.
on the basis of the technical scheme, the stress relaxation characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module and an emergency stop module; the height measuring module is used for measuring the height of the food sample 4 to be measured;
The specific flow of the stress relaxation characteristic detection module interface program is as follows:
Cc1, start stress relaxation characteristic detection module;
cc2, measuring the height of the food sample 4 to be measured by using the height measuring module;
cc3, lifting the lifting platform 9 to the work zero point position by using the stepping motor movement control basic function;
Cc4, setting stress relaxation characteristics to detect a constant strain value, stress relaxation loading time and stress relaxation recovery time;
Cc5, opening the electromagnetic valve 23, spraying air flow to the surface of the food sample 4 to be measured through the nozzle 12, simultaneously establishing a timer, starting, recording a time sequence, reading the position information of the surface of the food sample 4 to be measured by using the laser displacement sensor to control a basis function, and reading the pressure information of the surface of the food sample 4 to be measured by using the electromagnetic force balance sensor to control the basis function;
cc6, adjusting the air pressure p by adjusting the electric proportional valve, so that the surface of the food sample 4 to be detected reaches the set stress relaxation characteristic detection constant strain value;
cc7, in the process that the strain on the surface of the food sample 4 to be measured is kept constant, the food sample 4 to be measured is subjected to relaxation behavior, when the strain has a small change amount, the laser displacement sensor controls a basis function to read the position information of the surface of the food sample 4 to be measured, the distance d between the surface of the food sample 4 to be measured and the air outlet of the nozzle 12 is obtained, then the pressure information and the air force regulation model of the surface of the food sample 4 to be measured, which are read by the basis function are controlled by the electromagnetic force balance sensor, and the electric proportional valve regulation air pressure p is calculated (if the surface of the food sample 4 to be measured is recovered to the stress relaxation characteristic detection constant strain value, the electric proportional valve regulation;
Cc8, adjusting the air pressure p according to the obtained electric proportional valve, adjusting the air flux of the electric proportional valve 25, and keeping the surface of the food sample 4 to be detected as a stress relaxation characteristic detection constant strain value;
cc9, when the stress relaxation loading time is reached, the electromagnetic valve 23 is closed; continuously using the laser displacement sensor to control the basic function to read the position information of the surface of the food sample 4 to be measured;
cc10, when the set stress relaxation recovery time is reached, the stress relaxation characteristic detection is finished;
cc11, and the following steps are performed along with steps Cc5 to Cc 10:
newly building a working thread, starting a new timer, unloading the pressure information of the surface of the food sample 4 to be tested, which is read by the electromagnetic force balance sensor control basis function, and unloading the time sequence in the step Cc 5; drawing a time-pressure curve according to the dump pressure information and the dump time sequence, and displaying the time-pressure curve;
Cc12, when the stress relaxation characteristic detection is not carried out any more, the stress relaxation characteristic detection module is closed, and the software initial interface of the food rheological characteristic detection system is returned.
On the basis of the technical scheme, the transient signal response characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module, an emergency stop module and a reset module; the height measuring module is used for measuring the height of the food sample 4 to be measured;
The specific flow of the transient signal response characteristic detection module interface program is as follows:
Cd1, a starting transient signal response characteristic detection module;
cd2, measuring the height of the food sample 4 to be measured by using the height measuring module;
Cd3, lifting the lifting platform 9 to a working zero position by using a stepping motor movement control basic function;
cd4, setting an excitation air pressure value, air pressure excitation time, cycle excitation interval time and cycle times;
cd5, opening an electromagnetic valve 23, spraying airflow to the surface of the food sample 4 to be detected through a nozzle 12, simultaneously establishing a timer, starting, recording a time sequence, and reading the position information of the surface of the food sample 4 to be detected by using a laser displacement sensing control basis function;
Cd6, newly building a working thread, starting a new timer, unloading the position information of the surface of the food sample 4 to be detected read by the laser displacement sensor control basis function, and unloading the time sequence in the step Cd 5;
cd7, obtaining strain information of the food sample 4 to be detected according to the position information of the Cd6 unloading and the height of the food sample 4 to be detected, drawing a time-strain curve according to the time sequence of the Cd6 unloading, and displaying the time-strain curve;
cd8, when the set air pressure excitation time is reached and the set cycle number is reached, the transient signal response characteristic detection is finished;
Cd9, when the transient signal response characteristic detection is not carried out any more, closing the transient signal response characteristic detection module, and returning to the initial interface of the food rheological characteristic detection system software.
on the basis of the technical scheme, the interface program of the sine signal response characteristic detection module comprises a stepping motor movement control basic function, a height measurement module, a storage module, an emergency stop module and a reset module; the height measuring module is used for measuring the height of the food sample 4 to be measured;
the specific flow of the sinusoidal signal response characteristic detection module interface program is as follows:
Ce1, start the sinusoidal signal response characteristic detection module;
Ce2, measuring the height of the food sample 4 to be measured using the height measuring module;
Ce3, using the basic function of the movement control of the stepping motor to lift the lifting platform 9 to the position of the working zero point;
Ce4, setting sinusoidal signal parameters, the sinusoidal signal parameters including: the method comprises the following steps of (1) sinusoidal signal period, sinusoidal signal initial phase angle, air pressure lower limit, air pressure upper limit and cycle number;
ce5, opening the electromagnetic valve 23, calculating the angular velocity of the sine signal by the embedded microprocessor according to the sine signal parameter set in the step Ce4, generating the sine signal, applying the sine signal to the electric proportional valve 25 to generate the sine signal airflow, spraying the airflow to the surface of the food sample 4 to be measured through the nozzle 12, simultaneously establishing a timer, starting, recording the time sequence, and reading the position information of the surface of the food sample 4 to be measured by using the laser displacement sensor to control the basis function;
ce6, establishing a new working thread, starting a new timer, unloading the position information of the surface of the food sample 4 to be detected read by the laser displacement sensor control basis function, and unloading the time sequence in the step Ce 5;
ce7, obtaining the strain information of the food sample 4 to be detected according to the position information of the transfer in the step Ce6 and the height of the food sample 4 to be detected, and drawing and displaying a time-strain curve according to the time sequence of the transfer in the step Ce 6;
ce8, when the set number of cycles is reached, the detection of the sinusoidal signal response characteristic is ended;
Ce9, when the sinusoidal signal response characteristic detection is no longer carried out, the sinusoidal signal response characteristic detection module is closed, and the software initial interface of the food rheological characteristic detection system is returned.
on the basis of the technical scheme, the establishment process of the pneumatic adjustment model comprises the following steps:
Briefly described as follows:
The adjusting range of the electric proportional valve for adjusting the air pressure p is between 0.01MPa and 0.3 MPa. The pneumatic (air pressure) value F of the surface of the food sample 4 to be measured is gradually increased along with the increase of the air pressure p regulated by the electric proportional valve generated by the electric proportional valve 25 under the control of the embedded microprocessor, and the pneumatic (air pressure) value F and the air pressure p are in positive correlation. Therefore, the invention firstly constructs the relationship between the air force value F on the surface of the food sample 4 to be detected and the distance D between the surface of the food sample 4 to be detected and the air outlet of the nozzle 12 when the electric proportional valve adjusts the air pressure p at 0.01MPa and 0.3MPa, and then fits a polynomial according to the proportional relationship between the electric proportional valve adjusting air pressure p and the output voltage of the electric proportional valve D/A control conversion module 22.
The specific description is as follows:
Cf1, when the pressure p regulated by the electric proportional valve is 0.01MPa,
Setting different distance values d between the surfaces of a plurality of groups of food samples 4 to be detected and the air outlet of the nozzle 12, and acquiring the pneumatic value F of the surface of the food sample 4 to be detected corresponding to the distance values d under each group of the distance values d;
cf2, performing polynomial fitting on the distance value d and the air force value F in the step Cf1 to form a unitary nonlinear air regulation model with the distance value d as input and the air force value F as output, as shown in formula (1),
F=-0.0559*d*d+5.0196*d+133.2487 (1)
Cf3, when the pressure p regulated by the electric proportional valve is 0.3MPa,
Setting different distance values d between the surfaces of a plurality of groups of food samples 4 to be detected and the air outlet of the nozzle 12, and acquiring the pneumatic value F of the surface of the food sample 4 to be detected corresponding to the distance values d under each group of the distance values d;
cf4, performing polynomial fitting on the distance value d and the air force value F in the step Cf3 to form a unitary nonlinear air regulation model with the distance value d as input and the air force value F as output, as shown in formula (2),
F=-0.0022*d*d+0.1828*d+5.2513 (2)
Cf5, and integrating the steps Cf1-Cf4 to obtain a pneumatic adjustment model with a distance value d and an adjustment pressure p as input and a pneumatic value F as output, as shown in formula (3),
F=(-0.0559*d*d+5.0196*d+133.2487)*(p-0.01)/(0.3-0.01)+(-0.0022*d*d+0.182
8*d+5.2513) (3)
wherein the unit of F is g; d is in mm; the unit of p is MPa;
the determination coefficient (goodness of fit) R of the pneumatic adjustment model20.9992, which is very close to the ideal value 1, illustrates that the regulating air pressure p and the distance d explain the air pressure value F to a very high degree for the air pressure regulating model established above.
On the basis of the technical scheme, the specific procedure of the height measuring module is as follows:
Cg1, start height measurement module;
Cg2, prompt "please remove the food sample to be tested first";
Cg3, removing the food sample 4 to be detected, and confirming;
cg4, the lift table 9 moves to the reset position;
cg5, prompting "please place the food sample to be tested";
cg6, placing a food sample 4 to be tested, and confirming;
cg7, starting the laser displacement sensor 18 to measure the surface position of the food sample 4 to be measured;
cg8, comparing the position of the surface of the food sample 4 to be detected with the reset position of the lifting platform 9;
Cg9, obtaining the height of the food sample 4 to be tested and storing.
the storage module is used for storing a time sequence in the food rheological characteristic detection process and position information of the surface of the food sample 4 to be detected or an air force value of the surface of the food sample 4 to be detected as a csv file, so that further data processing is facilitated;
The sudden stop module is used for stopping the detection of the current food rheological property detection module, and comprises the following specific steps:
ch1, starting an emergency stop module;
Ch2, closing the electromagnetic valve 23;
ch3, finishing the current working thread;
ch4, stop the currently used timer;
ch5, preparing for next food rheological property detection.
on the basis of the technical scheme, the working zero positions are as follows: in the range that the deformation information of the food sample 4 to be detected is effectively acquired by the laser displacement sensor 18 of the food rheological property detection system, the initial distance value between the surface of the food sample 4 to be detected and the air outlet of the nozzle 12 is just before the nozzle 12 sprays air flow; the initial distance value between the surface of the food sample 4 to be detected and the air outlet of the nozzle 12 is 5 mm;
The homing position is as follows: and in the range that the deformation information of the food sample 4 to be detected is effectively acquired by the laser displacement sensor 18 of the food rheological property detection system, the maximum distance value between the surface of the tray and the air outlet of the nozzle 12 is obtained. The maximum distance value facilitates the placement of the food sample 4 to be tested on the tray; the maximum distance of the tray surface from the outlet of the nozzle 12 is 50 mm.
On the basis of the technical scheme, a compiling tool of the food rheological characteristic detection system software is C + +, a qt creator platform is used for compiling program codes, a qt designer module under the qt creator platform is used for designing a user interface, the time-strain curve and the time-pressure curve are drawn by a qwtLot drawing component, the horizontal and vertical coordinate axes of the qwtLot drawing component are set to be automatically zoomed, and the embedded microprocessor takes a Linux system as an operating environment.
the invention has the following beneficial technical effects:
the pneumatic-laser detection system mainly used for detecting the rheological properties of food is used for realizing effective control over key components such as a laser displacement sensor, an electric proportional valve, an electromagnetic force balance sensor and the like, developing a control interface by using a c + + program language, designing a software operation interface and realizing effective interaction of a human machine; has the characteristics of convenient development and beautiful and elegant interface. Meanwhile, a Cortex A8 microprocessor is used, a Linux system is used as an operating environment, and compared with a single chip microcomputer, the multi-thread control program can be flexibly written; when a curve is drawn, a qwtPLot drawing component based on Qt creator software is used, and data can be well displayed through a display window; and finally, the rheological characteristics of the food are effectively detected, and the detection mainly comprises creep characteristic detection, stress relaxation characteristic detection, transient signal response characteristic detection, sinusoidal signal response characteristic detection and the like.
drawings
the invention has the following drawings:
FIG. 1 is a schematic view of the software development process of a food rheological property detection system
FIG. 2 is a schematic view of the software initial interface of the food rheological property detection system
FIG. 3 is a schematic view of a creep characteristic detection module interface
FIG. 4 is a schematic diagram of a development process of a creep characteristic detection module
FIG. 5 is a schematic view of an interface of a stress relaxation testing module
FIG. 6 is a schematic diagram of a development process of a stress relaxation behavior detection module
FIG. 7 is a schematic view of a transient signal response characteristic detection module interface
FIG. 8 is a schematic diagram of a sinusoidal signal response characteristic detection module interface
FIG. 9 is a schematic view of the left side of the food rheological property detection system
FIG. 10 is a schematic view of the right side of the food rheological property detection system
reference numerals: the device comprises a ground foot 1, a stepping motor 2, a motor dustproof protective cover 3, a food sample to be detected 4, a pressure stabilizing valve 5, a pressure gauge 6, a two-stage air filter 7, a power switch 8, a lifting table 9, a horizontal moving slide rail 10, an electromagnetic force balance sensor 11, a nozzle 12, an air chamber 13, a window 14, an embedded all-in-one machine 15, a stepping motor driver 16, a switching power supply 17, a laser displacement sensor 18, a pendant plate 19, a laser signal amplifier 21L-shaped connecting piece, an electrical proportional valve D/A control conversion module 22, an electromagnetic valve 23, a laser displacement sensor signal conversion module 24 and an electrical proportional valve 25
Detailed Description
the main content of the invention comprises: packaging basic types of food rheological property detection system software and compiling a software interface program of the food rheological property detection system. The invention is described in detail below with reference to the figures and specific embodiments. Fig. 1 shows a schematic diagram of a software development process of a food rheological property detection system, and a specific development example is as follows:
First, food rheological property detection system software basic encapsulation
The basic packaging of the food rheological property detection system software comprises basic function packaging, static global variables and a static global method.
1. Basis function encapsulation
The main basic functions related to the invention are encapsulated in a mylib2.h header file, and comprise: the device comprises a serial port communication basic function, a D/A conversion module basic function, an electromagnetic force balance sensor signal reading basic function, a laser displacement sensor reading position information basic function and a stepping motor movement control basic function. The serial communication basic function comprises a serial communication basic function I and a serial communication basic function II; the first serial port communication basic function is void my _ set _ speed (int fd, speed), wherein fd is an open file descriptor, and speed is a baud rate; the second serial communication basic function is a serial data bit, a stop bit and a check mode basic function int my _ set _ Parity (int fd, int data, int stopbits, int Parity), wherein fd is an open file descriptor; the data bits are data digits and take the value of 7 or 8; stopbits is a stop bit, and the value is 1 or 2; parity is a verification mode, values are 'n', 'o' or 'e', 'n' is not verified, 'o' is odd verification, and 'e' is even verification; because the electric proportional valve 25 is controlled by analog quantity voltage, the Cortex A8 microprocessor in the invention controls the electric proportional valve D/A control conversion module 22 to perform analog quantity conversion on digital quantity, so as to realize the control of the electric proportional valve 25, and adopts the D/A conversion module basic function, including a check code generation basic function, a generation control electric proportional valve D/A control conversion module output voltage basic function and an electric proportional valve D/A control conversion module output voltage setting basic function.
The electric proportional valve D/A control conversion module 22 uses the check code of the model bus statement to generate a basic function signaled int CRC16 for error checking and verification of data communication, so as to ensure the correctness and integrity of data transmission. (signed char. pupmsg, signed int datatimeseries), where the pupmsg is the string pointer needed to generate the check code, and usDataTimeSeries is the string length. And generating an output voltage basis function of the control electric proportional valve D/A control conversion module as an unknown channel DAstr (int channel, int v), wherein the channel is an output channel of the control electric proportional valve D/A control conversion module, and v is an output voltage of the control electric proportional valve D/A control conversion module. The electric proportional valve D/a controls the conversion module to output a voltage setting basis function int setDA (int fd, int channel, int v).
and f, fd is a file descriptor used by the D/A control conversion module of the electric proportional valve, channel is an output channel for controlling the D/A control conversion module of the electric proportional valve, and v is an output voltage for controlling the D/A control conversion module of the electric proportional valve.
The electromagnetic force balance sensor signal reading basis function is float getForce (int fd),
Wherein fd is a file descriptor used by the electromagnetic force balance sensor.
the basic function of reading position information by the laser displacement sensor is float getDis (int fd),
wherein fd is a file descriptor used by the laser displacement sensor.
the basic function of the stepping motor movement control is void mover (int freq, int dir, int i),
wherein freq is the signal emission frequency and determines the rotating speed of the stepping motor 2; dir is the direction of the stepping motor 2, and takes a value of '0' or '1', wherein '0' is used for enabling the lifting platform 9 to move upwards, and '1' is used for enabling the lifting platform 9 to move downwards; i is the number of pulses to be generated, and determines the amount of movement of the stepping motor 2.
2. static global variables
and defining a global class of static global variables and a global method for controlling the food rheological property detection system, wherein the global variables comprise static int laser, static int adda and static intebalance.
Wherein, the 'laser' is a file descriptor for opening the laser displacement sensor through a serial port; the ada is a file descriptor for opening the laser displacement sensor signal conversion module through the serial port, and the balance is a file descriptor for opening the electromagnetic force balance sensor through the serial port.
3. static global method
the static global method mainly comprises the following steps: the method for controlling the lifting platform 9 to move to the assigned position of dis mm from the air outlet of the nozzle 12 on the surface of the food sample 4 to be detected comprises the following steps: static void moveTo (float dis);
the method for controlling the homing of the lifting platform 9 comprises the following steps: static void reset () moving the lift table 9 to a position 50mm from the exit of the nozzle 12 on the surface of the tray;
and a method for controlling the lifting platform 9 to move to the working zero point: static void zero () defined as the position of the surface of the food sample 4 to be measured 5mm away from the outlet of the nozzle 12.
second, design of software initial interface of food rheological property detection system
After the food rheological property detection system provided by the invention is powered on and started up, the initial interface of the food rheological property detection system software is displayed in the data graph display area of the embedded all-in-one machine 15, as shown in fig. 2. When the interface is initialized, the opening of various devices including the electromagnetic force balance sensor 11, the electric proportional valve D/A control conversion module 22 and the laser displacement sensor 18 is initialized at the same time. Meanwhile, establishing global reference of the three equipment objects, and setting respective serial port communication parameters of the equipment.
in the software, the sub-module interface is realized in the form of a button, the target name of the "creep characteristic detection" button is "creebutton", the target name of the "stress relaxation characteristic detection" button is "RelaxButton", the target name of the "transient signal response characteristic detection" button is "transitionbutton", the target name of the "sinusoidal signal response characteristic detection" button is "SineButton", the target name of the "zero" button of the lift platform 9 is "zerobuton", the target name of the "reset" button of the lift platform 9 is "ResetButton", the buttons all use click signals, after the corresponding buttons are pressed, the corresponding sub-modules are started, and the corresponding slot functions are:
void on_CreepButton_clicked();void on_RelaxButton_clicked();
void on_TransientButton_clicked();void on_SineButton_clicked();
void on_zeroButton_clicked();void on_resetButton_clicked();
Taking an interface entering a creep characteristic detection module as an example, setting an initial interface of food rheological characteristic detection system software as a parent window by using a setFakeParent method; maximizing a creep characteristic detection module interface window by using a setWindowState method; the window title of the creep characteristic detection module interface is set to be 'creep characteristic detection …' by using the setWindowTitle method. And finally, after the creep characteristic detection module interface window attribute is set, displaying the creep characteristic detection module interface by using a show method, and calling a main window hide method to hide the initial interface of the food rheological characteristic detection system software.
Third, design of software sub-module interface of food rheological property detection system
s1 creep property detection module interface design
the creep characteristic detection module is a window instantiated by a defined crop class, the crop class is inherited from a QWIdget class, the interface is schematically shown in FIG. 3, the development process is schematically shown in FIG. 4, and the specific development method is as follows:
1. public variable
float prediction; the presure variable is used to define a constant gas force value corresponding to the stress value required for creep.
int creattime; the creattime variable is used to define the creep duration.
int relaxtime; the relaxtime variable is used to define the creep recovery time.
int cycle; the cycle variable is used to define the number of creep cycles.
int count; and the count variable is used for defining the number of creep characteristic detection data acquisition.
float height; the height variable is used to define the height of the food sample 4 to be tested.
double times series; the timeSeries variable is used to define a time series in the creep characteristic detection process.
double disSeries; the disSeries variable is used for defining the position information of the surface of the food sample 4 to be detected read by the laser displacement sensor control basis function in the creep characteristic detection process.
double force series; the forceSeries variable is used for defining the pressure information of the surface of the food sample 4 to be detected, which is read by the control basis function of the electromagnetic force balance sensor in the creep characteristic detection process.
int timer; the timer is a timer handle.
int&balance;int&laser;int&adda;
balance, laser, and adda are three static global reference variables, respectively.
2. private variables:
QWidget fakeparent; and the initial interface of the food rheological property detection system software is opened after the creep property detection module interface is closed.
QwtLotCurve:curve; curve is a drawing pointer of two arrays of time variable and strain variable, and after a qwtPlot drawing part in an interface is associated, the qwtPlot drawing part is operated to draw.
pthread _ t work; identifiers for distinguishing different worker threads.
3. the public method comprises the following steps:
explicit street (int & adda, int & balance, int & laser, QWidget parent ═ 0); during construction, the x-axis and y-axis attributes of a qwtPLot drawing component are set to be automatically scaled, so that the x-axis and y-axis can be automatically adjusted to display the shape of the whole curve after exceeding the currently displayed coordinate range in the process of continuously drawing the curve, so that the good visualization requirement is met, and a user can conveniently observe the drawn curve better.
float model (float force, float dis); and defining a pneumatic adjustment model for controlling a constant air force value in a creep process, controlling the electric proportional valve 25 through the function when the food sample 4 to be detected is positioned at any position in a detection range of the food rheological property detection system, so that the air force borne by the surface of the food sample 4 to be detected is the constant air force value, the parameter force is the air pressure p regulated by the electric proportional valve, and dis is the distance d between the compression surface of the food sample 4 to be detected and the air outlet of the nozzle 12.
setFakeParent (QWidget fparent); the fakeparent value is set as a parameter fparent by the method, and the method is used for closing the initial interface window of the food rheological property detection system software and opening the creep property detection module window.
void enableButton (); for restoring the ok button to the available state.
static void and creepthread (void and ptr); the method is the core of a creep characteristic detection module, and realizes the calling and conversion of each parameter of a creep characteristic detection module interface by adopting a static method and using a multithreading pointer ptr.
4. private method
void closed event (qcloseeevent element); and restoring the visibility of the initial interface of the software of the food rheological property detection system when the interface window of the creep property detection module is closed.
5 slot function
void on _ start _ clicked (); method triggered when the "ok" button is clicked. It is first checked whether the height of the food sample 4 to be measured is measured, and if not, no subsequent command will be executed. If it has been measured, the height of the food sample 4 to be measured is saved to the corresponding variable and the "ok" button is set as unavailable. And allocating the lengths of the time series, the disSeries and the forceSeries arrays according to the set creep duration, the creep recovery time and the creep cycle number. Then, curve and qwtPlot drawing components are connected. At this time, since the getDis and getForce functions both use the usleep function, the program will stop responding. To avoid this, a new worker thread is created and implemented by calling the greepthread method. Starting a thread, starting a new timer, adding experimental data to time series, disSeries and forceSeries in the thread, reading the experimental data in the new timer, and drawing.
void on _ stop _ clicked (); triggering of the "scram" button. This method is mainly used to stop the current rheological property detection. The specific execution process comprises the following steps: the solenoid valve 23 is closed, then the working thread is ended, the timer is stopped, and finally the 'start' button becomes available, which facilitates the next rheological property detection.
void on _ save _ clicked (); the "save" button toggles. The method saves experimental data results in timeSeries, disSeries and forceSeries as csv files for the user to process next.
void on_Move_clicked();
void on_Up_clicked();
void on_Down_clicked();
these three methods are used to control the position of the lift table 9. on _ Move _ clicked is a trigger for a "Move to" button that can be moved exactly to the location entered in the text box that follows. on _ Up _ clicked and on _ Down _ clicked are the triggers of the "Up" button and the "Down" button, respectively. Wherein, the lifting platform 9 rises or falls at the frequency of 20KHz, and 10 pulse numbers are triggered instantly. The "up" button and the "down" button have an auto-repeat property, and thus, when pressed, will automatically rise (fall) until the limit switch is released or triggered.
void on _ measure _ clicked (); "height measurement" measures the method of button triggering. After the food sample is pressed down, a prompt box is popped up to prompt that 'please remove the food sample to be detected firstly', after the click determination, the lifting platform 9 is moved to the reset position, namely, the maximum distance between the surface of the tray and the air outlet of the nozzle 12 is 50mm, and the prompt box is popped up to prompt that 'please place the food sample to be detected'. After the food sample 4 to be measured is placed, clicking to determine, automatically measuring the surface position of the food sample 4 to be measured, comparing the surface position with the reset position to obtain the height of the food sample 4 to be measured, storing the height into the height member variable, and finally prompting that the height measurement is completed.
S2 stress relaxation characteristic detection module interface design
the stress relaxation characteristic detection module is a window instantiated by a defined relax class, the relax class is inherited from a QWIdget class, the interface schematic is shown in FIG. 5, the development process schematic is shown in FIG. 6, and the specific development method is as follows:
1. the public variables are:
float strain; the constant strain value is used for storing the stress relaxation characteristic generated by the pressure of the food sample 4 to be detected, and the value is generally 0-0.5.
float targetDis; and defining the distance value d between the surface of the food sample 4 to be detected and the air outlet of the nozzle 12 when the surface of the food sample 4 to be detected is kept as the stress relaxation characteristic detection constant strain value.
int keeptime; the keeptime variable is used to save the set stress relaxation loading time.
int relaxtime; the relaxtime variable is used to save the set stress relaxation recovery time.
int count; and the count variable is used for metering the acquisition number of the stress relaxation characteristic detection data.
float height; the height variable is used to preserve the height of the food sample 4 to be tested.
double times series; the timeSeries variable is used to define a time series in the stress relaxation behavior detection process.
double disSeries; the disSeries variable is used for defining the position information of the surface of the food sample 4 to be detected, which is read by the laser displacement sensor control basis function in the stress relaxation characteristic detection process.
double force series; the forceSeries variable is used for defining the pressure information of the surface of the food sample 4 to be detected, which is read by the control basis function of the electromagnetic force balance sensor in the stress relaxation characteristic detection process.
int timer; the timer is a timer handle.
int&balance;int&laser;int&adda;
balance, laser, and adda are three static global reference variables, respectively.
2. private variables:
QWidget fakeparent; and the initial interface of the software of the food rheological property detection system is opened after the stress relaxation property detection module interface is closed.
QwtLotCurve:curve; curve is a drawing pointer of two arrays of time variable and pressure variable, and after a qwtPlot drawing component in an interface is associated, the qwtPlot drawing component is operated to draw.
pthread _ t work; identifiers for distinguishing different worker threads.
3. the public method comprises the following steps:
explicit relay (int & adda, int & balance, int & laser, QWidget parent ═ 0); in the method for constructing the stress relaxation characteristic detection module window, the x-axis attribute and the y-axis attribute of a qwtplotlot drawing component are set to be automatically scaled during construction.
float model (float dis, float v); and defining a pneumatic adjustment model for controlling constant strain in the stress relaxation process, controlling the electric proportional valve 25 according to the function when the food sample 4 to be detected is positioned at any position in the detection range of the food rheological property detection system, so as to realize that the surface of the food sample 4 to be detected is a constant strain value, the parameter dis is the distance D between the compression surface of the food sample 4 to be detected and the air outlet of the nozzle 12, and v is the output voltage of the electric proportional valve D/A control conversion module 22.
forceint setFakeParent (QWidget fparent); the fakeparent value is set as a parameter fparent by the method, and the method is used for closing the initial interface window of the software of the food rheological property detection system and opening the stress relaxation property detection module window.
void enableButton (); for restoring the ok button to the available state.
static void remaxthread (void ptr); this is a static method, which is also the core method of the stress relaxation characteristic detection module. Similar to the function of a greepthread method in the creep characteristic detection module, the multithreading pointer ptr is used for calling and converting parameters of the stress relaxation characteristic detection module interface.
After the reference of the laser displacement sensor 18 and the electromagnetic force balance sensor 11 is set, the following process is performed: setting stress relaxation characteristics to detect a constant strain value, then opening the electromagnetic valve 23, closing the electromagnetic valve 23 after reaching the set stress relaxation loading time, keeping the set stress relaxation recovery time, and storing data in variables such as timeSeries, disSeries and forceSeries.
4. private method
void closed event (qcloseeevent element); the method is used for restoring the visibility of the initial interface of the software of the food rheological property detection system when the interface window of the stress relaxation property detection module is closed.
5. Slot function
void on _ start _ clicked (); clicking the "ok" button triggers the stress relaxation behavior detection module routine. The specific working process is that whether the height of the food sample 4 to be measured is measured or not is detected, if not, the subsequent command is not executed, and if the height of the food sample 4 to be measured is measured, the height of the food sample 4 to be measured is stored to a corresponding variable. And distributing the lengths of the time series, the disSeries and the forceSeries arrays according to the set stress relaxation loading time and the stress relaxation recovery time. Then, curve and qwtPlot drawing components are connected. At this time, since the getDis and getForce functions both use the usleep function, the program will stop responding. To avoid this, a new worker thread is created and the relaxthread method is invoked to implement. Starting a thread, starting a new timer, adding experimental data to timeSeries, disSeries and forceSeries in the thread, reading the experimental data in the new timer, and drawing.
void on _ stop _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
void on _ save _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
void on_Move_clicked();
void on_Up_clicked();
void on_Down_clicked();
the three methods respectively have the same function as the slot function with the same name in the creep characteristic detection module interface design.
void on _ measure _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
s3, transient signal response characteristic detection module
The transient signal response characteristic detection module is a window instantiated by a transient class, the transient class inherits from the QWIdget class, and the interface is schematically shown in FIG. 7. The following variables and methods apply:
1. the public variables are:
int presure; the air pressure value is excited.
int hittime; and (4) air pressure excitation time.
int interval; if the excitation is the cyclic excitation, the interval time of each excitation is the cyclic excitation interval time.
int cycle; the number of cycles.
int count; and the count variable is used for metering the data acquisition number.
double times series; the timeSeries variable is used to define the time series in the transient signal response characteristic detection process.
double disSeries; the disSeries variable is used for defining the position information of the surface of the food sample 4 to be detected, which is read by the laser displacement sensor control basis function in the transient signal response characteristic detection process.
double force series; the forceSeries variable is used for defining pressure information of the surface of the food sample 4 to be detected, which is read by the electromagnetic force balance sensor control basis function in the transient signal response characteristic detection process.
int timer; the timer is a timer handle.
int&balance;int&laser;int&adda;
balance, laser, and adda are three static global reference variables, respectively.
2. Private variables
QWidget fakeparent; and the initial interface of the software of the food rheological characteristic detection system is opened after the interface of the transient signal response characteristic detection module is closed.
QwtLotCurve:curve; curve is a drawing pointer of two arrays of time variable and strain variable, and after a qwtPlot drawing part in an interface is associated, the qwtPlot drawing part is operated to draw.
pthread _ t work; identifiers for distinguishing different worker threads.
3. The public method comprises the following steps:
An explicit flash (int & adda, int & balance, int & laser, QWidget parent ═ 0); a method of constructing a module window for transient signal response characteristics detection. The horizontal and vertical axis property of the qwtPlot drawing component is set to auto zoom at the time of construction.
float model (float dis, float v); and the pneumatic adjustment model controls the pneumatic value of the surface of the food sample 4 to be detected at different distances D from the air outlet of the nozzle 12 under the output voltage of different electric proportional valve D/A control conversion modules 22, dis is the distance D between the compression surface of the food sample 4 to be detected and the air outlet of the nozzle 12, and v is the output voltage of the electric proportional valve D/A control conversion module 22.
int setFakeParent (QWidget × fparent); the fakeparent value is set as a parameter fparent by the method, and the method is used for closing the initial interface window of the software of the food rheological property detection system and opening the transient signal response property detection module window.
void enableButton (); for restoring the ok button to the available state.
static void transitienthread (void ptr); this is a static method and is also a core method of the transient signal response characteristic detection module. Similar to the action of a greepthread method in the creep characteristic detection module, the multithreading pointer ptr is used for calling and converting parameters of the transient signal response characteristic detection module interface.
after the reference of the laser displacement sensor 18 and the electromagnetic force balance sensor 11 is set, the following process is performed: setting an excitation air pressure value, then opening the electromagnetic valve 23, closing the electromagnetic valve 23 after reaching the set air pressure excitation time, stopping the set cyclic excitation interval time, and executing the process for the set cyclic times. And all data is saved in timeSeries, disSeries, forceSeries, etc. variables.
4. The private method comprises the following steps:
void closed event (qcloseeevent element); and the system is used for restoring the visibility of the software initial interface of the food rheological property detection system when the transient signal response property detection module interface is closed.
5. slot function
void on _ start _ clicked (); method triggered when the "ok" button is clicked. The "ok" button is first set as unavailable and it is then checked whether the height of the food sample 4 to be measured has been measured, if not no subsequent command will be executed, and if measured, the height of the food sample 4 to be measured is saved to the corresponding variable. And allocating the length of the time series, disSeries and forceSeries arrays according to the set air pressure excitation time, the cycle excitation interval and the cycle times, and then connecting the current and qwtPlot drawing components, wherein the program stop response is caused because the getDis function and the getForce function both use the usleep function. To avoid this, a new work thread is created and the transitienthread method is invoked for implementation. Starting a thread, starting a new timer, adding experimental data in the thread to the three arrays of time series, disSeries and forceSeries, reading the experimental data in the new timer, and drawing.
void on _ stop _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
void on _ save _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
void on_Move_clicked();
void on_Up_clicked();
void on_Down_clicked();
The three methods respectively have the same function as the slot function with the same name in the creep characteristic detection module interface design.
void on _ measure _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
s4. detection module for sinusoidal signal response characteristics
the sinusoidal signal response characteristic detection module is a window instantiated by a sine class, which inherits from the QWIdget class, the interface schematic is shown in FIG. 8. The following variables and methods apply:
1. the public variables are:
float period; defining a sinusoidal signal period.
flow w; defining the sinusoidal signal angular velocity.
nt maxP; defining the upper limit of the air pressure.
int minP; defining the lower limit of the air pressure
int cycle; the number of cycles is defined.
int count; and the count variable is used for metering the data acquisition number.
double times series; the timeSeries variable is used to define the time series in the sinusoidal signal response characteristic detection process.
double disSeries; the disSeries variable is used for defining the position information of the surface of the food sample 4 to be detected read by the laser displacement sensor control basis function in the sine signal response characteristic detection process.
double force series; the forceSeries variable is used for defining pressure information of the surface of the food sample 4 to be detected, which is read by the electromagnetic force balance sensor control basis function in the sinusoidal signal response characteristic detection process.
int timer; the timer is a timer handle.
int&balance;int&laser;int&adda;
balance, laser, and adda are three static global reference variables, respectively.
2. Private variables:
QWidget fakeparent; and the method is used for memorizing, and opening the initial interface of the software of the food rheological property detection system after closing the interface of the sinusoidal signal response property detection module.
QwtLotCurve:curve; curve is a drawing pointer of two arrays of time variable and strain variable, and after a qwtPlot drawing part in an interface is associated, the qwtPlot drawing part is operated to draw.
pthread _ t work; identifiers for distinguishing different worker threads.
3. public method
An explicit sine (int & adda, int & balance, int & laser, QWidget parent ═ 0); the method for defining the construction of the window of the sine signal response characteristic detection module sets the horizontal and vertical coordinate attributes of the qwtPlot drawing component to be automatically scaled during construction.
float model (float dis, float v); the method has the same function as a common method with the same name in the design of the transient signal response characteristic detection module interface.
int setFakeParent (QWidget × fparent); the fakeparent value is set as a parameter fparent by the method, and the method is used for closing the initial interface window of the software of the food rheological property detection system and opening the sine signal response property detection module window.
void enableButton (); for restoring the ok button to the available state.
static void si nethread (void ptr); this is a static method and is also a core method of the sinusoidal signal response characteristic detection module. Similar to the action of a greepthread method in the creep characteristic detection module, the multithreading pointer ptr is used for calling and converting parameters of the transient signal response characteristic detection module interface.
After the reference of the laser displacement sensor 18 and the electromagnetic force balance sensor 11 is set, the following process is performed: and setting a signal acquisition time zero point, acquiring the current time after the work is started, calculating the interval between the current time and the time zero point, calculating the voltage value to be reached at the moment according to a sine function, adjusting the voltage value, and executing according to the set cycle number. And all data are saved in variables such as timeSeries, disSeries, forceSeries, etc.
4. private method
void closed event (qcloseeevent element); and the system is used for restoring the visibility of the software initial interface of the food rheological property detection system when the sinusoidal signal response property detection module interface is closed.
5. Slot function
void on _ start _ clicked (); method triggered when the "ok" button is clicked. The "OK" button is first set to be unavailable, then the length of the time series, disSeries, forceSeries array is assigned according to the set period and cycle number of the sine signal, and then the current and qwtPLot plotting components are connected, one step more than the previous sub-modules, because the angular velocity is actually used in the sine function rather than the period, so the period is converted into the angular velocity. Because the getDis function and the getForce function both use the usleep function, the program stops responding, and in order to avoid the situation, a working thread is newly built and a sinethread method is called to realize the function. Starting a thread, starting a new timer, adding experimental data in the thread to the three arrays of time series, disSeries and forceSeries, reading the experimental data in the new timer, and drawing.
void on _ stop _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
void on _ save _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
void on_Move_clicked();
void on_Up_clicked();
void on_Down_clicked();
The three methods respectively have the same function as the slot function with the same name in the creep characteristic detection module interface design.
void on _ measure _ clicked (); the method has the same function as a slot function with the same name in the creep characteristic detection module interface design.
as shown in fig. 9 and 10, a food rheological property detection system includes a machine body, a lifting experiment table system, a pneumatic generation system, a deformation detection system, a stress sensing system, and a control and information processing system, wherein the lifting experiment table system, the deformation detection system, the stress sensing system, and the control and information processing system are mounted on the machine body; the lifting experiment table system comprises a stepping motor 2, a lifting table 9, a horizontal moving slide rail 10 and a stepping motor driver 16; the stepping motor driver 16 is connected with the stepping motor 2 and used for driving the stepping motor 2; the stepping motor 2 is connected with the lifting platform 9 and is used for controlling the lifting of the lifting platform 9; the horizontal moving slide rail 10 is positioned above the lifting platform 9, is connected with the lifting platform 9, is used for horizontal movement, and is lifted along with the lifting platform 9; the machine body is provided with a limit switch for limiting the lifting platform 9 to lift between an upper limit position and a lower limit position, and when the lifting platform 9 lifts, the limit switch is touched, and the lifting platform 9 stops lifting. The pneumatic generation system comprises an air compressor, a pressure stabilizing valve 5, a two-stage air filter 7, an electromagnetic valve 23, an electric proportional valve 24 and an air chamber 13; the pressure stabilizing valve 5, the two-stage air filter 7, the electromagnetic valve 23, the electric proportional valve 24 and the air chamber 13 are arranged on the upper part of the machine body; the air compressor is connected with a pressure stabilizing valve 5, the pressure stabilizing valve 5 is connected with a two-stage air filter 7, the two-stage air filter 7 is connected with an electric proportional valve 24, the electric proportional valve 24 is connected with an electromagnetic valve 23, and the electromagnetic valve 23 is connected with an air chamber 13;
The pressure stabilizing valve 5 comprises a pressure stabilizing valve body and a pressure gauge 6; the air chamber 13 comprises a window 14, an air chamber main body and a nozzle 12 from top to bottom in sequence, the window 14 is positioned right above the nozzle 12, and the window and the nozzle 12 are made of quartz stone; the deformation detection system comprises a laser displacement sensor 18, a laser signal amplifier 21 and a laser displacement sensor signal conversion module 24; the laser displacement sensor 18 is positioned right above the air chamber 13 and connected with the laser signal amplifier 21, the laser signal amplifier 21 is connected with the laser displacement sensor signal conversion module 24, the laser displacement sensor 18 is used for collecting deformation information of the food sample 4 to be detected in real time (the laser displacement sensor controls a basis function to read position information of the surface of the food sample 4 to be detected), and an incident light path of the laser displacement sensor 18 is coaxial with the nozzle 12 for ejecting air flow; the stress sensing system includes an electromagnetic force balance sensor 11;
the electromagnetic force balance sensor 11 is mounted above the horizontal moving slide rail 10 and used for acquiring pressure information of ejected airflow on the surface of a food sample 4 to be measured in a surface sensing mode in real time (the electromagnetic force balance sensor controls a basis function to read the pressure information on the surface of the food sample 4 to be measured), a tray is arranged on the electromagnetic force balance sensor 11 and used for placing the food sample 4 to be measured, the food sample 4 to be measured is located below the nozzle 12, and the measurement precision of the electromagnetic force balance sensor 11 is not lower than 0.01N; the control and information processing system comprises an embedded microprocessor, an embedded all-in-one machine 15 and an electric proportional valve D/A control conversion module 22; the embedded microprocessor is a Cortex A8 microprocessor; the cortex xA8 microprocessor is in communication connection with the laser displacement sensor signal conversion module 24 through a serial port; the Cortex A8 microprocessor is connected with the stepping motor driver 16 and controls the lifting of the lifting platform 9 through the stepping motor driver 16 and the stepping motor 2 in sequence; the Cortex A8 microprocessor is connected with the electromagnetic valve 23 and is used for controlling the on-off of the electromagnetic valve 23; the Cortex A8 microprocessor is connected with the electromagnetic force balance sensor 11 and is used for receiving pressure information acquired by the electromagnetic force balance sensor 11 in real time; the Cortex A8 microprocessor is connected with the electric proportional valve D/A control conversion module 22, and controls the voltage of the electric proportional valve 24 through the electric proportional valve D/A control conversion module 22, so as to control the air flux of the electric proportional valve 24; the embedded all-in-one machine 15 is connected with a Cortex A8 microprocessor and is provided with a command execution key and a data graphic display area; the Cortex A8 microprocessor is used for storing and processing the received information, displaying the processed information in a data graph display area, receiving control command information of a command execution key and controlling the electromagnetic valve 23, the electric proportional valve 24 and the stepping motor driver 16; the data graph display area is displayed in a touch screen mode, and the food rheological property detection system is controlled through corresponding buttons on the touch screen. The maximum working pressure of the air compressor is 0.7 MPa; the electric proportional valve 24 is provided with a pressure gauge for monitoring and displaying the pressure value of air entering the electric proportional valve 24; the control voltage of the electric proportional valve 24 is changed in a range of 0-5V, when the voltage is changed from 0V to 5V, the air flux of the electric proportional valve 24 is gradually increased, so that the air pressure flowing out of the electric proportional valve 24 is gradually increased from zero to 0.5 MPa; the serial port communication adopts RS232 serial port transmission; the material of the window 14 and the nozzle 12 is quartz with the transmittance not lower than 80%; the machine body comprises a top plate, side plates and a bottom plate; the top plate and the side plates are connected with each other through an L-shaped connecting piece 20 and a screw, and the side plates and the bottom plate are connected with each other through the L-shaped connecting piece 20 and the screw; four corners of the bottom of the machine body are respectively provided with a ground foot 1, and the front end of the lower part of the machine body is provided with a power switch 8 for starting the food rheological property detection system; a switch power supply 17 is arranged on a side plate of the machine body and used for reducing the 220v illumination voltage to 24v and supplying power to a food rheological property detection system; the electromagnetic valve 23, the electric proportional valve 24, the laser displacement sensor 18, the laser signal amplifier 21, the laser displacement sensor signal conversion module 24 and the electric proportional valve D/A control conversion module 22 are positioned below the top plate and are fixedly connected with the L-shaped connecting piece 20 through the hanging plate 19; the L-shaped connecting piece is fixedly connected with the machine body through a screw; the outside of elevating platform driving motor 2 is equipped with motor dustproof protection cover 3.
The above embodiments are only for illustrating the invention and are not to be construed as limiting the invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention, therefore, all equivalent technical solutions also fall into the scope of the invention, and the scope of the invention is defined by the claims.
Those not described in detail in this specification are within the knowledge of those skilled in the art.

Claims (8)

1. A software development method for a food rheological property detection system is characterized by comprising the following steps:
A. establishing basic package of food rheological property detection system software;
B. establishing an initial interface program of food rheological property detection system software;
C. establishing a software sub-module interface program of the food rheological property detection system;
D. Designing a software interface of the food rheological property detection system corresponding to an initial interface program and a sub-module interface program of the food rheological property detection system software;
step A, the basic encapsulation comprises a laser displacement sensor control basic function, an electromagnetic force balance sensor control basic function, a D/A conversion module basic function, a stepping motor movement control basic function and a serial port communication basic function;
the laser displacement sensor controls a basic function to read the position information of the surface of the food sample (4) to be detected through a laser displacement sensor file descriptor;
The electromagnetic force balance sensor controls a basic function to read pressure information of the surface of the food sample (4) to be detected through the file descriptor of the electromagnetic force balance sensor;
the D/A conversion module basic function controls the output voltage of an electric proportional valve D/A control conversion module (22) through an electric proportional valve D/A control conversion module file descriptor, and further adjusts the adjusting air pressure p of the electric proportional valve;
The stepping motor movement control basis function is used for setting the rotating speed, the steering direction and the movement distance of the stepping motor (2) so as to control the lifting of the lifting platform (9), and comprises a lifting platform lifting module, a lifting platform descending module and a lifting platform accurate movement module;
the lifting platform lifting module is used for continuously lifting the lifting platform (9) until the lifting platform lifting module is stopped or the lifting platform (9) reaches an upper limit position;
The lifting platform descending module is used for continuously descending the lifting platform (9) until the lifting platform descending module is stopped or the lifting platform (9) reaches a lower limit position;
the lifting platform precise moving module is used for continuously lifting the lifting platform (9) to a specified position;
the serial communication basic function comprises a serial communication basic function I and a serial communication basic function II;
The serial port communication basic function is used for setting the baud rate of serial port communication;
the serial communication basic function is used for setting data digits, stop bits and check modes of serial communication;
B, the software initial interface program of the food rheological property detection system is used for entering each submodule and comprises a creep property detection module interface, a stress relaxation property detection module interface, a transient signal response property detection module interface and a sinusoidal signal response property detection module interface;
The specific process for establishing the software initial interface program of the food rheological property detection system comprises the following steps:
b1, starting a software initial interface program of the food rheological property detection system;
B2, initializing an opening device, the device comprising: the device comprises an electromagnetic force balance sensor (11), an electric proportional valve D/A control conversion module (22) and a laser displacement sensor (18);
B3, setting serial port communication parameters of the equipment in the step B2 through a serial port communication basic function;
B4, by starting the corresponding module interface, hiding the initial interface of the rheological property detection system software, and displaying the corresponding module interface;
the software sub-module of the food rheological characteristic detection system in the step C comprises a creep characteristic detection module, a stress relaxation characteristic detection module, a transient signal response characteristic detection module and a sinusoidal signal response characteristic detection module;
The creep characteristic detection module is used for carrying out creep characteristic detection on a food sample (4) to be detected;
The stress relaxation characteristic detection module is used for detecting the stress relaxation characteristic of the food sample (4) to be detected;
the transient signal responsiveness detection module is used for detecting the transient signal responsiveness of the food sample (4) to be detected;
The sinusoidal signal response characteristic detection module is used for detecting the sinusoidal signal response characteristic of the food sample (4) to be detected;
the software initial interface program of the rheological property detection system is also used for controlling the lifting platform (9) to a special position, and comprises the following steps: a zeroing module and a resetting module;
the zeroing module is used for moving the lifting platform (9) to a working zero point position;
the reset module is used for moving the lifting platform (9) to a homing position;
the creep characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module and an emergency stop module; the height measuring module is used for measuring the height of a food sample (4) to be measured;
the specific flow of the creep characteristic detection module interface program is as follows:
ca1, start creep property detection module;
Ca2, measuring the height of the food sample (4) to be measured by using the height measuring module;
ca3, lifting the lifting platform (9) to a working zero position by using a stepping motor movement control basic function;
Ca4, setting a constant gas value, creep duration time, creep recovery time and creep cycle number corresponding to a stress value required by creep;
ca5, opening an electromagnetic valve (23), spraying airflow to the surface of the food sample to be detected (4) through a nozzle (12), simultaneously establishing a timer, starting, recording a time sequence, reading position information of the surface of the food sample to be detected (4) by using a laser displacement sensor to control a basis function, obtaining a distance d between the surface of the food sample to be detected (4) and an air outlet of the nozzle (12), and reading pressure information of the surface of the food sample to be detected (4) by using an electromagnetic force balance sensor to control the basis function;
Ca6, adjusting the air pressure p by adjusting an electric proportional valve to enable the surface of the food sample (4) to be measured to reach a constant air pressure value corresponding to the set stress value required by creep deformation;
Ca7, in the process that the pressure of the surface of the food sample (4) to be detected is kept constant, the food sample (4) to be detected generates a creep behavior, and when the pressure of the surface of the food sample (4) to be detected is slightly changed, the electromagnetic force balance sensor controls a basis function to read the pressure information of the surface of the food sample (4) to be detected; obtaining the adjusting air pressure p of the electric proportional valve according to a constant air force value and an air force adjusting model corresponding to the set stress value required by creep deformation;
ca8, adjusting the air pressure p according to the obtained electric proportional valve, and adjusting the air flux of the electric proportional valve (25) to keep the surface of the food sample (4) to be detected as a constant air pressure value;
Ca9, when reaching creep duration, the electromagnetic valve (23) is closed; continuously using the laser displacement sensor to control the basic function to read the position information of the surface of the food sample (4) to be measured;
ca10, when the set creep recovery time is reached, if the creep cycle times are not reached, continuously and circularly performing the steps Ca 5-Ca 9; when the set creep recovery time is reached and the creep cycle number is reached, the creep characteristic detection is finished;
ca11, and the following steps are carried out while the steps Ca 5-Ca 10 are carried out:
Newly building a working thread, starting a new timer, reading the position information of the surface of the food sample (4) to be detected by the laser displacement sensor control basis function for unloading, and unloading the time sequence in the step Ca 5;
obtaining strain information of the food sample (4) to be detected according to the position information of the unloading and the height of the food sample (4) to be detected, and drawing and displaying a time-strain curve according to the unloading time sequence;
ca12, when creep characteristic detection is not carried out any more, closing the creep characteristic detection module, and returning to the initial interface of the food rheological characteristic detection system software;
The stress relaxation characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module and an emergency stop module; the height measuring module is used for measuring the height of a food sample (4) to be measured;
the specific flow of the stress relaxation characteristic detection module interface program is as follows:
cc1, start stress relaxation characteristic detection module;
cc2, measuring the height of the food sample (4) to be measured by using the height measuring module;
cc3, lifting the lifting platform (9) to the work zero point position by using the stepping motor movement control basic function;
Cc4, setting stress relaxation characteristics to detect a constant strain value, stress relaxation loading time and stress relaxation recovery time;
cc5, opening an electromagnetic valve (23), spraying air flow to the surface of the food sample to be measured (4) through a nozzle (12), simultaneously establishing a timer, starting, recording a time sequence, reading position information of the surface of the food sample to be measured (4) by using a laser displacement sensor to control a basis function, and reading pressure information of the surface of the food sample to be measured (4) by using an electromagnetic force balance sensor to control the basis function;
Cc6, adjusting the air pressure p by adjusting the electric proportional valve, so that the surface of the food sample (4) to be detected reaches the set stress relaxation characteristic detection constant strain value;
cc7, in the process that the strain on the surface of the food sample (4) to be measured is kept constant, the food sample (4) to be measured relaxes, when the strain has a slight change, the laser displacement sensor controls a basis function to read the position information of the surface of the food sample (4) to be measured, the distance d between the surface of the food sample (4) to be measured and the air outlet of the nozzle (12) is obtained, and then the electric proportional valve regulating air pressure p is calculated according to the pressure information and the air force regulating model of the surface of the food sample (4) to be measured, which are read by the electromagnetic force balance sensor controlling the basis function;
cc8, adjusting air pressure p according to the obtained electric proportional valve, adjusting the air flux of the electric proportional valve (25), and keeping the surface of the food sample (4) to be detected as a stress relaxation characteristic detection constant strain value;
cc9, when the stress relaxation loading time is reached, the electromagnetic valve (23) is closed; continuously using the laser displacement sensor to control the basic function to read the position information of the surface of the food sample (4) to be measured;
Cc10, when the set stress relaxation recovery time is reached, the stress relaxation characteristic detection is finished;
cc11, and the following steps are performed along with steps Cc5 to Cc 10:
Newly building a working thread, starting a new timer, unloading the pressure information of the surface of the food sample (4) to be tested, which is read by the electromagnetic force balance sensor control basis function, and unloading the time sequence in the step Cc 5; drawing a time-pressure curve according to the dump pressure information and the dump time sequence, and displaying the time-pressure curve;
Cc12, when the stress relaxation characteristic detection is not carried out any more, the stress relaxation characteristic detection module is closed, and the software initial interface of the food rheological characteristic detection system is returned.
2. the software development method of the food rheological property detection system of claim 1, characterized in that: the creep characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module and an emergency stop module; the height measuring module is used for measuring the height of a food sample (4) to be measured;
the specific flow of the creep characteristic detection module interface program is as follows:
Cb1, starting a creep characteristic detection module;
cb2, measuring the height of the food sample (4) to be measured by using the height measuring module;
cb3, lifting the lifting platform (9) to a working zero position by using a stepping motor movement control basic function;
Cb4, setting a constant air force value, creep duration time, creep recovery time and creep cycle number corresponding to the stress value required by creep;
cb5, opening an electromagnetic valve (23), spraying air flow to the surface of the food sample (4) to be detected through a nozzle (12), simultaneously establishing a timer, starting, recording a time sequence, and reading position information of the surface of the food sample (4) to be detected by using a laser displacement sensor to control a basic function; reading pressure information of the surface of the food sample (4) to be detected by using an electromagnetic force balance sensor control basis function;
cb6, adjusting the air pressure p by adjusting the electric proportional valve to enable the surface of the food sample (4) to be measured to reach a constant air pressure value corresponding to the set stress value required by creep deformation;
cb7, in the process that the pressure on the surface of the food sample (4) to be detected is kept constant, the food sample (4) to be detected is subjected to creep behavior, when the pressure on the surface of the food sample (4) to be detected is slightly changed, the laser displacement sensor controls a basis function to read the position information on the surface of the food sample (4) to be detected, the position information is transmitted to the embedded microprocessor, the embedded microprocessor calculates the pulse number required by the stepping motor driver (16) to drive the lifting platform (9) through the stepping motor (2), sends the pulse number to the stepping motor driver (16), controls the lifting platform (9) to lift through the stepping motor (2), keeps the distance between the surface of the food sample (4) to be detected and the air outlet of the nozzle (12) unchanged, and keeps the surface of the food sample (4) to be detected to be a;
cb8, when creep duration is reached, the solenoid valve (23) is closed; continuously using the laser displacement sensor to control the basic function to read the position information of the surface of the food sample (4) to be measured;
cb9, when the set creep recovery time is reached, if the creep cycle times are not reached, continuously performing the steps Cb 5-Cb 8 in a circulating manner; when the set creep recovery time is reached and the creep cycle number is reached, the creep characteristic detection is finished;
cb10, performing the steps Cb 5-Cb 9 and simultaneously performing the following steps:
newly building a working thread, starting a new timer, unloading the position information of the surface of the food sample (4) to be tested, which is read by the laser displacement sensor control basis function, and unloading the time sequence in the step Cb 5;
obtaining strain information of the food sample (4) to be detected according to the position information of the unloading and the height of the food sample (4) to be detected, and drawing and displaying a time-strain curve according to the unloading time sequence;
cb11, when the creep characteristic detection is not carried out any more, closing the creep characteristic detection module, and returning to the initial interface of the food rheological characteristic detection system software.
3. the software development method of the food rheological property detection system of claim 1, characterized in that: the transient signal response characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module, an emergency stop module and a reset module; the height measuring module is used for measuring the height of a food sample (4) to be measured;
The specific flow of the transient signal response characteristic detection module interface program is as follows:
cd1, a starting transient signal response characteristic detection module;
Cd2, measuring the height of the food sample (4) to be measured by using the height measuring module;
cd3, lifting the lifting platform (9) to a working zero position by using a stepping motor movement control basic function;
cd4, setting an excitation air pressure value, air pressure excitation time, cycle excitation interval time and cycle times;
cd5, opening an electromagnetic valve (23), spraying airflow to the surface of the food sample (4) to be detected through a nozzle (12), simultaneously establishing a timer, starting, recording a time sequence, and reading the position information of the surface of the food sample (4) to be detected by using a laser displacement sensing control basis function;
Cd6, newly building a working thread, starting a new timer, unloading the position information of the surface of the food sample (4) to be tested read by the laser displacement sensor control basis function, and unloading the time sequence in the step Cd 5;
Cd7, obtaining strain information of the food sample (4) to be detected according to the position information of the Cd6 unloading and the height of the food sample (4) to be detected, and drawing and displaying a time-strain curve according to the time sequence of the Cd6 unloading;
cd8, when the set air pressure excitation time is reached and the set cycle number is reached, the transient signal response characteristic detection is finished;
Cd9, when the transient signal response characteristic detection is not carried out any more, closing the transient signal response characteristic detection module, and returning to the initial interface of the food rheological characteristic detection system software.
4. the software development method of the food rheological property detection system of claim 1, characterized in that: the sinusoidal signal response characteristic detection module interface program comprises a stepping motor movement control basic function, a height measurement module, a storage module, an emergency stop module and a reset module; the height measuring module is used for measuring the height of a food sample (4) to be measured;
the specific flow of the sinusoidal signal response characteristic detection module interface program is as follows:
Ce1, start the sinusoidal signal response characteristic detection module;
ce2, measuring the height of the food sample (4) to be measured by using the height measuring module;
ce3, lifting the lifting platform (9) to the working zero position by using the movement control basic function of the stepping motor;
ce4, setting sinusoidal signal parameters, the sinusoidal signal parameters including: the method comprises the following steps of (1) sinusoidal signal period, sinusoidal signal initial phase angle, air pressure lower limit, air pressure upper limit and cycle number;
ce5, opening an electromagnetic valve (23), calculating the angular velocity of a sine signal by an embedded microprocessor according to the sine signal parameter set in the step Ce4, generating the sine signal, applying the sine signal to an electric proportional valve (25) to generate sine signal airflow, spraying the airflow to the surface of the food sample (4) to be detected through a nozzle (12), simultaneously establishing a timer, starting, recording a time sequence, and reading the position information of the surface of the food sample (4) to be detected by using a laser displacement sensor to control a basic function;
Ce6, establishing a new working thread, starting a new timer, unloading the position information of the surface of the food sample (4) to be detected read by the laser displacement sensor control basis function, and unloading the time sequence in the step Ce 5;
ce7, obtaining the strain information of the food sample (4) to be detected from the position information of the transfer of the step Ce6 and the height of the food sample (4) to be detected, and drawing and displaying a time-strain curve according to the time sequence of the transfer of the step Ce 6;
Ce8, when the set number of cycles is reached, the detection of the sinusoidal signal response characteristic is ended;
ce9, when the sinusoidal signal response characteristic detection is no longer carried out, the sinusoidal signal response characteristic detection module is closed, and the software initial interface of the food rheological characteristic detection system is returned.
5. the software development method of the food rheological property detection system of claim 1, characterized in that: the establishment process of the pneumatic adjustment model is as follows:
cf1, when the pressure p regulated by the electric proportional valve is 0.01MPa,
setting different distance values d between the surfaces of a plurality of groups of food samples (4) to be detected and the air outlet of the nozzle (12), and acquiring the pneumatic value F of the surface of the food sample (4) to be detected corresponding to the distance values d under each group of the distance values d;
Cf2, performing polynomial fitting on the distance value d and the air force value F in the step Cf1 to form a unitary nonlinear air regulation model with the distance value d as input and the air force value F as output, as shown in formula (1),
F=-0.0559*d*d+5.0196*d+133.2487 (1)
Cf3, when the pressure p regulated by the electric proportional valve is 0.3MPa,
Setting different distance values d between the surfaces of a plurality of groups of food samples (4) to be detected and the air outlet of the nozzle (12), and acquiring the pneumatic value F of the surface of the food sample (4) to be detected corresponding to the distance values d under each group of the distance values d;
cf4, performing polynomial fitting on the distance value d and the air force value F in the step Cf3 to form a unitary nonlinear air regulation model with the distance value d as input and the air force value F as output, as shown in formula (2),
F=-0.0022*d*d+0.1828*d+5.2513 (2)
cf5, and integrating the steps Cf1-Cf4 to obtain a pneumatic adjustment model with a distance value d and an adjustment pressure p as input and a pneumatic value F as output, as shown in formula (3),
F=(-0.0559*d*d+5.0196*d+133.2487)*(p-0.01)/(0.3-0.01)+(-0.0022*d*d+0.1828*d+5.2513) (3)
Wherein the unit of F is g; d is in mm; the unit of p is MPa.
6. the software development method for a food rheological property detection system according to any one of claims 2 to 4, characterized in that: the specific procedure of the height measuring module is as follows:
cg1, start height measurement module;
cg2, prompt "please remove the food sample to be tested first";
cg3, removing the food sample to be detected (4), and confirming;
cg4, the lifting platform (9) moves to the reset position;
cg5, prompting "please place the food sample to be tested";
cg6, placing a food sample to be tested (4) for confirmation;
Cg7, starting a laser displacement sensor (18) to measure the surface position of the food sample (4) to be measured;
cg8, comparing the position of the surface of the food sample (4) to be detected with the reset position of the lifting platform (9);
Cg9, obtaining the height of the food sample (4) to be detected, and storing;
the storage module is used for storing a time sequence in the food rheological property detection process and position information of the surface of the food sample (4) to be detected or an air force value of the surface of the food sample (4) to be detected as a csv file, so that further data processing is facilitated;
The sudden stop module is used for stopping the detection of the current food rheological property detection module, and comprises the following specific steps:
ch1, starting an emergency stop module;
ch2, closing the electromagnetic valve (23);
Ch3, finishing the current working thread;
ch4, stop the currently used timer;
Ch5, preparing for next food rheological property detection.
7. the software development method of the food rheological property detection system of claim 6, characterized in that: the working zero positions are as follows: in the range that a laser displacement sensor (18) of a food rheological property detection system effectively collects deformation information of a food sample (4) to be detected, an initial distance value from the surface of the food sample (4) to be detected to an air outlet of a nozzle (12) is obtained just before the nozzle (12) sprays air flow;
the homing position is as follows: the maximum distance value between the surface of the tray and the air outlet of the nozzle (12) is within the range that the deformation information of the food sample (4) to be detected is effectively collected by a laser displacement sensor (18) of the food rheological property detection system; the maximum distance value facilitates placement of the food sample (4) to be tested onto the tray.
8. the software development method of the food rheological property detection system of claim 6, characterized in that: the food rheological characteristic detection system software is written by C + +, a qt creator platform is used for writing program codes, a qt designer module under the qtmonitor platform is used for designing a user interface, the time-strain curve and the time-pressure curve are drawn by a qwtLot drawing component, the abscissa and ordinate axes of the qwtLot drawing component are set to be automatically zoomed, and the embedded microprocessor takes a Linux system as an operating environment.
CN201811183527.7A 2018-06-29 2018-10-11 software development method for food rheological property detection system Active CN109374475B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810700465 2018-06-29
CN2018107004656 2018-06-29

Publications (2)

Publication Number Publication Date
CN109374475A CN109374475A (en) 2019-02-22
CN109374475B true CN109374475B (en) 2019-12-13

Family

ID=65402964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811183527.7A Active CN109374475B (en) 2018-06-29 2018-10-11 software development method for food rheological property detection system

Country Status (1)

Country Link
CN (1) CN109374475B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113008735B (en) * 2021-02-26 2022-04-08 中国农业大学 Material three-dimensional viscoelastic rheological property detection system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4026571B2 (en) * 2003-09-18 2007-12-26 株式会社豊田中央研究所 Method for measuring viscosity of liquid and measuring device for index indicating viscosity
CN102999322A (en) * 2011-09-16 2013-03-27 深圳市吉阳自动化科技有限公司 Software interface design method of industrial controller
CN104569327B (en) * 2014-12-12 2017-10-20 中国农业大学 A kind of livestock meat viscoelasticity nondestructive detection system
CN104568736B (en) * 2014-12-12 2018-03-09 中国农业大学 A kind of livestock meat viscoelasticity lossless detection method
CN105910958B (en) * 2016-04-12 2018-10-23 武汉理工大学 A kind of material flowing deformation model analysis instrument and the method for establishing material flowing deformation model

Also Published As

Publication number Publication date
CN109374475A (en) 2019-02-22

Similar Documents

Publication Publication Date Title
CN1903698B (en) Multipoint synchronous lifting device and its lifting method
CN109374475B (en) software development method for food rheological property detection system
CN103808460B (en) Pressure transducer static properties quick calibration method
CN102252805A (en) Multi-range field full-automatic pressure and electric signal calibrating instrument
CN207074102U (en) pressure calibration device
CN109900468A (en) A kind of rubber and plastic axle envelope performance monitoring and accelerated life test platform and test method
CN205808618U (en) A kind of nuclear power station differential pressure transmitter static pressure correcting device
CN102305689A (en) On-site full-automatic pressure and electric signal calibrator
CN104458240A (en) Device and method for testing spring mechanical property
CN103344429B (en) Numerical control test table for magnetic valve for forklift
CN108119432A (en) A kind of control system of hydraulic cylinder multi-function test stand
CN101858843B (en) Computer-based rheology test control method and system
CN107491004A (en) Intelligent weighing tester and its application method
CN202033073U (en) Semi-physical simulation platform for digital fuel oil measuring system
CN108956376A (en) A kind of food rheological behavior detection system
CN205749197U (en) A kind of liquid surface tension coefficient measures integration analyzer
CN107271104A (en) Temperature and the array calibrating system of touch force sensor under water of pressure atmosphere are provided
CN103580654B (en) Reactor period signal generator and its implementation and using method
CN108956377A (en) A kind of food rheological behavior detecting method
CN106527526A (en) Temperature control circuit for silicon drift detector
CN108958306B (en) Pneumatic generation for food rheological property detection and control method thereof
CN205483517U (en) It shows servovalve static performance tester to have characteristic curve and performance parameter
CN111721636A (en) Pressure-bearing equipment pressure-resistant test automatic loading control system
CN109141216A (en) A kind of SCM Based resistance strain gauge
CN208818802U (en) A kind of point needle detecting device with environmental simulation

Legal Events

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