Adaptive Mechatronic Monitoring and Control of Thermal-Humidity Conditions in Stored Cotton Stacks Based on Recursive Least-Squares Identification

Abstract

Long-term storage of raw cotton in stacks is accompanied by spatially non-uniform thermal and humidity fields, and a locally hazardous state can develop unnoticed when the stack is observed at a single point or at long manual inspection intervals. This paper proposes a closed-loop mechatronic architecture that unites eight distributed temperature-humidity sensing nodes with wireless data transmission, validity-aware sensor fusion, a multi-factor technological risk index, recursive least-squares (RLS) identification of the effective cooling coefficient with exponential forgetting (used for model adaptation and diagnosis of ventilation effectiveness), a six-state supervisory automaton and a mobile stepper-driven ventilation actuator protected by independent hardware safety circuits. In contrast to monitoring-only solutions, measurement validation, online identification, risk-based decision-making, positioning and active ventilation are coordinated within a single control loop, and the information uncertainty caused by lost sensor nodes is treated separately from the technological risk. The architecture was implemented in MATLAB/Simulink with eight first-order thermal channels, sensor faults and communication delays, fan/induction-motor and stepper-drive subsystems, and was examined in five scenarios: nominal operation, multiple hot zones, sensor disconnection, a 30% loss of fan effectiveness and a 40% increase in movement resistance. Against the virtual validation series the identified model gave RMSE = 0.1197˚C, MAE = 0.0965˚C, MAPE = 0.343% and R2 = 0.9689. These values characterise agreement with simulated data only and are not claimed as physical validation on a real cotton stack. The study thus provides a structured path from distributed monitoring to adaptive mechatronic control, together with a staged experimental protocol and quantitative acceptance criteria for subsequent validation.

Share and Cite:

Sidikov, I. and Yuldashev, S. (2026) Adaptive Mechatronic Monitoring and Control of Thermal-Humidity Conditions in Stored Cotton Stacks Based on Recursive Least-Squares Identification. Intelligent Control and Automation, 17, 191-211. doi: 10.4236/ica.2026.174009.

1. Introduction

Raw cotton is stored for long periods in large stacks, in which heat and moisture are distributed non-uniformly over the volume. Stored textile materials constitute a recognised fire hazard [1], and the smouldering behaviour of cotton bales ignited internally has been shown to depend on bale density [2]; the internal thermal state of a compacted cotton mass is therefore a safety-relevant quantity as well as a quality-relevant one. Local thermal and humidity anomalies are difficult to identify reliably when the process is observed at a single point or at long manual inspection intervals.

Recent work has demonstrated the feasibility of wireless temperature-humidity monitoring and intelligent inspection of cotton bale storage, including RFID-based positioning combined with wireless sensing [3], while RFID tag localisation techniques based on phased-array antennas [4] extend the means of locating monitored objects. Monitoring and information management, however, do not by themselves constitute an adaptive control system: a control architecture must transform validated measurements into decisions and must coordinate sensing, actuation and safety within one loop.

The second prerequisite of such a loop is a model that follows the object. The cooling behaviour of a cotton stack depends on cotton density, the aerodynamic resistance of the ventilation channel, ambient conditions and the state of the fan, all of which change with time, so that a model with fixed coefficients becomes mismatched. Recursive least squares (RLS) with exponential forgetting is the standard instrument for estimating slowly varying parameters from streaming input-output data [5] [6]; recursive identification schemes suited to adaptive control [7], RLS-based adaptive state-feedback control [8] and the combination of RLS identification with PI and model predictive control for thermal plants [9] confirm its relevance to processes with thermal inertia and delay. In the neighbouring field of condition monitoring, evolving and adaptive neuro-fuzzy techniques have been applied to gearbox and bearing diagnostics [10] [11], which shows that online adaptation can serve diagnosis as well as control.

The present study addresses the gap between monitoring and adaptive control by treating the cotton stack as a distributed, slowly varying thermal object coupled to a mobile ventilation mechanism. The central idea is to observe the stack with several spatially distributed sensors, to reject invalid measurements, to identify the current effective cooling behaviour online, and to select ventilation and motion states according to a risk index, while keeping uncertainty about the measurements distinct from the risk of the process itself.

The paper concentrates on the control contribution and not on the hardware platform. The low-cost components of the prototype (ESP32 microcontrollers and SHT21 sensors) are not regarded as a scientific novelty; their significance arises from integrating distributed information, two types of electric drive, mobile mechanics, supervisory logic and adaptive parameter estimation into one mechatronic architecture. An important limitation is stated from the outset: the RLS and model-fit results reported here are obtained by simulation and require physical validation on a real cotton stack. This distinction is maintained throughout the paper.

The contributions of the work are as follows: 1) a distributed eight-node monitoring structure with explicit measurement validation; 2) an RLS-based online estimator of the effective cooling coefficient with conditional updating and parameter projection, used for adaptive model identification and diagnosis of ventilation effectiveness; 3) a risk-aware supervisory state machine that combines thermal risk with information uncertainty; 4) the integration of stepper-driven mobile positioning with ventilation control and independent safety logic; and 5) a reproducible simulation and validation protocol that separates algorithmic verification from physical validation.

The remainder of the paper is organised as follows. Section 2 reviews related work and formulates the problem. Section 3 describes the mechatronic architecture, and Section 4 presents the identification and control method. Section 5 describes the simulation model and the scenarios. Section 6 reports and discusses the results, Section 7 gives the experimental validation plan and the limitations, and Section 8 concludes the paper.

2. Related Work and Problem Formulation

2.1. Related Work

