Intelligent rowing machine data monitoring method

By using the ADC1 controller of the STM32F407VET6 chip for multi-channel parallel data acquisition and filtering, combined with an adaptive transmission strategy, the problems of low accuracy and low transmission efficiency in rowing machine data monitoring are solved, achieving high-precision, anti-interference, and real-time data transmission and equipment status identification.

CN121364663APending Publication Date: 2026-01-20秦韦
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511500652.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

The existing data monitoring of rowing machines lacks a systematic approach, has low data acquisition accuracy, is susceptible to electromagnetic interference, has low transmission efficiency, and cannot intelligently identify changes in equipment status.

Method used

The ADC1 controller, which uses the STM32F407VET6 chip, performs multi-channel parallel data acquisition through the dedicated DMA2_Stream4 channel. It combines multiple sampling average filtering and IIR low-pass filtering to achieve high-precision data acquisition and filtering, adaptively adjusts the transmission frequency, and uploads data using the MQTT protocol.

Benefits of technology

It improves data acquisition accuracy and anti-interference capability, optimizes transmission efficiency, realizes intelligent identification and real-time response of device status, reduces cloud computing pressure, and ensures stable and reliable data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121364663A_ABST
    Figure CN121364663A_ABST
Patent Text Reader

Abstract

The invention discloses a data monitoring method for an intelligent rowing machine. The data monitoring method comprises the steps that S1, an ADC1 controller based on an STM32F407VET6 chip adopts a DMA2Stream4 special channel to achieve multi-channel parallel data collection; s2, carrying out multi-sampling average filtering processing; s3, converting the voltage into an actual voltage value; s4, real-time filtering processing is carried out through an IIR low-pass filtering algorithm; s5, acquiring electric quantity percentage data; s6, the running state of the motor is monitored, and motion state data are obtained; s7, packaging according to a JSON format to obtain packaging data; s8, automatically adjusting the uploading frequency; and S9, uploading the packaged data to a cloud server through an MQTT protocol. According to the intelligent rowing machine data monitoring method, parallel data acquisition without CPU occupation can be realized, the data acquisition precision is high, the anti-interference capability is strong, and the transmission frequency can be adaptively adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of fitness device control, and particularly relates to an intelligent rowing machine data monitoring method. BACKGROUND

[0002] The existing rowing machine usually only monitors a single parameter, such as rotation speed or power, lacks systematic monitoring, and its sequential acquisition leads to different data time synchronization, affecting control accuracy, usually 8-10 bits of accuracy, limited resolution. In addition, the data acquisition of the existing rowing machine generally directly uses the original ADC value, which is easily affected by electromagnetic interference, and cannot intelligently identify the running state change of the equipment, uses fixed frequency transmission, and its large amount of redundant data occupies bandwidth, and the transmission efficiency is low. SUMMARY

[0003] In order to solve the problems in the prior art, the present application aims to provide an intelligent rowing machine data monitoring method, which can realize zero CPU occupied parallel data acquisition, high data acquisition accuracy, strong anti-interference ability, and adaptive adjustment of transmission frequency.

[0004] In order to achieve the above purpose, the present application provides an intelligent rowing machine data monitoring method, comprising the steps of:

[0005] S1: the ADC1 controller based on the STM32F407VET6 chip adopts the DMA2_Stream4 dedicated channel to realize parallel data acquisition of multiple analog channels of a detected target of an intelligent rowing machine according to a preset time interval to obtain acquisition data; the detected target includes at least two motors and a battery of the intelligent rowing machine; the acquisition data includes the generated voltage of the motor, the generated current of the motor and the battery voltage of the battery;

[0006] S2: the sampling data is subjected to multiple sampling average filtering processing;

[0007] S3: the generated voltage and the battery voltage after the multiple sampling average filtering processing are converted into actual voltage values;

[0008] S4: the actual voltage values and the generated current after the multiple sampling average filtering processing are subjected to real-time filtering processing by using an IIR low-pass filtering algorithm to obtain filtered data;

[0009] S5: the battery percentage data is obtained according to the battery voltage in the filtered data;

[0010] S6: the running state of the motor is monitored according to the generated voltage in the filtered data, and the motion state data is obtained according to the motion state;

[0011] S7: Obtain the device identification information, current PWM control value, filtered data, battery percentage data and motion state data of the smart rowing machine and encapsulate the obtained encapsulation data in JSON format;

[0012] S8: Automatically adjust the data upload frequency according to the filtered data change amplitude, battery power abnormal change and system mode switching;

[0013] S9: Upload the encapsulation data to the cloud server through the MQTT protocol according to the current data upload frequency.

