Coder Social home page Coder Social logo

rubinsteina13 / c_space_vector_transfs_lib Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 35 KB

C-library with various space-vector transformation implementations

License: MIT License

C 41.90% C++ 58.10%
c embedded-c emdedded motor-control power-electronics

c_space_vector_transfs_lib's Introduction

C-library with implementation of the various space-vector transformations

This embedded C-library provides the various types of space-vector transformation:

  • Clarke transformations

    • Forward full (ABC to Alpha-Beta)
    • Forward reduce (AB to Alpha-Beta) in case when A + B + C = 0
    • Backward (Inverse) full (Alpha-Beta to ABC)
    • Backward (Inverse) reduce (Alpha-Beta to AB) in case when A + B + C = 0
  • Park transformations

    • Forward (Alpha-Beta to DQ)
    • Backward (Inverse) (DQ to Alpha-Beta)
  • Project structure

    • README.md - current file
    • LICENSE - file with license description
    • vector_transfs.h - C-header file with user data types and function prototypes
    • vector_transfs.c - C-source file with firmware functions

HowToUse (example)

  • Example 1 - Inverse Full Clarke transformation

      #include "vector_transfs.h"
    
      // updatable user variables:
      float al, be, a, b, c;
      		
      // 1st step: create and initialize the global variable of user data structure
      tIFClarke sIFClarke = IF_CLARKE_DEFAULTS;
    
      // 2nd step: Next code must be executed every time a new calculation of a, b, c is needed
      sIFClarke.fAl = al;               // set Alpha input
      sIFClarke.fBe = be;               // set Beta input
      sIFClarke.m_albe2abc(&sIFClarke); // call the Inverse Full Clarke transformation function
      a = sIFClarke.fA;                 // update the a variable
      b = sIFClarke.fB;                 // update the b variable
      c = sIFClarke.fC;                 // update the c variable
    
  • Example 2 - Forward Park transformation

      #include "vector_transfs.h"
      #include <math.h>
    
      // updatable user variables:
      float al, be, d, q, angle;
      		
      // 1st step: create and initialize the global variable of user data structure
      tFPark sFPark = F_PARK_DEFAULTS;
    
      // 2nd step: Next code must be executed every time a new calculation of d, q is needed
      sFPark.fAl = al;                  // set Alpha input
      sFPark.fBe = be;                  // set Beta input
      sFPark.fSinAng = sinf(angle);     // calculate sine
      sFPark.fCosAng = cosf(angle);     // calculate cosine
      sFPark.m_albe2dq(&sFPark);        // call the Forward Park transformation function
      d = sIFClarke.fD;                 // update the d variable
      q = sIFClarke.fQ;                 // update the q variable
    

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.