Research on cotton-storage monitoring shows that wireless sensing can supply real-time temperature and humidity information. Zhang et al. [3] developed an RFID-based intelligent inspection and monitoring system for cotton bale storage that uses wireless temperature-humidity sensing and a handheld terminal; in their field tests the positioning error was below 6.7%, the relative temperature error below 8% and the humidity error below 7%. That work establishes the importance of distributed information acquisition, but its objective differs from the present one: the system proposed here additionally closes the loop through adaptive ventilation and mobile actuation.

From the control viewpoint, time-varying process parameters make fixed-coefficient models vulnerable to mismatch. RLS identification provides an online mechanism for tracking parameter changes [5] [7], and adaptive state-feedback control built on RLS has been proposed for time-varying systems [8]. Recent thermal-control research combines adaptive identification with predictive control [9]. Two practical difficulties of RLS with forgetting are well known: loss of excitation, which causes the covariance matrix to grow without bound, and estimates that leave the physically admissible region under noise [6] [7]. Both are relevant to the present object, because a contactor-controlled fan delivers excitation only while it is running, and both are addressed explicitly in Section 4.2.

2.2. Problem Formulation

The state of the stack, the external disturbances and the control actions are described by the vectors

x( t )= [ T,W,ρ, v a ,ΔP ] T ,  z( t )= [ T a ,R H a , P y , v w , I s ] T ,  u( t )= [ u f , u m ] T (1)

where T is the temperature, W the humidity-related state, ρ the cotton density, va the air velocity in the ventilation channel and ΔP the pressure difference; Ta and RHa are the ambient temperature and relative humidity, and Py, vw and Is denote precipitation, wind speed and solar irradiance; uf ∈ {0, 1} is the state of the fan contactor and um ∈ {−1, 0, 1} is the motion command of the platform (reverse, stop, forward). The object and its observation by N = 8 sensor nodes are written in the general form

x ˙ ( t )=f( x( t ),u( t ),z( t ),θ( t ) ),   y i ( k )= h i ( x( k T s ) )+ ν i ( k ),  i=1,⋯,N (2)

where θ(t) is the vector of slowly varying parameters, Ts the sampling period and νi the measurement noise of node i. Only local temperatures and relative humidities are measured; the remaining components of x act on the measured channels through the parameters θ, which is the reason for identifying them online.

The control problem is to construct a supervisory policy u(k) that, whenever a valid node crosses the upper threshold Ton or the risk index exceeds its decision boundary, returns all valid node temperatures below Ton − ΔTh in finite time, subject to three constraints: mutual exclusion of motion and ventilation, uf·|um| = 0; minimum ON and OFF durations of the fan contactor; and transfer to a safe state on any fault. Because the prototype uses a contactor-controlled fan, ventilation is manipulated through ON/OFF durations and state transitions; continuous fan-speed adaptation by means of a variable-frequency drive (VFD) is identified as a future extension.

3. Proposed Mechatronic Architecture

The architecture comprises eight distributed sensor nodes, a central controller, a mobile mechanical platform and a ventilation actuator (Table 1). Each node measures temperature and relative humidity and transmits them wirelessly together with its node identifier and a measurement status. The central controller validates the received packets, determines the set of active nodes and computes the maximum and the fused thermal state. Sensor validity is deliberately separated from technological risk: a missing measurement is treated as information uncertainty and is never silently interpreted as a safe state of the process.

Table 1. Subsystems of the proposed architecture and their role in the control loop.

Subsystem

Main function

Control role

Eight sensor nodes

T and RH at distributed locations

Spatial observation

Validity and fusion

Timeout, range and jump checks

Reliable state estimation

Risk estimator

Temperature, humidity, rate of rise and internal-external difference

Start/stop decision

RLS identifier

Online estimation of the cooling coefficient

Model adaptation and diagnosis (no direct actuator command)

State machine

IDLE, MOVING, FAN, RESET, REVERSE, FAULT

Supervisory coordination

Stepper drive

Positioning of the mobile platform

Moves the actuator to the working position

Ventilation actuator

Air suction/ventilation

Active thermal intervention

Safety logic

E-STOP, overload, limit and timeout

Fail-safe operation

In MATLAB/Simulink the architecture is implemented as a set of modular subsystems: eight sensor subsystems, sensor validity and fusion, risk estimation, the supervisory state machine, the thermal plant, the fan and induction motor, the stepper drive and cart position, the RLS adaptive identifier, fault and safety logic, and scopes and metrics. This modularisation allows model parameters and fault scenarios to be changed without redesigning the model as a whole, and it mirrors the partition of functions in the prototype.

4. Adaptive Identification and Control Method

4.1. Thermal Model

The dominant cooling behaviour of the zone observed by node i is described by a first-order heat balance in which ventilation increases the rate of heat exchange with the ambient air:

d T i dt =−[ k 0,i + k v,i u f ( t ) ]( T i ( t )− T a ( t ) )+ γ i R H a ( t )+ q i ( t ) (3)

where k0,i is the natural (fan-off) heat-exchange coefficient, kv,i the additional coefficient created by forced ventilation, γi the sensitivity to ambient humidity, and qi a lumped term for internal heat generation and unmodelled exchange with neighbouring zones. For a constant ventilation state over one sampling period, Equation (3) leads to the discrete regression form

T i ( k+1 )= a i T i ( k )+ b i u f ( k )+ c i T a ( k )+ d i R H a ( k )+ e i + ε i ( k ) (4)

in which εi is the modelling error. Equation (4) is a regime-wise linear approximation of Equation (3). In the ventilated regime (uf = 1), in which identification is performed, ai = exp(−kc,iTs) with kc,i = k0,i + kv,i, so that the effective cooling coefficient and the corresponding time constant follow from the estimate of ai:

k ^ c,i ( k )=− ln a ^ i ( k ) T s ≈ 1− a ^ i ( k ) T s ,   τ ^ i ( k )= 1 k ^ c,i ( k ) (5)