[0014] As an embodiment, in the S1 step, the preset time interval is 10 ms; the analog channel includes four power generation voltage acquisition channels, four power generation current acquisition channels, one battery voltage acquisition channel and one reserved expansion channel; all the analog channels are synchronously acquired under an ADC clock of 21 MHz, and are provided with a 500-data-point circular buffer.

[0015] As an embodiment, in the S2 step: the average value of every 10 sampling values of each analog channel in the data point circular buffer is calculated.

[0016] As an embodiment, the S5 step further includes the steps of:

[0017] S51: converting the current battery voltage into 0%-100% battery percentage data by using a linear mapping formula;

[0018] S52: when the calculation result of the battery percentage data exceeds 100%, forcibly setting it to 100%, and when the calculation result of the battery percentage data is lower than 0%, forcibly setting it to 0%;

[0019] S53: judging whether the change rate of the current battery percentage data is greater than or equal to a first threshold value; if greater than or equal to the first threshold value, automatically discarding the current battery percentage data and keeping the last battery percentage data as the current battery percentage data; if less than the first threshold value, judging that the current battery percentage data is valid data, updating the corresponding system variable and outputting the corresponding debugging information through the serial port.

[0020] As an embodiment, the first threshold value is 1% / s.

[0021] As an embodiment, the S6 further includes the steps of:

[0022] S61: when the power generation voltage is greater than or equal to 1V and the motor state is stopped, determining that the motor is started; when the power generation voltage is less than 1V and the motor state is running, determining that the motor is stopped;

[0023] S62: When the motor is determined to start, the motor state is updated to running, and the motion cycle number is automatically counted as the motion state is started by the user;

[0024] S63: When the motor is determined to stop, the motor state is updated to stop;

[0025] The motion state data includes the motion cycle number.

[0026] As an embodiment, the FreeRTOS task architecture is adopted, and the operation is performed once every 10 ms.

[0027] As an embodiment, the automatic adjustment of the data upload frequency according to the change amplitude of the filtered data further includes the following steps:

[0028] S81: The absolute difference between the current power generation voltage and the previous power generation voltage in the filtered data is calculated;

[0029] S82: The absolute difference is compared with a second threshold value; when the absolute difference is greater than or equal to the second threshold value, it is determined that the power generation voltage is in a signal dramatic change period; when the absolute difference is less than the second threshold value, it is determined that the power generation voltage is in a signal stable period;

[0030] S83: The data upload frequency is automatically adjusted according to the type of the signal change period in which the current power generation voltage is located; when it is in the signal dramatic change period, the data upload frequency is set to be uploaded once every 0.1 s; when it is in the signal stable period, the data upload frequency is set to be uploaded once every 30 s.

[0031] As an embodiment, the second threshold value is 0.3 V.

[0032] As an embodiment, by monitoring the battery power change rate in real time, when the power change rate is detected to be >1% / second, the data upload frequency is set to be uploaded once every 0.1 s;

[0033] The system mode switching includes that the motion state is started by the user and the PWM control value is changed; when the motion state is started by the user and the PWM control value is changed, the data upload frequency is set to be uploaded once every 0.1 s.

[0034] The present application has the following beneficial effects due to the adoption of the above technical solutions:

[0035] The ADC1 controller based on the STM32F407VET6 chip adopts the DMA2_Stream4 dedicated channel to realize the zero CPU occupation parallel data acquisition of the multiple analog channels of the detected target of the intelligent rowing machine. All the analog channels are synchronously collected under the 21MHz ADC clock, the data time stamps are consistent, and a 500-data-point cyclic buffer is provided, and the hardware level synchronous trigger is provided, so that the synchronization of the data acquisition time is ensured, and the control precision is improved. The multiple sampling average filtering is performed first, and then the IIR low-pass filtering is performed, the multiple sampling average filtering can quickly remove the high-frequency random noise and sampling jitter in the signal, improve the signal smoothness and signal-to-noise ratio, and on this basis, the IIR low-pass filtering further filters out the residual high-frequency components as needed, while retaining the real low-frequency dynamic information of the signal, so that the output is more smooth and accurate; and this two-stage processing is more convenient for optimizing the filtering effects of the two stages respectively in actual debugging. In the filtering processing of the battery power percentage value, the built-in intelligent filtering algorithm is used, when the abnormal change of the power change rate is detected to be greater than 1% / s, the last valid value is maintained, so as to avoid the false power display caused by the ADC noise, voltage transient or calculation error. An intelligent transmission strategy is adopted, and the fast transmission mode is triggered immediately when a key change occurs, when the voltage change of any motor is greater than or equal to 0.3V, the system is immediately switched from the standard transmission interval (30 seconds) to the fast transmission mode (100ms), the voltage fluctuation is detected by the 12-bit precision sampling of the ADC1, and the motion state change can be responded in milliseconds. The fast transmission mode can be triggered immediately when a key change occurs, and the key change includes motor voltage mutation, abnormal change of battery power and system running mode switching. The STM32F407VET6 master control chip as an edge computing node realizes local fusion processing of multiple sensor data, and the local preprocessing reduces the calculation pressure of the cloud server. The encapsulated data is uploaded to the cloud server through the MQTT protocol, and the protocol has the characteristics of light weight and low bandwidth occupation, and can efficiently realize the real-time data transmission between the device and the cloud, so as to ensure that the interaction response is rapid and the data transmission is stable and reliable. BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creating labor.

