top of page
Search

How to Generate Three-Phase Sine Wave in MATLAB

Introduction

We are going to explore how to generate a three-phase waveform in MATLAB. This tutorial will guide you through the steps to create a three-phase sine wave, including setting the amplitude, frequency, and phase angles.

Setting Up the Environment

To begin, open a new MATLAB window. Follow these steps to set up your working environment:

1. Open the Library BrowserÂ from the MATLAB menu.

2. Navigate to Sources.

3. Place the Sine WaveÂ block in the working area.

Configuring the Sine Wave Parameters

We will configure different parameters for the sine wave:

• Amplitude: Set to 1.

• Frequency: Set according to your requirements. For this example, we use 2Ï€Ã—12\pi \times 12Ï€Ã—1Â rad/s, which corresponds to a frequency of 1 Hz.

• Phase Angle: Set in radians.

Here is how to set these parameters in MATLAB:

1. Amplitude: Keep it as 1.

2. Frequency: Use 2Ï€Ã—f2\pi \times f2Ï€Ã—f, where fffÂ is the desired frequency in Hz. For example, 2Ï€Ã—12\pi \times 12Ï€Ã—1Â for 1 Hz.

3. Phase Angles: For a three-phase waveform, the phase angles should be 120 degrees apart. Convert these degrees to radians.

Introducing Phase Angles

To introduce phase shifts of 120 degrees for each waveform:

1. For the first sine wave, set the phase angle to 0 radians.

2. For the second sine wave, set the phase angle to âˆ’120360Ã—2Ï€\frac{-120}{360} \times 2\pi360âˆ’120â€‹Ã—2Ï€Â radians.

3. For the third sine wave, set the phase angle to 120360Ã—2Ï€\frac{120}{360} \times 2\pi360120â€‹Ã—2Ï€Â radians.

Combining the Three-Phase Waveforms

We need to combine these three waveforms using a MuxÂ block to visualize them together.

1. Use a MuxÂ block with three inputs.

2. Connect each sine wave to one input of the Mux block.

3. Add a ScopeÂ block to measure and display the combined waveform.

Simulating the Model

1. Connect the output of the Mux block to the Scope block.

2. Simulate the model to check the results. If the output is not as expected, adjust the Maximum Step SizeÂ in the configuration parameters.

1. Go to Configuration Parameters.

3. Set the Maximum Step SizeÂ to 1Ã—10âˆ’41 \times 10^{-4}1Ã—10âˆ’4.

4. Apply the changes and run the simulation again.

Visualization of the Three-Phase Waveform

After simulation, you should see a proper three-phase sinusoidal waveform on the scope. If needed, you can change the frequency and amplitude of the sine waves:

1. Frequency: Adjust the frequency parameter to your desired value (e.g., 50 Hz).

2. Amplitude: To change the amplitude dynamically, use a ProductÂ block to multiply the sine wave with a step signal.

Example: Varying Amplitude

To vary the amplitude during the simulation:

1. Add a StepÂ signal block.

2. Connect it to a ProductÂ block.

3. Configure the step signal to change amplitude at a specific time (e.g., from 1 to 0.5 at 0.1 seconds).

4. Connect the output of the Product block to the Mux block.

Simulate the model again to see the amplitude variation reflected in the three-phase waveform.

Conclusion

Generating a three-phase sine wave in MATLAB involves configuring sine wave parameters, introducing phase shifts, combining the waveforms, and visualizing them using a scope. This method can be extended by varying frequency and amplitude as required.