The coefficient kc,i is not assumed constant, because cotton density, channel resistance, external conditions and fan performance change over time. Its current estimate is therefore both a model parameter and a diagnostic indicator of ventilation effectiveness.

4.2. RLS Online Identification

For each channel the regression vector is φ( k )= [ T( k ), u f ( k ), T a ( k ),R H a ( k ),1 ] T , the parameter vector is θ= [ a,b,c,d,e ] T and the output is y(k) = T(k + 1); the node index is omitted for brevity. The one-step prediction and the prediction error are

y ^ ( k )= φ T ( k ) θ ^ ( k−1 ),  e( k )=y( k )− y ^ ( k ) (6)

and the RLS update with forgetting factor λ is [5] [6]

K( k )= P( k−1 )φ( k ) λ+ φ T ( k )P( k−1 )φ( k ) (7)

θ ^ ( k )= θ ^ ( k−1 )+K( k )e( k ) (8)

P( k )= 1 λ [ P( k−1 )−K( k ) φ T ( k )P( k−1 ) ] (9)

where K(k) is the gain vector and P(k) the covariance matrix. The forgetting factor determines the effective memory of the estimator,

N λ = 1 1−λ (10)

The simulation uses λ = 0.995 as an initial value, which gives Nλ = 200 samples, that is, a memory of 200 - 400 s at the sampling period of 1 - 2 s. This is short in comparison with the rate at which the properties of the stack change and long in comparison with the measurement noise. In the simulations reported in Section 6 the sampling period of the thermal channels is fixed at Ts = 2 s, so that the memory of the estimator is NλTs = 400 s ≈ 6.7 min.

Updating is conditional. Equations (7)-(9) are executed for node i only when the indicator

g i ( k )= u f ( k )⋅ v i ( k )⋅1[ ξ i ( k )≥ ξ min ] (11)

equals one, that is, when the fan is running, the data of the node are valid (vi = 1, Section 4.3) and a scalar excitation measure ξi (in the simulation, the magnitude of the internal-ambient temperature difference, ξi(k) = |Ti(k) − Ta(k)|, which determines how informative a sample is about ai) exceeds the threshold ξmin. Otherwise, the last reliable estimate is retained, together with the covariance matrix, which prevents the covariance wind-up that exponential forgetting produces in the absence of excitation [6]. Two further remarks apply. First, since identification is restricted to uf = 1, the regressors associated with b and e coincide in that regime and only their sum is identifiable; this does not affect a ^ and hence does not affect Equation (5). Second, a projection constraint keeps the estimate inside the admissible set a min ≤ a ^ ≤ a max <1 , equivalent to k c,min ≤ k ^ c ≤ k c,max , which excludes the physically meaningless values that noise or short invalid packets could otherwise produce. The initial estimate, the initial covariance matrix, the threshold ξmin and the projection limits used in the simulation are given with the other simulation settings in Section 5.

4.3. Measurement Validation, Adaptive Sensor Fusion and Risk Index

Each received measurement passes three checks, and the validity flag of node i is their product:

v i ( k )= v i to ( k )⋅ v i rg ( k )⋅ v i jp ( k ) (12)

where v i to =1 if the last packet of the node is not older than the timeout τto, v i rg =1 if temperature and relative humidity lie within their admissible ranges, and v i jp =1 if the increment between consecutive samples does not exceed the admissible jump. The set of active nodes and its cardinality are

A( k )={ i: v i ( k )=1 },   N A ( k )=| A( k ) | (13)

and the fused thermal state is computed from active nodes only:

T max ( k )= max i∈A( k ) T i ( k ),   T ¯ ( k )= 1 N A ( k ) ∑ i∈A( k ) T i ( k ) (14)

The maximum is used for threshold decisions, so that a local hot spot is not masked by averaging; the mean characterises the general state of the stack. The loss of nodes is expressed by a separate information-uncertainty index,

U I ( k )=1− N A ( k ) N (15)

If NA falls below a predefined minimum Nmin, automatic control is restricted, because the hottest zone may be precisely the one whose node is disconnected. In this way information uncertainty is kept separate from process risk. The case in which the lost node is the critical one while NA ≥ Nmin is treated separately in Section 6.5.

The technological risk index combines normalised temperature, humidity, rate of temperature rise and the difference between internal and external conditions:

R q = w T q T + w W q W + w r q r + w Δ q Δ + w TW q T q W (16)

q j =min( 1,max( 0, x j − x j lo x j hi − x j lo ) ),  j∈{ T,W,r,Δ } (17)

where xj is the corresponding physical quantity and [ x j lo , x j hi ] its normalisation interval. The bilinear term wTWqTqW accounts for the non-linear amplification of risk when high temperature and high humidity occur simultaneously. The weights are assigned initial values for simulation and must be calibrated against experimental quality and thermal-response data.

The inputs of Equation (16) are formed from the active nodes only. Because the SHT21 nodes measure the relative humidity of the air in the stack and not the moisture content of the cotton, the humidity input is the measured air relative humidity, used as a proxy for the humidity-related state W: x W ( k )= max i∈A( k ) R H i ( k ) . The temperature input is xT(k) = Tmax(k) from Equation (14); the rate input is the largest rate of rise among the active nodes, x r ( k )= max i∈A( k ) [ T i ( k )− T i ( k−m ) ]/ ( m T s ) , evaluated over a window of m samples to suppress noise; and the internal-external difference is xΔ(k) = Tmax(k) − Ta(k). Taking the maximum of each input over the active nodes is conservative: the inputs may come from different nodes, but a single critical zone cannot be hidden. The weights, normalisation intervals and decision thresholds used in the simulation are given with the other simulation settings in Section 5. They are assumed settings and not calibrated results; the weights sum to one, so that Rq [0, 1].

