Skip to the content
2 layers41.5 × 27.6 mmGP Encoder Tran, the printed circuit board in 3D

This project implements and tests a Field-Oriented Control (FOC) system for a Permanent Magnet Synchronous Motor (PMSM).

Size
41.5 × 27.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
27
Pads
74
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 9.0 (file 20241229)
Created
22 Jul 2026
Updated
10 Aug 2026

Overview

GP Encoder Tran is an open-source printed circuit board by Ahmedyasser572, from the Ahmedyasser572/Graduation_project_Field_Oriented_Control_For_PMSM repository on GitHub. It is a 2-layer board of 41.5 × 27.6 mm with 14 parts on 27 nets.

It is built around the AM26LS32ACDRE4, AMS1117-3.3 and TXS0108EPW. Its parts include 5 resistors, 4 capacitors, 3 ICs and 2 connectors.

Main components

3

README

README.md

Field-Oriented Control for a PMSM

This project implements and tests a Field-Oriented Control (FOC) system for a Permanent Magnet Synchronous Motor (PMSM). The project combines MATLAB/Simulink motor-control models with Texas Instruments C2000 embedded-controller tests and hardware experiments.

The control system includes:

  • Cascaded speed and current control loops
  • Clarke and Park transformations
  • Inverse Park transformation
  • Space Vector PWM (SVPWM)
  • Rotor-position feedback from an encoder
  • Phase-current and DC-link voltage sensing
  • PI-controller anti-windup protection
  • Simulation, inverter testing, and C2000 deployment support

Repository Structure

DirectoryPurpose
FOC/Main FOC and PMSM Simulink models, simulation scripts, and generated model files
Final_model_in_production/Production versions of the control models and generated code artifacts
inverter Model/SVPWM/SPWM inverter models and inverter communication files
Motor_Model_mathmatical/Mathematical motor-model development files
C2000_tests/Embedded tests for the ADC, encoder, LEDs, and telemetry viewer
Differential_Reciever_PCB/PCB-related files for the differential receiver and encoder interface
presentation/Project presentation material

Requirements

Simulation

  • MATLAB and Simulink
  • Motor Control Blockset
  • A MATLAB release compatible with the included .slx models

Hardware Deployment

  • Texas Instruments Code Composer Studio (CCS)
  • C2000Ware SDK
  • A supported TI C2000 microcontroller and development board
  • PMSM, inverter, encoder, current sensors, and DC-link voltage-sensing hardware

Hardware work involves dangerous voltages and rotating machinery. Use suitable protection, current limits, emergency-stop equipment, and qualified supervision.

Getting Started

  1. Clone or download this repository.
  2. Open MATLAB and set the repository root as the current folder.
  3. Add the relevant model directory to the MATLAB path, for example FOC/ or Final_model_in_production/.
  4. Open the required Simulink model.
  5. Run the matching initialization or tuning script before starting the simulation.
  6. Check the motor parameters, controller gains, sampling time, sensor scaling, and inverter limits.
  7. Run the simulation and inspect the scopes and generated plots.

Main Models and Scripts

The exact model depends on the experiment. Common entry points include:

  • FOC/FOC_physical_2.slx — FOC model
  • FOC/FOC_physical_2_prototybe.slx — prototype FOC model
  • FOC/PMSM_Model.slx — PMSM model
  • FOC/Communication.slx — communication model
  • FOC/Model_Calculations.m — model calculations and parameter preparation
  • FOC/FOC_physical_2_Testing_mathmatical.slx — mathematical-model testing
  • inverter Model/SVPWM_inverter.slx — SVPWM inverter model

Production models are kept in Final_model_in_production/. Use the corresponding initialization and tuning files in the same directory when working with those models.

Simulation Checks

During simulation, verify the following signals:

  • Rotor speed and speed-reference tracking
  • $d$-axis and $q$-axis current responses
  • Phase currents and current limits
  • DC-link voltage
  • SVPWM duty cycles and phase voltages
  • PI-controller saturation and anti-windup behavior
  • Encoder angle and electrical-angle calculations

Start with a low-speed, low-voltage test case and increase the operating point gradually. Confirm that the duty cycles, currents, and controller outputs remain within safe limits.

C2000 Hardware Deployment

  1. Open the appropriate C2000 test project from C2000_tests/ in CCS.
  2. Configure the target device, clock, ADC channels, PWM outputs, encoder interface, and serial/telemetry settings.
  3. Verify the sensor wiring and signal polarity before connecting the inverter.
  4. Build the project in CCS.
  5. Connect the debugger and flash the generated program to the C2000 controller.
  6. Test the ADC, encoder, PWM, and communication interfaces separately.
  7. Enable the motor-control loop only after the individual hardware tests pass.
  8. Monitor the system using the telemetry viewer and stop immediately if current, speed, or voltage exceeds the configured limits.