[0037] Figure 1 The flowchart of the intelligent rowing machine data monitoring method of the embodiments of the present application. DETAILED DESCRIPTION

[0038] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0039] Please refer to Figure 1 The intelligent rowing machine data monitoring method of the embodiment of the present application comprises the following steps:

[0040] S1: The ADC1 controller based on the STM32F407VET6 chip adopts the DMA2_Stream4 dedicated channel to realize parallel data collection of multiple analog channels of a detected target of an intelligent rowing machine according to a preset time interval to obtain collection data; the detected target comprises at least two motors and a battery of the intelligent rowing machine; the collection data comprises motor generated voltage, motor generated current and battery voltage of the battery;

[0041] In the S1 step, the preset time interval is 10ms; the analog channels comprise four generated voltage collection channels, four generated current collection channels, one battery voltage collection channel and one reserved expansion channel; all the analog channels are synchronously collected under an ADC clock of 21MHz, and are provided with a 500-data-point circular buffer.

[0042] In the embodiment, the detection target comprises four motors of the intelligent rowing machine. The collection data comprises generated voltage of the four motors, generated current of the four motors and battery voltage of the battery.

[0043] The system first initializes the DMA collection mode of the 9-channel ADC channel through the adc_nch_dma_init() function. The PB0 pin ADCCHANNEL8 is specially used for battery voltage detection, and the remaining pins are used for generated voltage and current detection. The ADC works in a 12-bit resolution mode, and a sampling time of 480 ADC clock cycles is adopted to ensure sampling accuracy. The DMA controller is configured in a zero-CPU occupation automatic transmission mode to realize continuous sampling without affecting system real-time performance.

[0044] The rowing machine adopts a complete four-channel PWM architecture in the hardware design stage, and uses four channels PD12-PD15 of the TIM4 timer for PWM output control. When the system starts, all four PWM channels are completely initialized, including unified configuration of 4200 precision and 2kHz frequency, and the initial comparison value is set to 495. This design ensures that the hardware layer has complete capability for expansion from double motor to four motor without any hardware modification or reconfiguration.

[0045] S2: performing a multiple sampling average filtering process on the sampling data;

[0046] In the S2 step: the average value of every 10 sampling values of each analog channel in the data point circular buffer is calculated.

[0047] In the adc_get_ch_nums_value() function, the system repeatedly samples each ADC channel 10 times, and then obtains a stable sampling result through mathematical average operation. The specific implementation is: the sum of the 10 sampling values of each channel in the buffer is calculated, and then the average value adcx is obtained by dividing the sampling number. This method effectively filters out high-frequency noise and random interference.

[0048] S3: converting the power generation voltage and the battery voltage after the multiple sampling average filtering process into actual voltage values;

[0049] The power generation voltage and the battery voltage sampling average value is converted into the actual voltage value of the power generation voltage and the voltage division voltage of the battery voltage through the formula temp[j]=(float)adcx×(3.3f / 4096). Since the ADC is 12-bit resolution, 4096 levels, and the reference voltage is 3.3V, this conversion accurately maps the digital quantity to the analog voltage range of 0-3.3V, providing standardized input data for subsequent filtering processing.

[0050] Where adcx is the 12-bit digital quantity original value collected by the ADC1 module of the STM32F407VET6 master chip, which represents the discrete numerical value of the analog voltage signal after quantization. 3.3f is the ADC reference voltage of the STM32F407VET6 system, with units of volts (V). According to the hardware architecture specification, the system uses 3.3V as the full-scale reference voltage of the ADC. When the analog input voltage is 3.3V, the ADC outputs the maximum digital value 4095; when the input is 0V, the ADC outputs the digital value 0. The 4096 in the formula is the total quantization level of the 12-bit ADC, calculated as 2^12=4096. It represents the minimum voltage difference number that the ADC can distinguish. The ADC divides the continuous voltage range of 0V to 3.3V into 4096 discrete digital quantity levels on average. (float)adcx forcibly converts the ADC digital quantity of integer type to floating point type, ensuring that the subsequent multiplication operation can maintain sufficient accuracy and avoid truncation error in integer operation.