4.4. Supervisory State Machine

The supervisory controller is a finite-state machine with six principal states (Table 2). In MOVING_FORWARD the ventilation contactor is disabled, and in FAN_RUNNING the stepper pulses are blocked; this mutual exclusion prevents simultaneous commands that could create unsafe actuator conflicts.

Table 2. States of the supervisory state machine.

State

Actuator outputs

Exit condition → next state

IDLE

Fan off; STEP pulses disabled

Ventilation request in automatic mode → MOVINGFORWARD

MOVINGFORWARD

STEP/DIR forward; fan contactor disabled

Limit sensor DS-438 active → FANRUNNING; movement timeout → FAULT

FANRUNNING

Fan contactor on; STEP pulses blocked

Stop condition, Equation (19) → R1RESET

R1RESET

Two-second reset sequence

Reset interval elapsed → MOVINGREVERSE

MOVINGREVERSE

STEP/DIR reverse; fan off

0.5 m travelled → IDLE; movement timeout → FAULT

FAULT

STEP pulses disabled; fan off

—

In automatic mode, ventilation is requested when at least one valid sensor exceeds the temperature threshold or when the risk index exceeds its decision boundary:

s on ( k )=[ T max ( k )≥ T on ]∨[ R q ( k )≥ R on ] (18)

Ventilation is stopped only after all active sensors have returned below the lower hysteresis boundary, the minimum ventilation time has elapsed and no critical humidity condition remains:

s off ( k )=[ T max ( k )≤ T on −Δ T h ]∧[ t f ( k )≥ t on,min ]∧[ q W ( k )< q W,cr ] (19)

where ΔTh is the hysteresis width, tf the elapsed running time of the fan and qW,cr the critical level of normalised humidity. Hysteresis and minimum ON/OFF times prevent excessive cycling of the contactor. E-STOP and overload protection are implemented in the hardware power circuit, independently of the software state machine.

The role of the RLS estimate in this loop is stated explicitly. In the configuration evaluated in this paper the estimate k ^ c does not modify any supervisory setting (Ton, ΔTh, Ron, qW,cr and the minimum ON/OFF times) and does not enter the actuator commands: uf and um are determined only by Equations (18) and (19) and by the transitions of Table 2. RLS is therefore used for adaptive identification and diagnosis. It keeps the channel model of Equation (4) consistent with the current state of the object and provides the indicator k ^ c , which is displayed on the HMI together with its nominal value kc,nom. When the relative drop D( k )=1− k ^ c ( k )/ k c,nom remains above the threshold Dal for longer than the estimator memory NλTs, a “reduced ventilation effectiveness” warning is sent to the operator; this warning does not change the control sequence. Using k ^ c to adapt the minimum ventilation time or, with a VFD, to compute a continuous fan-speed reference is a possible extension that is not evaluated here.

4.5. Mobile Mechatronic Positioning

The platform is moved by a stepper drive with STEP/DIR control through a reduction stage. The number of pulses per metre of travel and the linear resolution are

n p = ( 360˚/ α s ) m μ i r 2π r w ,   δ x = 1 n p (20)

where αs is the step angle, mμ the microstepping division, ir the reduction ratio and rw the wheel radius. With αs = 1.8˚, mμ = 8, ir = 6 and rw = 0.10 m, Equation (20) gives np ≈ 15,279 pulses/m and δx ≈ 0.065 mm, so that the 0.5 m reverse movement corresponds to approximately 7639 pulses. The actuator moves the platform to the DS-438 limit sensor, after which ventilation is performed; when the thermal condition of Equation (19) is satisfied, the 0.5 m reverse movement is commanded.

Motion without loss of steps requires the tractive force at the wheel to exceed the resistance force with a reserve κ:

F t = η i r M m r w ≥( 1+κ ) F r ,   F r = f r mg+ F add (21)

where Mm is the available motor torque at the operating speed, η = 0.85 the efficiency of the reduction stage, fr the rolling-resistance coefficient, m = 290 kg the platform mass (weight ≈ 2.84 kN) and Fadd the additional resistance caused by floor irregularity and cable drag. Under the adopted assumptions the design calculation gives a traction reserve of κ ≈ 16% for the 1:6 reduction. This ratio is not claimed to guarantee motion under all real floor conditions: the actual normal load, floor irregularity, cable drag and position of the centre of mass can change the available traction materially, and an experimental comparison of the 1:6, 1:7 and 1:8 ratios is therefore part of the validation plan (Section 7).

5. MATLAB/Simulink Model and Simulation Design

The simulation model contains eight first-order thermal channels with non-identical initial conditions, sensor noise and packet loss; the external environment; a fan and induction-motor subsystem; a stepper-drive and cart-position subsystem; contactor delay; RLS identification; the state-machine logic; and fault handling. Its channel-level structure is shown in Figure 1.

Figure 1. Functional structure of the MATLAB/Simulink model.

The ventilation channel is represented by the cascade Wf1(p) = 1/(0.8p + 1), Wf2(p) = 16/(1.2p + 1) and Wf3(p) = 12/(8.5p2 + 5.8p + 1) followed by a transport delay, and the positioning channel by Wm1(p) = 1/(p + 1), Wm2(p) = 0.8/(1.2p + 1) and Wm3(p) = 1.8/(3.988p2 + 3.99p + 1) followed by a transport delay and the non-linearity of the DS-438 limit sensor. Both second-order links are practically critically damped (damping ratios of approximately 0.995 and 1.00), so that the channel responses are aperiodic. The two loops are switched on and off through the relay logic R1, R2 and the automatic/manual mode selector. The RLS block runs in parallel with the thermal loop and, as explained in Section 4.4, updates the channel model and the diagnostic indicator without modifying the switching commands.