Safety

This project controls a motor inverter and may use hazardous DC-link voltages. Before applying power:

  • Inspect all high-voltage and phase connections.
  • Confirm that the emergency stop works.
  • Use current limiting and appropriate fuses.
  • Keep clear of the rotating motor and coupling.
  • Validate PWM dead time and gate-driver behavior.
  • Never connect or disconnect motor phases while power is applied.
  • Test new firmware with the lowest practical voltage and speed.

Troubleshooting

ProblemThings to check
Simulation does not startMATLAB path, required toolboxes, initialization script, and model compatibility
Motor current is incorrectSensor offset, sensor scaling, phase order, Clarke/Park angle, and ADC configuration
Motor rotates in the wrong directionEncoder direction, electrical-angle offset, phase sequence, and sign conventions
PWM output is unstableDC-link measurement, controller gains, sampling time, saturation, and dead time
Hardware build failsCCS project settings, C2000Ware installation, target device, and generated-code configuration
Telemetry data is missingUART/IPC configuration, baud rate, signal mapping, and TelementaryViewer/ settings

Team

  • Ahmed Samy Mohamed Hagag
  • Ahmed Maged Salah El-sayed
  • Ahmed Yasser Mohamed Gamaleldin El Sadiq
  • Mohamed Reda ELSayed Mahmoud ELSherbiny
  • Mohamed Wagih El Sayed Sayed Ahmed
  • Mostafa Ahmed Mohamed Amin
  • Wael Mohamed Abdelhalim Moubark
  • Youssef Ahmed Hassan Abdelkader

Supervisors: Dr. Mohamed Fekry, Dr. Mahmoud Gamil

Institution: Zagazig University, Faculty of Engineering

Parts

14
QtyValueFootprintReferences
4100Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR101, R102, R103, R104
2100nFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC102, C103
210uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC101, C104
110kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR105
1AM26LS32ACDRAM26LS32ACDR:SOIC-16_L9.9-W3.9-P1.27-LS6.0-BLU101
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U102
1Conn_01x06_PinConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ102
1Conn_01x10_PinConnector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalJ101
1TXS0108EPWPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU103

Similar boards

  • 4 layers148.8 × 100 mmMotherboard, the printed circuit board in 3D

    Motherboard

    RisottoRis8/Breath_Simulator

    Progetti Ing Biomed

    111 parts1
  • 2 layers94.5 × 74.4 mmAx58100-stm32-ethercat, the printed circuit board in 3D

    Ax58100-stm32-ethercat

    MetalMusings/MyOwnEtherCATDevice

    Documentation accompanying the "Make My Own EtherCAT device" video serie on Youtube.

    184 parts93
  • 2 layers72 × 45 mmBrizer ZigBee, the printed circuit board in 3D

    Brizer ZigBee

    kvazimoda24/TionO2-ZigBee

    Ядром проекта является микроконтроллер ATmega328P. Для работы по протоколу ZigBee используется модуль E18-MS1-PCB.

    48 parts10
  • 2 layers67.3 × 74.5 mmVgm teensy, the printed circuit board in 3D

    Vgm teensy

    ldursw/vgm-player

    Hardware music player for YM2612 and SN76489

    41 parts7GPL-3.0
  • 2 layers100 × 50 mmEspled, the printed circuit board in 3D

    Espled

    Yottabits/espled

    THE one and only esp8266 LED Controller

    52 parts6
  • 2 layers190.5 × 158.4 mm68k dev, the printed circuit board in 3D

    68k dev

    maded2/68000

    68000 Retro computer with Amiga Chipset

    84 parts4Apache-2.0

Questions

How big is the GP Encoder Tran PCB?

It measures 41.5 × 27.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the GP Encoder Tran use?

14 parts, built around the AM26LS32ACDRE4, AMS1117-3.3 and TXS0108EPW. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the GP Encoder Tran KiCad files?

From the Ahmedyasser572/Graduation_project_Field_Oriented_Control_For_PMSM repository on GitHub, at the commit this page was made from: the board is Differential_Reciever_PCB/GP_Encoder/GP_Encoder_Tran/GP_Encoder_Tran.kicad_pcb and its schematic Differential_Reciever_PCB/GP_Encoder/GP_Encoder_Tran/GP_Encoder_Tran.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the GP Encoder Tran design in my own project?

Its repository states no licence, so its author keeps all rights: ask Ahmedyasser572 before reusing the design.