All pastes #335152 Raw Edit

Anonymous

public text v1 · immutable
#335152 ·published 2007-02-01 04:05 UTC
rendered paste body
component clarke2 "Two input version of Clarke transform";
description "The Clarke transform can be used to translate a vector \
quantity from a three phase system (three components 120 degrees \
apart) to a two phase Cartesian system.\n.P\n\\fBclarke2\\fR implements \
a special case of the Clarke transform, which only needs two of the \
three input phases.  In a three wire three phase system, the sum of the \
three phase currents or voltages must always be zero.  As a result only \
two of the three are needed to completely define the current or voltage. \
\\fBclarke2\\fR assumea that the sum is zero, so it only uses phases A and \
B of the input.  Since the H (homopolar) output will always be zero in \
this case, it is not generated.";
see_also "\\fBclarke3\\fR for the general case, \\fBclarkeinv\\fR for \
the inverse transform.";
pin in float a;
pin in float b;
pin out float x;
pin out float y;
function _;
;;
MODULE_LICENSE("GPL");

/* for the derivation, google "clarke park transform", or 
   read section 3 of http://focus.ti.com/lit/an/bpra048/bpra048.pdf */

#define K1 0.577350269  /* 1/sqrt(3) */
#define K2 1.154700538  /* 2/sqrt(3) */

FUNCTION(_) {
    x = a;
    y = K1 * a + K2 * b;
}