Two time scales are separated in the model, as in the prototype. Thermal dynamics are sampled with a period of the order of seconds, whereas stepper pulse generation is handled separately, so that the web server and communication tasks do not determine STEP timing. The settings needed to reproduce the simulations are listed in Table 3 together with their status. In all simulations reported in Section 6 the thermal sampling period is Ts = 2 s. The thermal coefficients of the eight channels are not measured quantities: they are assumed values of the virtual object, chosen to give a nominal ventilated time constant of approximately 10 min, and they will be replaced by coefficients identified on the real stack (Section 7). Measurement noise is modelled as zero-mean white Gaussian noise added independently to every node and sample, with standard deviations chosen from the accuracy and repeatability data of the SHT21 sensor [12]; packet loss is modelled as an independent Bernoulli event per node and sample, a lost packet leaving the previous value in the buffer and advancing the timeout counter of Equation (12); and the transport delays of the ventilation, positioning and communication channels are modelled as pure time delays.

Table 3. Initial parameters used in the simulation model.

Parameter

Value

Status

Number of sensor nodes, N

8

Architecture

Platform mass, m

290 kg

Device/model input

Wheel radius, rw

0.10 m

Constructive value

Reduction ratio, ir

1:6

Calculated initial choice

Reduction efficiency, η

0.85

Assumed

Step angle, αs

1.8˚

Motor data

Microstepping, 1/mμ

1/8

Driver setting

Temperature threshold, Ton

30˚C

Initial control setting

Hysteresis, ΔTh

2˚C

Control requirement

Node timeout, τto

10 s

Initial setting

RLS forgetting factor, λ

0.995

Simulation setting

Reset interval

2 s

Control sequence

Reverse distance

0.5 m

Technological requirement

Sensor sampling period, Ts

2 s (simulation); 1 - 2 s (prototype)

Simulation setting; recommended for prototype

Effective cooling coefficient, kc,i (S1, all nodes, fan on)

0.098 min−1 (τ ≈ 10.2 min)

Assumed (virtual object)

Natural (fan-off) coefficient, k0,i

0.008 min−1

Assumed (virtual object)

Ventilation coefficient, kv,i = kc,i − k0,i

0.090 min−1

Assumed (virtual object)

Humidity sensitivity γi; internal heat term qi

0.001˚C·min−1·%−1; qi = 0 except a heating episode of 0.45˚C - 0.85˚C/min (node-dependent) for 12 ≤ t ≤ 22 min

Assumed (virtual object)

Ambient conditions, Ta, RHa

17˚C; 60%

Assumed (virtual object)

Initial node temperatures (S1)

35˚C - 44.5˚C

Scenario setting

Step change of kc in the RLS test (Section 6.2)

0.098 → 0.083 min−1 at t = 15 min

Scenario setting

S2: cooling coefficients of the hot zones

kc = 0.078 and 0.085 min−1 (nodes 3 and 6)

Scenario setting

S3: disconnection of the hottest node (node 1)

5 ≤ t ≤ 9 min; confirmation interval 60 s

Scenario setting

S4: implementation of the 30% loss of fan effectiveness

gain of Wf2: 16 → 11.2 (−30%); resulting kc,i ≈ 0.057 min−1

Scenario setting

S5: movement resistance

1.4 Fr

Scenario setting

Temperature noise (white Gaussian), σT

0.10˚C

Assumed, based on sensor data [12]

Relative-humidity noise, σRH

1.0%

Assumed, based on sensor data [12]

Packet-loss probability per node and sample

0.02

Assumed simulation setting

Transport delay: ventilation/ positioning channel

3 s/0.1 s

Assumed simulation setting

Contactor delay; wireless communication delay

0.05 s; 0.1 s

Assumed simulation setting

Initial estimate θ ^ ( 0 )

a ^ ( 0 ) = exp(−0.060·Ts/60), i.e. k ^ c ( 0 ) = 0.060 min−1; other entries 0

Assumed simulation setting

Initial covariance P(0)

103·I5

Assumed simulation setting

Excitation threshold ξmin

2˚C

Assumed simulation setting

Projection limits kc,min, kc,max

0.02; 0.30 min−1

Assumed simulation setting

Diagnostic warning threshold Dal

0.20

Assumed simulation setting

Risk weights wT, wW, wr, wΔ, wTW

0.35, 0.20, 0.20, 0.10, 0.15

Assumed simulation setting

Normalisation interval of xT (temperature)

25˚C - 40˚C

Assumed simulation setting

Normalisation interval of xW (air relative humidity)

60% - 90%

Assumed simulation setting

Normalisation interval of xr (rate of rise, window m)

0 - 0.5˚C/min; m = 30

Assumed simulation setting

Normalisation interval of xΔ (internal-external difference)

0 - 15˚C

Assumed simulation setting

Risk decision boundary Ron; critical humidity qW,cr

0.60; 0.80

Assumed simulation setting

Minimum fan ON/OFF time, ton,min/toff,min

5 min/8min

Assumed simulation setting

Minimum number of active nodes, Nmin

6

Assumed simulation setting

Critical-node escalation time, tesc

10 min

Assumed simulation setting

Five scenarios were simulated (Table 4). They are designed to test parametric and event-driven robustness and not only the nominal behaviour: S2 and S4 change the parameters of the thermal channel, S3 removes information, and S5 loads the positioning channel.

Table 4. Simulation scenarios.

Scenario

Condition

Property tested

S1

Normal operation

Nominal thermal and supervisory response

S2

Multiple hot zones with different cooling coefficients

Spatial non-uniformity; decision by maximum

S3

Disconnection of a critical sensor

Information uncertainty; fusion over active nodes

S4

Fan effectiveness reduced by 30%

RLS tracking and diagnosis

S5

Movement resistance increased by 40%

Positioning channel; movement timeout

6. Results and Discussion

