APPLICATIONS AND EXAMPLES
5.1 Applications
RTS can be used for following experiments and research application along with additional requirement as given below:
5.2 nimēṣa RTS Library
RTS software is integrated in MATLAB so all commonly used blocks, mathematical operators, all discrete system blocks, and functions of MATLAB simulation can be directly used in the RTS simulation. This saves you time rebuilding these for your RTS simulation. RTS as a real time interface also having certain additional special purpose inbuilt blocks which facilitate the simulation and improve efficiency. RTS library includes custom bocks made specially to do the different simulations using RTS controller in MATLAB.
Some Custom Blocks are used in RTS library are following:
GUI Interface Blocks:
These blocks allow you to create a graphical user interface (GUI) within your simulation. This GUI could be used for things like:
-
Visualizing simulation data in real-time.
-
Providing user input to control or modify the simulation during runtime.
Analogue System Blocks:
These blocks are pre-built components that represent analogue systems or functionalities commonly used in real-time simulations. Examples include:
- Filters (low-pass, high-pass, etc.)
- Integrators
- Differentiators
- Operational amplifiers (op-amps)
Digital System Blocks
Similar to analogue system blocks, these digital blocks represent pre-built components for digital systems, such as:
- Logic gates (AND, OR, NOT, etc.)
- Flip-flops (D flip-flop, JK flip-flop, etc.)
- Counters
- Timers
Quad PWM (Pulse Width Modulation):
This block generates a Pulse Width Modulation (PWM) signal with four outputs. PWM signals are commonly used for controlling devices like motors or LEDs by varying the on and off time of a pulse. Having four outputs allows for controlling multiple devices simultaneously.
Data Conversion (cast)
This block performs data type conversion between different data formats used in the simulation. For
example, converting an integer to a floating-point number or vice versa.
Discrete Sine Wave
A continuous sine wave is a smooth, undulating signal defined for all points in time whereas a discrete sine wave represents a sine wave at specific points in time, like snapshots. It's similar to the concept of taking a picture of a moving wave.
-
Using Discrete Sine Waves in RTS
-
Real-time simulations often deal with discrete data because they interact with the real world, which operates in steps.
-
A discrete sine wave is a useful way to represent periodic signals like sound or vibration in an RTS simulation.
-
Parameterizing a Discrete Sine Wave
The equation you'll likely encounter for a discrete sine wave in an RTS simulation with sampling time Ts (capital T, small s) is:
x(n) = A * sin(2pifnTs + phi)
Where: * x(n) is the value of the sine wave at the nth sample (discrete time step). * A is the amplitude of the sine wave (how high or low it swings). * f is the frequency of the sine wave in Hz (cycles per second). * n is the integer representing the sample number (0 for the first sample, 1 for the second, and so on). * Ts is the sampling time in seconds (the time between each sample). * phi (phi) is the phase shift of the sine wave in radians (how much it's horizontally offset).
Key Points:
- The term 2pifnTs calculates the angle in radians for each sample based on frequency and
- The sine function takes this angle as input and outputs the corresponding amplitude value at that
Using This Information in Simulink:
- In Simulink, you can use the "Sine Wave" block to generate a discrete sine wave.
- You can set the block's parameters for amplitude, frequency, and phase to match the equation mentioned above.
- The sampling time (Ts) is typically determined by the requirements of your real-time system and the desired accuracy of the simulation.
5.3 Loop Back Test
Objective
Verify the functionality of Digital-to-Analog Converter (DAC) and Analog-to-Digital Converter (ADC) ports (DAC-13, ADC-1, DAC-16) using a sine wave test signal.
Test Setup
- Internal Signal Generation: A sine wave is generated within the Real-Time Simulation (RTS) environment.
- DAC-13 Output: This internally generated sine wave is fed as the output signal for DAC-13.
- Physical Connection: The output pin of DAC-13 is physically wired to the input pin of ADC-1. This creates a direct analogue connection between the two ports.
- Internal Loopback (Simulation): Within the RTS environment, the output of ADC-1 is routed back to DAC-16.
- DSO Monitoring: The output of DAC-16 is connected to a Digital Storage Oscilloscope (DSO). This allows us to visualize the final signal on the oscilloscope.
Test Verification
nimēṣa REAL TIME SYSTEM Controller v3.0 By observing the signal on the DSO, we can verify if all three ports are functioning correctly. Since the same sine wave generated internally gets converted to analogue by DAC-13, captured by ADC-1, converted back to digital by ADC-1, and finally output as an analogue signal by DAC-16, we expect to see the identical sine wave on the DSO.
Benefits
- This test offers a quick and efficient way to confirm the basic functionality of the DAC and ADC ports.
- It helps identify any potential issues with the conversion process between digital and analogue signals. Additional Considerations
- While this test provides a basic check, more comprehensive testing might involve analysing signal fidelity, noise levels, and dynamic range of the converters.
- The specific test procedures and equipment used may vary depending on the specific application and hardware being tested.
5.4 Sensor Calibration
5.4.1 Calibration of Voltage Sensor for RTS ADC-4 Port
When calibrating a voltage sensor with an output range of ±10V, it's important to ensure the sensor's output is accurately read by the ADC port of the RTS (Real-Time System). Here, we will discuss the calibration process using the ADC-4 port as an example.
1. Understanding the Bias
nimēṣa REAL TIME SYSTEM Controller v3.0 At zero input voltage, the voltage sensor's output shows a bias on the RTS scope. This bias is an offset that must be accounted for to ensure accurate readings. In this example, the bias value is 2380.
2. Compensating for the Bias
To compensate for the bias in the RTS simulation, the bias value is subtracted from the sensor's output across the entire range of measurements. This ensures that the sensor reads zero when the input voltage is zero.
3. Adjusting the Gain
After bias compensation, the gain of the sensor can be adjusted. The gain adjustment aligns the sensor's
output to the actual input voltage. In the example provided, a reference input voltage source is used to
determine the gain multiplier. The multiplier is calculated based on the reference input and the sensor's
response. Here, the multiplier is 15/6640.
4. Calibration Process
Here is the detailed calibration process step-by-step:
1. Determine Bias:
- Connect the voltage sensor to the ADC-4 port of the RTS.
- Set the input voltage to zero.
- Record the output value on the RTS scope. In this case, the output value (bias) is 2380.
2. Subtract Bias:
- Subtract the recorded bias value from the sensor's output in all measurements to compensate for the offset.
3. Adjust Gain:
- Apply a known reference input voltage to the sensor.
-
Record the output value from the sensor after bias compensation.
-
Calculate the gain multiplier. In this example, if the reference voltage is 15V and the output after bias compensation is 6640, the multiplier is calculated as:
𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑒𝑟 =𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑉𝑜𝑙𝑡𝑎𝑔𝑒/𝑂𝑢𝑡𝑝𝑢𝑡 𝑎𝑓𝑡𝑒𝑟 𝐵𝑖𝑎𝑠 𝐶𝑜𝑚𝑝𝑒𝑛𝑠𝑎𝑡𝑖𝑜𝑛 = 15/6640
4. Apply Multiplier:
- Multiply the bias-compensated sensor output by the calculated gain multiplier to get the final calibrated voltage reading.
By following these steps, the voltage sensor's output can be accurately calibrated to reflect the true input voltage, ensuring reliable and precise measurements in the RTS system.
5.4.2 Current Sensor Calibration for RTS ADC-3 Port
Calibrating a current sensor with an output range of ±10V involves ensuring that the sensor's output is accurately read by the ADC port of the RTS (Real-Time System). Below is the calibration process shown using ADC-3 port as an example.
- Understanding the Bias When no current flows through the sensor (zero input current), the sensor might still output a non-zero voltage due to inherent biases. This bias must be accounted for to achieve accurate readings. In this example, the bias value is 12.5.
- Compensating for the Bias to address the bias in the RTS simulation, subtract the bias value from the sensor's output across the entire range of measurements. This ensures that the sensor reads zero when there is no current flow.
- Adjusting the Gain After bias compensation, adjust the gain of the sensor. Gain adjustment aligns the sensor's output to the actual input current. In this example, a reference input current source is used to determine the gain multiplier. The multiplier is calculated based on the reference input and the sensor's response. Here, the multiplier is 5/1527.
-
Importance of Regular Calibration It's important to note that bias and multiplier values are not fixed. Regular calibration of Hall Effect sensors is necessary because the performance of magnetic sensors can change with environmental conditions and over time.
-
Calibration Process
a) Determine Bias:
Connect the current sensor to the ADC-3 port of the RTS. Ensure no current flows through the sensor. Record the output value on the RTS scope. In this example, the output value (bias) is 12.5.
b) Subtract Bias:
Subtract the recorded bias value from the sensor's output in all measurements to compensate for the offset.
c) Adjust Gain:
Apply a known reference current to the sensor. Record the output voltage from the sensor after bias compensation. Calculate the gain multiplier. In this example, if the reference current is 5A and the output after bias compensation is 1527, the multiplier is calculated as:
𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑒𝑟 =𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝐶𝑢𝑟𝑟𝑒𝑛𝑡 / 𝑂𝑢𝑡𝑝𝑢𝑡 𝑎𝑓𝑡𝑒𝑟 𝐵𝑖𝑎𝑠 𝐶𝑜𝑚𝑝𝑒𝑛𝑠𝑎𝑡𝑖𝑜𝑛 = 5/1527
d) Apply Multiplier:
Multiply the bias-compensated sensor output by the calculated gain multiplier to get the final calibrated current reading.
-
Example Summary
Bias Value: 12.5
Reference Current: 5A
Output after Bias Compensation: 1527
Multiplier: 5152715275
-
The current sensor's output can be accurately calibrated to reflect the true input current, ensuring reliable and precise measurements in the RTS system. Regular calibration is necessary to maintain accuracy due to potential changes in sensor performance over time and varying environmental conditions.
5.5 Servo Drive Control through RTS
This example is to understand the configuration and to effectively apply wave functions to the analogue input port X32 of drive system using the DAC output port of the RTS.
-
Identify the Analog Input Port X32: In the drive system, locate the specific analog input port labelled X32. This is where external analog signals can be input into the drive for processing.
-
Configure the RTS DAC: Set up the Digital-to-Analog Converter (DAC) of the Real-Time Simulator (RTS) to match the requirements of the analog input port X32. This involves configuring parameters such as voltage range, resolution, and any necessary filtering to ensure compatibility.
-
Generate Wave Functions: Within the RTS simulation environment, generate the desired wave functions according to the system requirements. These wave functions could represent various types of signals such as sine waves, square waves, or custom waveforms tailored to your specific application needs.
-
Apply Wave Functions to Analog Input Port X32: Utilize the DAC output port of the RTS to apply the generated wave functions to the analog input port X32 of the drive. Connect the output of the RTS to the X32 port of the drive to transmit the analog signals.
-
Adjust Parameters as Needed: Monitor the response of the drive system to the applied wave functions. Depending on the system's feedback and performance requirements, adjust parameters such as signal amplitude, frequency, or waveform shape as necessary.
-
Test and Validate: Perform comprehensive testing to ensure that the drive system responds appropriately to the applied wave functions. Validate that the system behaviour meets the desired performance specifications and functional requirements.
-
Document the Procedure: Document all configuration settings, wave function specifications, and any adjustments made during testing for future reference and troubleshooting purposes. This documentation ensures clarity and assists in replicating the procedure if needed in the future.
Drive On-board Important connection points
- X3, mains connection
- X4, motor encoder connection
- X5, Motor Connection
- X13, 24V Supply (Control Voltage)
- X24 P2, X25 P1, Communication: This port is connected to RTS through Ethernet.
- X31, Digital Inputs, Digital Output
- X32, analog input: This port is connected to enable DAC port of RTS.