Voltecx is in beta. The macOS build comes first; Windows and Linux packages are still being tested.Beta. macOS comes first; Windows and Linux are still in testing. What's new
Documentation

Angle Generator (angle)

Turns an electrical speed into an angle that wraps around.

angle

Component reference · 繁體中文

Group: Control · Kind: {"block":"angle","kind":"control"}

When to use it

Use it to make the electrical angle for the Park blocks from a speed, or as the core of a phase-locked loop.

Pins

Pin Domain Meaning
w signal Electrical speed in rad/s
theta signal Angle in radians, wrapped to one turn

Common parameters

  • theta0: Angle at the start (Default: 0)

Parameters

Key Unit Default Typical range Description
theta0 rad 0 Angle at the start

Parameter descriptions are in English in both languages.

Model

The output is theta = theta0 + integral(w dt), integrated with the trapezoidal rule and wrapped to 0 ... 2*pi. The value theta0 is the angle at t = 0 in radians. The block has no direct feedthrough, so it breaks loops with no delay, and a phase-locked loop closes through it.

Common mistakes

  • The input is a speed in rad/s, not a frequency in Hz, so multiply a frequency by 2*pi. For a machine it is the electrical speed, so multiply a mechanical speed by the number of pole pairs first, for example with a Gain.
  • The angle starts at theta0, so for a machine that starts at rest it must match the machine and sensor start angle, or d and q are misaligned from the first step. The angle is only as accurate as the speed, so drift in the speed makes the angle error grow.
  • Because it has no direct feedthrough, the solver may read the speed one step late. Keep the maximum step well below the electrical period.

Datasheet and sources

No datasheet applies. The speed comes from a sensor or your slip calculation in electrical rad/s, and theta0 is the starting angle of the d axis, equal to theta0 of the machine and the sensor.

Example

Open the example with the command file.openExample and the name demo:angle.


Generated by cargo xtask reference from the usage texts and parameter specs. Do not edit by hand.