6.1. Thermal and Supervisory Response

Figure 2 shows the temperatures of the eight nodes in the normal scenario. The initial temperatures are non-identical and lie between approximately 35˚C and 44.5˚C. During the first two minutes, while the platform travels to the working position, the temperatures remain at their initial levels; ventilation then starts and all channels cool monotonically. The fan remains active until all valid nodes have returned to 28˚C or below and the minimum operating condition is satisfied, which occurs at approximately 12 min. Because the stop decision is taken on the maximum over the active nodes, a local hot spot cannot be masked by averaging.

Figure 2. Simulated temperature dynamics at the eight monitoring nodes. Scenario S1 with the settings of Table 3; shaded intervals: fan ON.

After the fan is switched off, a second heating episode raises the node temperatures to approximately 30˚C - 31.5˚C, and ventilation is retriggered once the minimum OFF interval has elapsed, at approximately 20 min. The response thus demonstrates hysteresis-based cycling control: two ventilation cycles occur within 30 min, and the contactor is not switched in the band between the thresholds.

The mobile sequence is coordinated by the state machine: the platform moves towards the limit sensor and stops at the working position, ventilation is activated and completed, the two-second reset sequence is executed, and the platform returns by approximately 0.5 m. The simulation therefore evaluates the integrated sequence and not isolated control blocks.

6.2. RLS Adaptation

The behaviour of the estimator is shown in Figure 3. The true coefficient of the virtual object equals 0.098 min−1 during the first 15 min and is then reduced stepwise to 0.083 min−1, a change of approximately 15%; by Equation (5) this corresponds to an increase of the cooling time constant from approximately 10.2 min to 12.0 min. Starting from the initial value of 0.060 min−1, the estimate reaches the neighbourhood of the true value in approximately 9 - 10 min, and after the step change it converges to the new value in a comparable time, with residual fluctuations of about ±0.002 min−1. These convergence times amount to roughly 1.4 - 1.5 memory lengths NλTs, as expected of an estimator with exponential forgetting.

Figure 3. Online estimation of the effective cooling coefficient using RLS (virtual simulation).

The estimate changes faster during the transient and becomes less dispersed once sufficient excitation has been accumulated. The choice λ = 0.995 is a compromise between adaptation speed and noise sensitivity for a slow thermal process: a smaller λ would respond faster but would amplify noise, whereas a value closer to unity would track real parameter changes more slowly.

6.3. Comparison of Scenarios

The cooling time and the relative energy consumption obtained in the five scenarios are compared in Figure 4 and Table 5; energy is normalised to the nominal scenario S1.

Energy is evaluated from the electrical input power of the two drives in the simulation model:

E j = ∫ t 0 t 1 [ P f ( t )+ P s ( t ) ]dt (22)

ε j = E j E S1 (23)

where Pf is the electrical input power of the fan induction motor computed in the fan subsystem from the stator voltage, current and power factor, Ps the electrical power of the stepper drive and εj the relative energy of scenario j reported in Table 5. The evaluation window starts at t0, the instant of the first ventilation request, and ends at t1, the instant at which the system returns to IDLE after the reverse movement of the first ventilation cycle; the integral is evaluated numerically with the solver step of the model. The power of the sensor nodes and of the controller is not included. The cooling time in Table 5 is measured from fan switch-on to the fulfilment of the stop condition (19) in the same cycle.

Figure 4. Comparative simulation results for cooling time and relative energy consumption. (a) Cooling time; (b) relative energy consumption, normalised to S1.

Table 5. Cooling time and relative energy consumption in the simulated scenarios (approximate values).

Scenario

Condition

Cooling time, min

Change vs. S1

Relative energy

Change vs. S1

S1

Normal operation

9.8

—

1.00

—

S2

Multiple hot zones

12.4

+27%

1.19

+19%

S3

Sensor disconnection

11.1

+13%

1.08

+8%

S4

Fan effectiveness −30%

16.8

+71%

1.48

+48%

S5

Movement resistance +40%

10.6

+8%

1.12

+12%

The degradation of the fan (S4) is the most severe disturbance: the model predicts the longest cooling time and the highest relative energy use. A 30% loss of effectiveness lengthens cooling by approximately 71% and raises relative energy use by approximately 48%, so that the consequences of fan degradation are more than proportional to its magnitude. In this scenario RLS detects the changed cooling behaviour and the diagnostic warning of Section 4.4 is raised; the supervisory commands themselves are unchanged, so the longer cooling time results only from the later fulfilment of the stop condition (19). The estimate k ^ c can be used as a diagnostic indicator. In the present contactor-based architecture it does not command a continuous fan speed; with a VFD, the estimated coefficient and the risk index could be used to compute a continuous speed reference. Multiple hot zones (S2) lengthen ventilation because the stop condition is governed by the slowest zone. Increased movement resistance (S5) acts on the positioning channel and not on the thermal one, and accordingly its effect on energy is larger than its effect on cooling time.

6.4. Model Adequacy

The validation protocol is as follows. Identification and evaluation use two separate simulation runs of the channel of node 1 under the nominal settings of Table 3, each of 30 min with Ts = 2 s. The first run was used for tuning the estimator settings (λ, P(0), ξmin) and for identification. The second run, which starts from a different initial state and has an independent noise realisation, provides the virtual validation series of n = 900 samples shown in Figure 5; no sample of this run was used for tuning, and random point-wise splitting was not used, because successive samples of a time series are correlated. During the evaluation the estimator updates were stopped and the parameters were frozen at the values reached at the end of the identification run. The model output y ^ ( k ) in Equations (24)-(27) is the free-run (independent trajectory) prediction of Equation (4), initialised with the measured temperature at the start of the series and driven only by uf, Ta and RHa; the measured temperature is not fed back into the regressor, so the prediction horizon equals the full 30-min series. This differs from the one-step prediction of Equation (6), which uses the measured temperature at every step and is a less demanding test; the values in Table 6 should therefore be read as trajectory-prediction accuracy on virtual data. The ratio MAE/RMSE = 0.81 is close to the value 2/π ≈ 0.80 expected for Gaussian residuals, which is consistent with a residual dominated by the simulated sensor noise (σT = 0.10˚C).

