Approved content

The content below is provided by a partner.

Microsoft/pxt-automation 0.0.3 GitHub

Automation Build Status

Various algorithm for Systems & Control operations for Microsoft MakeCode editors.

How to use this library?

In your MakeCode editor, click on the gearwheel menu and click “Extensions”, search for “automation” and select this project.

PID controller

A Proportional-Integral-Derivative control is a classic control structure in automation. The user needs to define 3 gains (Kp, Ki, Kd) to tune the controller.

See Reference: Feedback System, Karl Johan Astrom & Rickard M. Murry

let v = 0;
automation.pid1.setGains(1, 0.01, 0.001);
for (let i = 0; i < 10; ++i) {
    v = automation.pid1.compute(0.1, 5);
}

Behaviors

An example of Behavior-based robotics control system.

Moving Average Filter

let r = 0;
for (let i = 0; i < 10; ++i) {
    r = automation.movingAverageFilter1.filter(Math.random());
}

Supported targets

License

MIT

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

automation=github:Microsoft/pxt-automation#v0.0.3