[0051] adcx (3.3f / 4096) is the core linear scaling operation, which multiplies the ADC digital quantity by the quantization precision to obtain the corresponding actual voltage value. The operation logic is:

[0052] Actual voltage = digital quantity x voltage corresponding to unit digital quantity

[0053] tempj = adcx x 0.000805664V

[0054] Conversion example:

[0055] Suppose the digital quantity adcx collected by the ADC is 2048:

[0056] tempj = 2048 x (3.3 ÷ 4096) = 2048 x 0.000805664 = 1.65V

[0057] This result shows that when the ADC outputs 2048, the corresponding actual analog input voltage is 1.65V, which is exactly half of the 3.3V reference voltage, consistent with the linear conversion characteristics of the 12-bit ADC.

[0058] This conversion method ensures that the STM32F407VET6 system can accurately restore discrete digital quantities to continuous analog voltage values, providing a reliable data foundation for subsequent monitoring of key parameters such as motor voltage and battery voltage.

[0059] The battery voltage also needs to be amplified to obtain the actual voltage: Since the hardware design uses a 1:4 voltage dividing circuit to protect the ADC input, the collected voltage value needs to be restored to the true battery voltage by battery_level = temp8 / 0.25. The voltage dividing coefficient 0.25 ensures that the battery voltage is within the ADC measurable range after voltage division.

[0060] S4: Real-time filter processing on the actual voltage value and the power generation current after multiple sampling average filter processing using IIR low-pass filter algorithm to obtain the filtered data;

[0061] In this embodiment, the formula for IIR low-pass filter algorithm is: filtered_value = old_value x 0.8 + new_value x 0.2. The adjustable filter coefficient 0.95 is used for battery voltage to further improve stability.

[0062] IIR low-pass filter algorithm is a secondary filter processing on the data after multiple sampling average, rather than filtering the direct output of the sensor. This layered filtering architecture ensures high-quality data and real-time performance of the system.

[0063] Firstly, the signal is filtered by the multi-sampling average filter and then by the IIR low-pass filter. The multi-sampling average filter can quickly remove the high-frequency random noise and sampling jitter in the signal, improve the signal smoothness and signal-to-noise ratio, and on this basis, the IIR low-pass filter further filters out the residual high-frequency components as needed while retaining the real low-frequency dynamic information of the signal, so that the output is smoother and more accurate. Moreover, this two-stage processing is more convenient for optimizing the filtering effect of the two stages respectively in actual debugging.

[0064] S5: obtaining the battery percentage data of the battery according to the battery voltage in the filtered data;

[0065] The S5 step further comprises the steps of:

[0066] S51: converting the current battery voltage into the battery percentage data of 0%-100% by using a linear mapping formula;

[0067] S52: when the calculation result of the battery percentage data exceeds 100%, forcibly setting it to 100%, and when the calculation result of the battery percentage data is lower than 0%, forcibly setting it to 0%;

[0068] S53: judging whether the change rate of the current battery percentage data is greater than or equal to a first threshold value; if greater than or equal to the first threshold value, automatically discarding the current battery percentage data and keeping the last battery percentage data as the current battery percentage data; if less than the first threshold value, judging that the current battery percentage data is valid data, updating the corresponding system variable and outputting the corresponding debugging information through the serial port.

[0069] The first threshold value is 1% / s.

[0070] In this embodiment, the mathematical linear interpolation method is used to map the battery voltage range of 10.8V-12.5V to the battery percentage of 0%-100%, and the mapping formula is int level=(int)(((battery_level-10.8) / (12.5-10.8))*100+ 0.5), which ensures the accuracy of the battery percentage display.

[0071] 10.8V is the minimum working voltage. When the battery voltage drops to this value, the system determines that the battery percentage is 0% and needs to be charged immediately to avoid damage to the battery due to over-discharge.

[0072] 12.5V is the full charge voltage, which is used as the reference for 100% battery percentage by the system.

[0073] battery_level represents the current battery voltage, the real-time battery voltage value collected by ADC (unit V), ranging from 10.8V to 12.5V. This value is the actual voltage calculated after conversion by tempj=(float)adcx×(3.3f / 4096) and amplification circuit from the battery voltage detection of PB0 channel.

[0074] (battery_level-10.8) is used to calculate the offset of the current voltage relative to the minimum working voltage. For example, when battery_level=11.65V, the offset is 11.65-10.8=0.85V, indicating that the current voltage is 0.85V higher than the minimum voltage.