The agreement between the model output y ^ ( k ) and the virtual validation series y(k) of length n was evaluated by four standard indicators:

RMSE= ( 1 n ∑ k=1 n ( y( k )− y ^ ( k ) ) 2 ) 1/2 (24)

MAE= 1 n ∑ k=1 n | y( k )− y ^ ( k ) | (25)

MAPE= 100% n ∑ k=1 n | y( k )− y ^ ( k ) y( k ) | (26)

R 2 =1− ∑ k=1 n ( y( k )− y ^ ( k ) ) 2 ∑ k=1 n ( y( k )− y ¯ ) 2 (27)

where y ¯ is the mean of the validation series. The comparison is shown in Figure 5 and the values are given in Table 6.

Figure 5. Comparison of the model output with the virtual validation data.

Table 6. Model adequacy indicators (virtual validation).

Metric

Simulation value

Interpretation

RMSE

0.1197˚C

Root-mean-square error against the virtual series

MAE

0.0965˚C

Mean absolute error

MAPE

0.343%

Mean absolute percentage error

R2

0.9689

Share of the variance of the virtual series explained by the model

The values R2 = 0.9689 and RMSE ≈ 0.12˚C indicate good agreement with the virtual validation series. Taken together they imply a standard deviation of the validation series of approximately 0.68˚C, so that the residual amounts to about 18% of the variation of the signal; Figure 5 shows that this residual is dominated by the high-frequency noise superimposed on the virtual data, while the model output reproduces the slow component. Because the virtual object and the identification model share a related mathematical structure, high agreement is expected. The values must therefore not be presented as proof of the physical accuracy of the SHT21 sensor or of a model of the real cotton stack.

6.5. Fault Tolerance and Safety

The sensor-disconnection scenario demonstrates why simple averaging is insufficient. If the hottest sensor disappears, the remaining measurements artificially reduce the estimated risk. The proposed controller responds by increasing the information-uncertainty index of Equation (15) and by restricting automatic operation when the number of active nodes falls below the critical minimum. For movement faults, a timeout disables the STEP pulses and transfers the system to FAULT; the controller does not attempt to overcome the obstacle by raising the speed, which would increase the loss of steps.

A node-count threshold alone, however, cannot establish that an unobserved zone is safe: if the node that was the hottest disconnects while NA is still above Nmin, all remaining nodes may be below Ton although the lost zone is still hot. The loss of a critical node is therefore handled by a separate rule. A node is classed as critical when, at the moment its validity flag drops, it defined Tmax or its last valid temperature was at or above Ton − ΔTh. For such a node: 1) its last valid temperature is held in Equation (14) instead of being removed, so that Tmax cannot decrease because of the loss and the stop condition (19) cannot be met while the zone is unobserved; 2) if ventilation is running it continues, and if the platform is idle a ventilation request is issued as if son = 1, so that the platform moves to the working position and the fan is switched on; 3) a “critical node lost” alarm is sent to the operator HMI immediately; 4) if the node is not restored within tesc, the system escalates: automatic stopping of ventilation is inhibited, the fan remains on with the platform at the working position, manual inspection of the zone is requested, and ventilation can be ended only by the operator in manual mode. The held value is released only after the node has again delivered valid data for a confirmation interval. If NA falls below Nmin, automatic control is restricted as described in Section 4.3, the actuators are kept in their current safe state and the operator is alerted. In scenario S3 the hottest node (node 1) is disconnected between t = 5 and 9 min; its last valid value is held in Tmax, tesc is not reached, and the 60-s confirmation interval after reconnection contributes to the longer cooling time of S3 in Table 5.

The safety model distinguishes the software FAULT state from physical emergency interruption. E-STOP, thermal overload protection and contactor feedback are required to interrupt the power circuit independently of the microcontroller. This separation is essential for a practical mechatronic system, because the software cannot be assumed to remain operational in the situations in which protection is needed.

6.6. Comparison with Monitoring-Oriented Approaches

Table 7 compares the proposed system functionally with portable or local monitoring and with stationary PLC/SCADA monitoring.

The novelty therefore does not lie in the use of a particular sensor, the ESP32 controller or a web interface. It lies in the integration of distributed sensing, adaptive identification, supervisory control, mobile mechanics and safety logic into a closed mechatronic architecture. Existing cotton-storage monitoring work demonstrates the value of wireless temperature-humidity monitoring [3]; the present study extends that concept towards active adaptive control.

Table 7. Functional comparison of monitoring-oriented approaches and the proposed system.

Criterion

Portable probe/local monitoring

PLC/SCADA monitoring

Proposed system

Temperature

Periodic, local

Continuous, stationary

Distributed, continuous

Relative humidity

Limited/optional

System dependent

Eight sensing nodes

Active intervention

Operator decision

Possible with a stationary actuator

Mobile air-suction ventilation actuator

Mobility

No

No

NEMA 34 stepper drive with reduction

Adaptive identification

No

Usually not intrinsic

RLS-based

Communication /HMI

Local indicator

SCADA

ESP-NOW wireless nodes and web HMI

Main limitation

Sampling interval, locality

Cost and complexity

Requires physical validation

7. Experimental Validation Plan and Limitations

The numerical results presented above are simulation-based, and the next stage is a staged physical validation. First, all eight sensor nodes and the communication functions are tested independently. Second, the stepper drive is tested with the fan disabled. Third, the fan power circuit is tested manually with hardware protection in place. Only then are the automatic state machine and the RLS diagnostics integrated.

