Abstract: This paper introduces the system structure and some software writing process of the hip force tester based on SPCE061A single-chip microcomputer, focusing on the force measurement method of the tester and the principle of using photoelectric encoder for speed measurement and phase discrimination. The tester uses SPCE061A single-chip microcomputer as the control core, equipped with a serial communication port, and has the functions of real-time monitoring by the host computer, data storage and reproduction, and offline analysis of test data. Experiments have shown that the tester has the advantages of accurate measurement, high stability and friendly control interface.
1 Introduction
With the continuous improvement of the scientific level of sports training, the necessity of special strength training for the human body has been increasingly valued. Through the overall analysis of a large number of actual sports test data, it is found that the backward extension force of all athletes engaged in running, jumping and running-based sports is significantly smaller than the downward or forward extension force. The backward extension force is precisely the special force required for running and jumping to generate power. Therefore, the design and development of a practical and accurate hip force tester is of great reference value for coaches to accurately quantify the training effect of athletes, and to reasonably formulate targeted training plans, thereby ultimately improving the performance of athletes in competitions.
The hip force tester introduced in this article uses the 16-bit single-chip microcomputer SPCE061A launched by Lingyang Company as its core component. It draws on existing technologies and makes reasonable planning of the tester's hardware and software design, giving full play to the advantages of the single-chip microcomputer's own integration of many system-level functional units, effectively reducing hardware costs and having high reliability and stability.
The hip force tester mainly realizes the following functions:
(1) Measure the real-time force value of the athlete's leg push-off force;
(2) Measure the real-time speed of the athlete’s legs in sync with the push-off force;
(3) The specific values and curves of the above-mentioned force, speed and power are displayed in real time by the host computer;
(4) It has the function of data reproduction. It can save and compare test data.
2 Overall system structure
The structure diagram of the hip force tester is shown in Figure 1. The system consists of three parts: data acquisition and processing circuit, control center and host computer real-time data and curve display.
The force acquisition circuit transmits the hip force in the form of analog quantity to the I/O port of the single-chip microcomputer. The force value is converted into a digital quantity that can be used by the control system through the 10-bit high-speed A/D converter integrated in the single-chip microcomputer. The speed acquisition circuit consists of a photoelectric encoder and a phase detection circuit. The digital pulse quantity output by the photoelectric encoder is processed by the single-chip microcomputer to obtain the real-time linear rate of the force, and the phase detection circuit provides the single-chip microcomputer with the direction of the force. The microcontroller uses the Lingyang 16-bit single-chip microcomputer SPCE061A, whose maximum operating frequency is 49.15MHz. The 32-bit programmable multi-function I/O port is convenient for connecting various peripherals. The chip integrates a 7-channel 10-bit voltage analog-to-digital converter (ADC) and a single-channel sound analog-to-digital converter, and has rich interrupt resources, which is particularly suitable for control systems with strict real-time requirements. The serial port level conversion circuit completes the conversion between the RS232 level standard and the single-chip microcomputer level standard to realize real-time full-duplex data communication between the tester and the host computer. Users can observe and save training data in real time through the host computer control program, and can set relevant parameters of the tester.
3 Data Collection and Processing
The data that the hip force tester needs to measure and display mainly include hip force, instantaneous velocity value and power value corresponding to the force. Among them, the hip force data is collected by the force sensor and the matching transmitter, and the instantaneous velocity is collected by the photoelectric encoder and the phase detection circuit. The power can be obtained by multiplying the force and the velocity.
3.1 Hip force measurement
The hip force is collected by the force sensor, and its analog voltage signal is amplified and linearized by the transmitter and then sent to the ADC integrated inside the SPCE061A to complete the digital-to-analog conversion.
3.1.1 Working principle of force sensor
This tester uses a resistance strain type force sensor to complete the hip force acquisition. The resistance strain type force sensor consists of an elastic sensitive element and a resistance strain gauge. When the elastic sensitive element is subjected to the measured force, displacement and strain will occur, and the resistance value of the resistance strain gauge attached to the elastic sensitive element will change. Therefore, by measuring the change in the resistance value of the resistance strain gauge, the magnitude of the measured force can be determined. The internal equivalent schematic diagram of the force acquisition circuit is shown in Figure 2.
Among them, R1 is a resistance strain gauge pasted on the elastic sensitive element. R1~R4 form a single-arm DC bridge, which converts the change of resistance in the bridge circuit into the change of the bridge output voltage. As can be seen from the figure, the output voltage of the bridge is
That is, the bridge output voltage Uo is linearly related to the change in resistance value △Rl of the resistance strain gauge. Combined with the above, it can be seen that the change in the bridge output voltage Uo reflects the change in the magnitude of the force. Therefore, by measuring the bridge output voltage Uo, the magnitude of the force can be detected.
The voltage signal Uo output by the force sensor is amplified and linearized by the transmitter, and is converted from a two-terminal input signal Uo to a single-terminal output signal Usample. The analog voltage Usample is linearly related to the measured force and is sent to the subsequent analog-to-digital conversion circuit (ADC) to complete the analog-to-digital conversion. The precision transmitter amplifier circuit in the transmitter generally uses a three-op-amp differential amplifier circuit, which has a high input impedance and common-mode rejection ratio, and effectively reduces temperature drift through the internal resistor-capacitor coupling circuit, ensuring the accuracy of the measurement.
[page]
3.1.2 Hip force measurement method
The output Usample of the force acquisition circuit is a voltage analog quantity, which needs to be converted into a digital quantity that can be used by the system control core - the single-chip microcomputer through ADC. SPCE061A has an 8-channel 10-bit high-speed A/D converter integrated inside. This system uses a single-channel I/O A0 as the analog voltage input for A/D conversion. The reference voltage Vref for A/D conversion can use the Vdd of the single-chip microcomputer system, or use an external reference voltage through software settings. Considering that the force measurement range of the tester is 0kg~300kg, the analog voltage output corresponding to the force acquisition circuit is OV~3V, and the analog voltage signal meets the input requirements of the A/D converter of SPCE061A. Therefore, the A/D conversion reference voltage uses the system default Vdd. Connect Usample to the I/O A0 terminal of SPCE061A to perform A/D conversion. The A/D conversion frequency designed for this system is set to 1 kHz, and the hip force F can be expressed as:
In the formula: Mmax is the maximum range of the force measured by the tester, g is the value of gravity acceleration, Umax is the maximum value of the analog voltage output by the force acquisition circuit, AD_Data is the 10-bit digital value obtained after A/D conversion of the force acquisition circuit output Usample, and AD_Max is the digital value corresponding to the 10-bit A/D converter reference voltage Uref, which is 0x03FF here. In actual programming, in order to reduce the interference of transient errors in the sampling process, the arithmetic mean filtering method is used, that is, the final displayed force F is obtained by calculating the arithmetic mean of the force sampled 10 times.
3.2 Speed measurement
In this tester, the speed value and force direction synchronized with the hip force are obtained by a photoelectric encoder, a phase detection circuit and a corresponding software counter.
3.2.1 Principle of photoelectric encoder speed measurement
Photoelectric encoder is a digital angle sensor that can convert angular displacement into a corresponding number of voltage pulse signals. It is mainly used for the detection and control of mechanical angular position and rotation speed. The ZKX-6-50BM7 incremental photoelectric encoder selected by this tester is a high-precision angular displacement sensor. It outputs 500 voltage pulse signals Out_A and Out_B in two channels for each rotation of the rotating shaft. Among them, the phase difference between the Out_A and Out_B signals is 90°.
Connect the output of the photoelectric encoder to the external interrupt IRQ3 of the microcontroller, and each voltage pulse caused by the rotation will trigger the external interrupt of the microcontroller. By programming the microcontroller external interrupt sub-function, the number of pulses output by the photoelectric encoder can be accurately calculated, and the precise angular displacement of the rotating shaft can be obtained after conversion.
Therefore, by calculating the angular displacement of the photoelectric encoder within a fixed time period, the angular velocity of the rotating shaft can be obtained. Combined with the radius of the coaxial turntable of the photoelectric encoder, the linear velocity value synchronized with the hip force can be calculated. In actual programming, the 512 Hz time base interrupt inside the microcontroller is used to generate a fixed time period, that is, the number of output pulses of the photoelectric encoder in each time interval t=l/512 s is calculated to obtain the speed. Let v be the average speed within time t. Since the fixed time period is small enough, the instantaneous speed is approximated as the average speed v, then
Where: s is the displacement of the object under test within time t; n is the number of pulses output by the photoelectric encoder within a fixed time interval (1/512 s); ι is the circumference of the coaxial turntable of the photoelectric encoder, and N is the number of pulses output by the photoelectric encoder after one rotation, where N=500.
3.2.2 Speed phase detection method
During the hip force detection process, the direction of the photoelectric encoder indicates whether the trainee's hip is actively exerting force or passively receiving force. Therefore, the determination of the direction of the photoelectric encoder is a basic function that this tester must have. By performing phase discrimination on the two voltage pulse signals Out_A and Out_B with a phase difference of 90° output by the photoelectric encoder, it is possible to determine whether the turntable is rotating forward or reverse. The specific phase discrimination circuit principle is shown in Figure 3.
The outputs Out_A and Out_B of the photoelectric encoder are connected to the clock terminal Clk and the control terminal D of the D flip-flop respectively. According to the functional definition of the D flip-flop, at each rising edge of the input clock signal Out_A, the output W2 of the flip-flop is set by the input signal Out_B of the control terminal D. Figure 4 shows the signal waveforms of Out_A and Out_B and the output of the phase detector circuit when the photoelectric encoder rotates forward.
When rotating forward, the phase of Out_A signal leads Out_B signal by 90°, and the output of w1 is always high. When rotating reversely, the phase of Out_A signal lags Out_B signal by 90°, and the output of W1 is always low. Therefore, by reading the voltage of W1, the direction of the photoelectric encoder can be determined.
[page]
3.3 Power Measurement
After measuring the force and speed, the power can be calculated by multiplying the two. That is, power:
P=Fv (5)
However, considering the disadvantages of the microcontroller in calculating the efficiency and accuracy of real number multiplication, the microcontroller is only responsible for uploading the collected force and speed to the host computer through RS232, and the actual calculation is completed by the host computer. This method can meet the real-time and accuracy requirements of the tester.
4 System Software Design
SPCE061A has built-in online emulation circuit ICE (In-CircuitEmulator) interface and online serial programming technology, which enables program development, debugging and downloading to be realized through the online debugger PROBE in a visual development environment, eliminating the hardware online real-time emulator (ICE) and program burner required in traditional single-chip microcomputer development. In the specific software design, the rich time base interrupts of SPCE061A are fully utilized to complete keyboard scanning and A/D conversion in the IRQ4 and IRQ5 interrupt subroutines. The serial communication with the host computer uses the UART hardware transmission interrupt of SPCE061A to meet the asynchronous and real-time nature of bidirectional data transmission.
The system program consists of the main program, force acquisition subroutine, speed calculation subroutine, serial communication subroutine, external memory subroutine and interrupt subroutine. Each part is written strictly according to the modular principle, which is easy to upgrade and maintain the system in the future. Among them, the main program mainly completes the initialization and self-test of each component of the tester, as well as the coordination of various functional modules in actual measurement.
The flow chart of the force acquisition subroutine and the speed calculation subroutine is shown in Figure 5.
The host computer monitoring program of the tester is developed based on the Visual C++6.0 platform. The use of the MSComm control provided by Microsoft avoids the disadvantages of cumbersome programming caused by directly calling Win32API to a great extent, and realizes the communication functions required by this system with less code. The host computer program has functions such as force timing, average power calculation, forward and reverse selection display, and measurement data storage and reproduction. The program running interface is shown in Figure 6.
5 Conclusion
The tester uses the Sunplus 16-bit single-chip SPCE061A as the control core, giving full play to its advantages of rich on-chip resources and fast computing speed. The hardware circuit structure is simple and stable. The host computer monitoring program has a friendly interface and is easy to operate. The test data preservation and reproduction functions facilitate offline analysis and formulation of sports training programs. The entire tester has strong scalability. The tester has been put into trial use in the sports fitness laboratory of Ocean University of China and has achieved good test results.
Previous article:EASI 12-lead multifunctional Holter system based on DSP
Next article:"Smart Pills" Intelligent, Internet-connected Medication Dispensing Machine
- Popular Resources
- Popular amplifiers
- High-speed 3D bioprinter is available, using sound waves to accurately build cell structures in seconds
- [“Source” Observation Series] Application of Keithley in Particle Beam Detection Based on Perovskite System
- STMicroelectronics’ Biosensing Innovation Enables Next-Generation Wearable Personal Healthcare and Fitness Devices
- China's first national standard for organ chips is officially released, led by the Medical Devices Institute of Southeast University
- The world's first non-electric touchpad is launched: it can sense contact force, area and position even without electricity
- Artificial intelligence designs thousands of new DNA switches to precisely control gene expression
- Mouser Electronics provides electronic design engineers with advanced medical technology resources and products
- Qualcomm Wireless Care provides mobile terminal devices to empower grassroots medical workers with technology
- Magnetoelectric nanodiscs stimulate deep brain noninvasively
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【micropython】Adding software timer in STM32
- EEWORLD University ---- ST MEMS sensor application demonstration video
- 【GD32E230】 EVAL board project creation and lighting
- Composting Fermentation Control Based on GD32E231
- Grounding of Switching Regulators
- EEWORLD University ---- Basic knowledge of TID
- Design of filter circuit
- How to use a touch switch to make a circuit that turns on when pressed once and turns off when pressed again
- Meng Wanzhou is about to return to China
- Equivalent circuits of components such as resistors, capacitors, inductors, and thyristors