[0075] ((battery_level-10.8) / (12.5-10.8)) is used to calculate the relative position of the current voltage in the working range. The result is a decimal between 0 and 1, representing the proportion of power. For example: 0.85V ÷ 1.7V = 0.5, indicating that the power is 50%.

[0076] (int) is used to convert the floating-point result to an integer, obtaining the final power percentage integer value.

[0077] Actual application example:

[0078] Assuming the current battery_level=11.65V is detected:

[0079] Voltage offset: 11.65-10.8=0.85V;

[0080] Proportion calculation: 0.85 ÷ 1.7 = 0.5;

[0081] Percentage conversion: 0.5 × 100 = 50;

[0082] Rounding: 50 + 0.5 = 50.5;

[0083] Integer: (int) 50.5 = 50;

[0084] The final display power is 50%, accurately reflecting the actual power state of the battery.

[0085] After that, boundary value processing is performed.

[0086] By software limitation, the power percentage is always within the reasonable range of 0%-100%. When the calculation result exceeds 100%, it is forced to be 100%, and when it is lower than 0%, it is forced to be 0%. This protection mechanism prevents invalid power display caused by sensor abnormalities or voltage fluctuations.

[0087] Then, the intelligent filtering algorithm for the battery is performed:

[0088] The intelligent filtering based on the rate of change is implemented through the battery_levelthresholdfilter() function, which monitors the rate of change in battery level. When the rate of change exceeds 1% per second, it is determined to be an interference signal and the last valid value is retained. This ensures smooth transition of the battery level display and avoids sudden changes in battery level caused by transient interference, improving the stability of user experience.

[0089] The system obtains the current timestamp through HAL_GetTick(), calculates the time interval between the last sampling, and then calculates the rate of change of the battery level based on the formula change_rate=fabsf(new_value-last_battery_level) / time_diff_sec, with the unit of percentage per second.

[0090] Where new_value represents the current battery level value, which is the latest battery level percentage value calculated in the current sampling period, with the unit of %. This value is converted from the real-time battery voltage through the linear mapping formula int level=(int)(((battery_level-10.8) / (12.5-10.8))×100+0.5), reflecting the instantaneous battery level state.

[0091] last_battery_level represents the historical battery level value, which is the battery level percentage value recorded at the last valid sampling, with the unit of %. This value is saved as a static variable inside the function and used for comparison with the current battery level to calculate the battery level change amplitude. The initial value is 0.0f, which will be updated continuously during system operation.

[0092] time_diff_sec represents the time interval, which is the time difference between the current sampling time and the last sampling time, with the unit of seconds (s). The HAL_GetTick() function is used to obtain the millisecond value of the system tick counter, which is then converted to seconds, reflecting the actual time interval between two battery level measurements.

[0093] fabsf(new_value-last_battery_level): The fabsf() function is used to take the absolute value of the battery level difference, eliminating the influence of the sign and only focusing on the size of the change amplitude. fabsf() is a function specifically designed to handle float type data, ensuring calculation accuracy.

[0094] Practical application example

[0095] Suppose the system detects the following data:

[0096] Current battery level: new_value = 85%;

[0097] Last battery level: last_battery_level = 83%;

[0098] Time interval: time_diffsec = 2.0s;

[0099] Calculation process:

[0100] Battery level difference: 85% - 83% = 2%;

[0101] Absolute value: fabsf(2%) = 2%;

[0102] Change rate: 2% ÷ 2.0s = 1.0% / s;

[0103] Threshold judgment mechanism:

[0104] When the calculated change_rate > 1.0% / s, the system will determine that it is an abnormal change, triggering the following response:

[0105] Keep the last valid battery level value to avoid data display jumping;

[0106] This change rate detection mechanism effectively filters the abnormal battery level display caused by ADC noise, voltage transient or calculation error, ensuring the stability and reliability of the battery level display.

[0107] Filter algorithm characteristics:

[0108] Change rate limiting mechanism: The function has built-in intelligent filtering algorithm. When detecting abnormal changes in battery level change rate exceeding 1% / s, it will keep the last valid value to avoid false battery level display caused by ADC noise, voltage transient or calculation error.

[0109] Time window smoothing: Use timestamp comparison mechanism to ensure that the battery level change is within a reasonable physical range, providing stable and reliable battery status information for system power management, user interface display and cloud data upload.

[0110] This filtering process ensures that the battery pack's battery level display can reflect the true battery status and maintain sufficient stability, avoiding user experience problems caused by hardware noise.

[0111] Floating-point operations are used in the battery level intelligent algorithm to ensure the accuracy and stability of battery level detection.