For sensor calibration, the eight SHT21 nodes and the external sensor should be placed in a controlled temperature-humidity chamber and compared with a reference thermo-hygrometer at several points. For the drive, starting and rolling forces should be measured and the 1:6, 1:7 and 1:8 reductions compared with respect to Equation (21). For the thermal experiment, all node temperatures, relative humidity, validity flags, fan state, platform position and electrical power should be logged at intervals of 1 - 2 s. At least 70% of the complete time segments can be used for identification and 30% for independent validation; random point-wise splitting must be avoided, because the samples of a time series are correlated. The acceptance criteria are listed in Table 8.

Table 8. Acceptance criteria for experimental validation.

Acceptance criterion

Target

Sensor packet loss

≤2% in a 30-min test

Detection of node disconnection

<10 s

STEP stop after limit-sensor activation

<100 ms

Position error of the 0.5 m reverse movement

<5%

RMSE of the thermal model on independent data

<0.5˚C

R2 of the model on independent data

>0.90

Emergency shutdown

Hardware-safe state

The main limitations of the study are the following. The first-order thermal model does not replace a full three-dimensional heat-and-moisture transfer model. The SHT21 sensor measures the relative humidity of the air and not the moisture content of the cotton mass directly. The RLS results and the fit metrics are at present based on virtual data. The real Q-H characteristic of the fan and the energy efficiency remain to be measured, and the mechanical traction reserve must be confirmed under actual floor and load conditions. These limitations are stated explicitly because they define the boundary between simulation evidence and experimentally verified claims.

8. Conclusions

A mechatronic architecture for adaptive monitoring and control of thermal-humidity conditions in stored cotton has been developed and evaluated in MATLAB/Simulink. The architecture integrates eight distributed sensing nodes, validity-aware sensor fusion, a multi-factor risk index, RLS online identification, a supervisory state machine, mobile stepper-driven positioning, ventilation actuation and independent safety logic.

The simulation demonstrates that RLS with a forgetting factor of 0.995 tracks changes in the effective cooling behaviour, and that state-machine coordination prevents conflicting motion and ventilation commands. A 30% loss of fan effectiveness was the most severe of the disturbances considered, in terms of both cooling time and relative energy consumption. The virtual model achieved RMSE = 0.1197˚C, MAE = 0.0965˚C, MAPE = 0.343% and R2 = 0.9689. These metrics confirm the internal consistency of the virtual model but do not constitute physical validation.

The principal scientific contribution is the integration of adaptive identification with distributed monitoring and mobile mechatronic actuation for cotton-stack storage, with information uncertainty handled separately from technological risk. The next research stage is experimental identification and independent validation on a real cotton stack. Once real time-series data have been obtained, the admissible range of the RLS parameters, the risk thresholds, the minimum ventilation time, the energy indicators and the mechanical transmission ratio should be recalibrated. A VFD-based extension can subsequently transform the present risk-based ON/OFF ventilation, in which RLS serves identification and diagnosis, into continuous adaptive speed control.

Data Availability

The Simulink model, the simulation settings of Table 3 and the virtual validation series used for Table 6 are available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Ma, J. (2014) Analysis on the Fire Risk Existing in the Storage of Textile Materials and Textile Goods. Procedia Engineering, 71, 271-275.[CrossRef]
[2] He, M., Ding, L., Yu, L. and Ji, J. (2021) Effect of Density on the Smoldering Characteristics of Cotton Bales Ignited Internally. Proceedings of the Combustion Institute, 38, 5043-5051.[CrossRef]
[3] Zhang, W., Zhao, B., Yang, Q., Zhou, L., Jiang, H., Niu, K., et al. (2022) Design and Test of Intelligent Inspection and Monitoring System for Cotton Bale Storage Based on RFID. Scientific Reports, 12, Article No. 4491.[CrossRef] [PubMed]
[4] Qiu, L., Liang, X. and Huang, Z. (2017) PATL: A RFID Tag Localization Based on Phased Array Antenna. Scientific Reports, 7, Article NO. 44183.[CrossRef] [PubMed]
[5] Ljung, L. (1999) System Identification: Theory for the User. 2nd Edition, Prentice Hall.
[6] Åström, K.J. and Wittenmark, B. (1995) Adaptive Control. 2nd Edition, Addison-Wesley.
[7] Prandini, M. and Campi, M.C. (1998) A New Recursive Identification Algorithm for Singularity Free Adaptive Control. Systems & Control Letters, 34, 177-183.[CrossRef]
[8] Levent, M.L. and Aydogdu, O. (2022) Adaptive State Feedback Control Method Based on Recursive Least Squares. Elektronika ir Elektrotechnika, 28, 27-34.[CrossRef]
[9] Zhang, P. and Xiong, G. (2026) Temperature Control of Thermal Performance Testing Systems Based on an Adaptive PI-RLS-MPC Strategy. Applied Sciences, 16, Article 2926.[CrossRef]
[10] Luo, D.Y. and Wang, W. (2025) A New Evolving Technology for Gearbox Condition Monitoring and Fault Diagnosis. Intelligent Control and Automation, 16, 158-174.[CrossRef]
[11] Toky, T.D., Zhang, M. and Wang, W. (2025) An Adaptive NF Technology for Bearing Condition Monitoring and Fault Diagnosis. Intelligent Control and Automation, 16, 61-79.[CrossRef]
[12] Sensirion, A.G. (2011) Datasheet SHT21: Humidity and Temperature Sensor IC. Version 3.
https://labs.dese.iisc.ac.in/embeddedlab/wp-content/uploads/sites/24/2023/08/SHT21_Temp_Humidity.pdf

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.