[0112] In addition, if the rate of change is within a reasonable range, the system accepts the new sampling value as valid data, updating the filtered_battery_level, last_battery_level, and last_sample_time three state variables. At the same time, debug information is output through the serial port, facilitating monitoring of the working state and effect verification of the filtering algorithm during development.

[0113] The serial port here includes: USART3 debug serial port;

[0114] Serial port identification: The debug serial port in the system mainly refers to USART3, which is a communication interface specifically used for outputting debug information during the development stage. USART3 is connected to STM32F407VET6 through GPIO pins and is configured as a standard asynchronous serial communication mode.

[0115] Physical connection: The TX and RX pins of USART3 are connected to external debugging devices such as CH343 serial port tools, with a baud rate of 115200, data format of 8 data bits, 1 stop bit, and no parity check.

[0116] Connection architecture with the processor:

[0117] Hardware interface: USART3, as a built-in peripheral of STM32F407VET6, is directly connected to the ARMCortex-M4 core through the internal bus. The system clock provides a working clock for USART3 through the PCLK1 bus, ensuring stable communication timing.

[0118] Battery level change monitoring information can be set as follows:

[0119] Normal change record:

[0120] "Normal battery level change: 2.50% / s, updated to: 85.0%";

[0121] Display the change rate value and the current battery percentage to confirm that the filtering algorithm is working normally.

[0122] Abnormal change warning information:

[0123] Threshold change warning:

[0124] "Battery level change too fast: 3.20% / s, use last valid value: 83.0%";

[0125] Record the abnormal change rate value, indicating that the system maintains the last stable value to avoid displaying jumps.

[0126] State variable update record:

[0127] Key parameter tracking:

[0128] filtered_battery_level: current filtered valid battery level value;

[0129] last_battery_level: last recorded battery level reference value;

[0130] last_sample_time: timestamp update record;

[0131] time_diff_sec: sample time interval calculation result;

[0132] Algorithm performance indicators:

[0133] Filtering effect verification: including value comparison before and after filtering, abnormal detection times statistics, system response time measurement and other performance data, to help developers optimize the parameter configuration of battery_level_threshold_filter() function.

[0134] These debugging information are output through u3_printf() function, providing comprehensive system running state monitoring for developers, ensuring the reliability and accuracy of battery power filtering algorithm in battery pack application.

[0135] S6: monitoring the running state of the motor according to the generated voltage in the filtered data, and obtaining motion state data according to the motion state;

[0136] The S6 further comprises the steps of:

[0137] S61: when the generated voltage is greater than or equal to 1V and the motor state is stopped, determining that the motor starts; when the generated voltage is less than 1V and the motor state is running, determining that the motor stops;

[0138] S62: when determining that the motor starts, updating the motor state to running and automatically counting as the number of motion cycles, the motion state being that the user starts to move;

[0139] S63: when determining that the motor stops, updating the motor state to stop;

[0140] The motion state data includes the number of motion cycles.

[0141] The function of marking a new cycle is to discretize the continuous motor running process into statistical motion events, through this mechanism, the following can be achieved:

[0142] Accurate statistics: each rowing action is accurately recorded and counted;

[0143] Real-time feedback: providing immediate motion data feedback to the user;

[0144] Data analysis: provide basic data for cloud-based motion analysis and health management;

[0145] Intelligent control: provide decision basis for adaptive control of the device.

[0146] S7: Obtain the device identification information, current PWM control value, filtered data, power percentage data and motion state data of the intelligent rowing machine, and encapsulate the encapsulated data in JSON format;

[0147] The data structure uploaded is in JSON format, including the following specific fields:

[0148] First type: device identification information:

[0149] sn (string type): device serial number, used for cloud identification of specific rowing machine equipment;

[0150] Second type: PWM control data

[0151] pwm1 (numeric type): PWM control value of motor 1, derived from global variable g_pwmvalue1;

[0152] pwm2 (numeric type): PWM control value of motor 2, derived from global variable g_pwmvalue2;

[0153] pwm3 (reserved): PWM control value of motor 3 (currently commented out for expansion);

[0154] pwm4 (reserved): PWM control value of motor 4 (currently commented out for expansion);

[0155] Third type: motor voltage sensor data;

[0156] motor_1_voltage (float type): motor 1 voltage value, derived from temp[0] / 0.0769;

[0157] motor_2_voltage (float type): motor 2 voltage value, derived from temp[1] / 0.0769;

[0158] motor_3_voltage (reserved): motor 3 voltage value (currently commented out);

[0159] motor_4_voltage (reserved): motor 4 voltage value (currently commented out);

[0160] Fourth type: motor current sensor data;

[0161] motor_1_current (floating type): motor 1 current value, derived from temp[4] (PC0 channel acquisition);

[0162] motor_2_current (floating type): motor 2 current value, derived from temp[5] (PC1 channel acquisition);

[0163] motor_3_current (reserved): motor 3 current value (currently commented out);

[0164] motor_4_current (reserved): motor 4 current value (currently commented out);

[0165] The fifth type is battery management data.

[0166] battery_level (integer type): battery power percentage (0%-100%), after linear mapping and boundary value processing;

[0167] The sixth type is motion state data.

[0168] motor_1_number (integer type): motor 1 new cycle flag, used to identify whether the motor has completed a new motion cycle;

[0169] motor_2_number (integer type): motor 2 new cycle flag, used to identify whether the motor has completed a new motion cycle;

[0170] motor_3_number (reserved): motor 3 new cycle flag (currently commented out);

[0171] motor_4_number (reserved): motor 4 new cycle flag (currently commented out).

[0172] S8: automatically adjusting the data upload frequency according to the filtered data change amplitude, battery power abnormal change and system mode switching;

[0173] The step of automatically adjusting the data upload frequency according to the filtered data change amplitude further comprises the steps of:

[0174] S81: calculating the absolute difference between the current power generation voltage and the last power generation voltage in the filtered data;

[0175] S82: comparing the absolute difference with a second threshold value; when the absolute difference is greater than or equal to the second threshold value, determining that the power generation voltage is in a signal drastic change period; when the absolute difference is less than the second threshold value, determining that the power generation voltage is in a signal stable period;

[0176] S83: automatically adjusting the data upload frequency according to the type of the signal change period in which the current power generation voltage is located; when in the signal drastic change period, setting the data upload frequency to upload once every 0.1s; when in the signal stable period, setting the data upload frequency to upload once every 30s.

[0177] The second threshold value is 0.3V.

[0178] By monitoring the battery power change rate in real time, when the power change rate is detected to be >1% / second, it is determined that the battery power is abnormally changed, and the data upload frequency is set to upload once every 0.1s;

[0179] The system mode switching includes that the motion state is that the user starts to move and the PWM control value changes; when the motion state is that the user starts to move and the PWM control value changes, the data upload frequency is set to upload once every 0.1s.

[0180] In this embodiment, for the power generation voltage signal of the motor, the system calculates the absolute difference between the current value and the historical value: fabs(current_value-last_value), and when the difference is ≥0.3V, it is determined that the signal is drastically changed.

[0181] Signal drastic change period: send_interval=10, upload data once every 0.1s;

[0182] Signal stable period: send_interval=3000, upload data once every 30s.

[0183] The data is packaged in JSON format to optimize transmission efficiency. The uploaded data in standard JSON format is as follows:

[0184] {

[0185] "sn": "030001",

[0186] "pwm1": 0,

[0187] "pwm2": 0,

[0188] "motor_1_voltage": 12.5,

[0189] "motor_2_voltage": 12.3,

[0190] "motor_1_current": 2.1,

[0191] "motor_2_current": 1.8,

[0192] "battery_level": 85,

[0193] "motor_1_number": 1,

[0194] "motor_2_number": 0

[0195] }

[0196] S9: According to the current data upload frequency, the encapsulated data is uploaded to the cloud server through the MQTT protocol.

[0197] The method of the embodiment adopts a FreeRTOS task architecture and is executed once every 10 ms.

[0198] The control end of the intelligent rowing machine further has an AES-CBC encryption and decryption module, which is used for encrypting a small amount of sensitive fields and publishing them to an independent encryption topic, and stopping after reporting for several times; the rest of the conventional data, such as voltage, current, battery level, PWM control value, sliding determination event and the like, are reported in plaintext, thereby improving the security of user data upload.

[0199] It should be noted that the specification and drawings of the present application give the preferred embodiments of the present application, but the present application can be realized in many different forms, and is not limited to the embodiments described in the specification, and these embodiments are not additional limitations on the content of the present application, and the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Furthermore, the above technical features continue to be combined with each other, forming various embodiments not listed above, which are considered to be within the scope of the present application; further, those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should be within the protection scope of the appended claims of the present application.

[0200] The above embodiments of the present application are described in detail with reference to the accompanying drawings, and those skilled in the art can make various changes to the present application based on the above description. Therefore, some details in the embodiments should not be construed as limiting the present application, and the present application will be defined by the scope of the appended claims.

Claims

1. A method for monitoring data of an intelligent rowing machine, comprising the steps of: S1: using a DMA2_Stream4 dedicated channel of an ADC1 controller based on an STM32F407VET6 chip to perform parallel data acquisition of multiple analog channels of a detected target of an intelligent rowing machine at a preset time interval to obtain acquisition data; the detected target comprises at least two motors and a battery of the intelligent rowing machine; the acquisition data comprises generated voltage of the motor, generated current of the motor and battery voltage of the battery; S2: performing multiple sampling average filtering processing on the sampling data; S3: converting the generated voltage and the battery voltage after the multiple sampling average filtering processing into actual voltage values; S4: performing real-time filtering processing on the actual voltage values and the generated current after the multiple sampling average filtering processing using an IIR low-pass filtering algorithm to obtain filtered data; S5: obtaining battery percentage data from the battery voltage in the filtered data; S6: monitoring the running state of the motor according to the generated voltage in the filtered data, and obtaining motion state data according to the motion state; S7: obtaining device identification information, current PWM control value, the filtered data, the battery percentage data and the motion state data of the intelligent rowing machine, and encapsulating the obtained data in a JSON format to obtain encapsulated data; S8: automatically adjusting the data upload frequency according to the change amplitude of the filtered data, abnormal change of the battery capacity and system mode switching; S9: uploading the encapsulated data to a cloud server through an MQTT protocol according to the current data upload frequency. In the S1 step, the preset time interval is 10 ms; the analog channels include four generated voltage acquisition channels, four generated current acquisition channels, one battery voltage acquisition channel and one reserved expansion channel; all the analog channels are synchronously acquired under an ADC clock of 21 MHz, and are provided with a 500-data-point circular buffer. In the S2 step: the average value of every 10 sampling values of each analog channel in the data point circular buffer is calculated. The S5 step further comprises the steps of: S51: converting the current battery voltage into battery percentage data of 0%-100% using a linear mapping formula; S52: forcibly setting the calculation result of the battery percentage data to 100% when it exceeds 100%, and forcibly setting the calculation result of the battery percentage data to 0% when it is less than 0%; S53: determining whether the change rate of the current battery percentage data is greater than or equal to a first threshold value; if greater than or equal to the first threshold value, discarding the current battery percentage data and keeping the last battery percentage data as the current battery percentage data; if less than the first threshold value, determining that the current battery percentage data is valid data, updating the corresponding system variable and outputting the corresponding debugging information through a serial port. The first threshold value is 1% / s. The S6 further comprises the steps of: ​ ​ ​ ​ ​ ​ ​ ​ ​ 2. The intelligent rowing machine data monitoring method of claim 1, wherein, ​ 3. The intelligent rowing machine data monitoring method of claim 2, wherein, ​ 4. The intelligent rowing machine data monitoring method of claim 3, wherein, ​ ​ ​ ​ 5. The intelligent rowing machine data monitoring method of claim 4, wherein, ​ 6. The intelligent rowing machine data monitoring method of claim 5, wherein, ​ S61: When the generated voltage is greater than or equal to 1V and the motor state is stopped, it is determined that the motor is started; when the generated voltage is less than 1V and the motor state is running, it is determined that the motor is stopped; S62: When it is determined that the motor is started, the motor state is updated to running, and the motion cycle number is automatically counted as the motion state is started by the user; S63: When it is determined that the motor is stopped, the motor state is updated to stopped; The motion state data includes the motion cycle number.

7. The intelligent rowing machine data monitoring method of claim 6, wherein, The FreeRTOS task architecture is adopted, and the execution is performed once every 10ms.

8. The intelligent rowing machine data monitoring method of claim 7, wherein, The step of automatically adjusting the data upload frequency according to the change amplitude of the filtered data further comprises steps of: S81: Calculate the absolute difference between the current generated voltage and the last generated voltage in the filtered data; S82: Compare the absolute difference with a second threshold value; when the absolute difference is greater than or equal to the second threshold value, it is determined that the generated voltage is in a signal dramatic change period; when the absolute difference is less than the second threshold value, it is determined that the generated voltage is in a signal stable period; S83: Automatically adjust the data upload frequency according to the type of the signal change period in which the current generated voltage is located; when in the signal dramatic change period, set the data upload frequency to upload once every 0.1s; when in the signal stable period, set the data upload frequency to upload once every 30s.

9. The intelligent rowing machine data monitoring method of claim 8, wherein, The second threshold value is 0.3V.

10. The intelligent rowing machine data monitoring method of claim 8, wherein, By monitoring the battery power change rate in real time, when the power change rate is detected to be greater than 1% / second, the data upload frequency is set to upload once every 0.1s; The system mode switching includes that the motion state is started by the user and the PWM control value is changed; when the motion state is started by the user and the PWM control value is changed, the data upload frequency is set to upload once every 0.1s.

Citation Information

Patent Citations

  • Improvement in cloth-steaming apparatus

    US115200A