ja-jp_commands:reference:ipiditermlimit
差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| ja-jp_commands:reference:ipiditermlimit [2026/09/07 21:53] – 만듦 - 바깥 편집 127.0.0.1 | ja-jp_commands:reference:ipiditermlimit [2026/09/14 20:30] (現在) – 外部編集 127.0.0.1 | ||
|---|---|---|---|
| 行 14: | 行 14: | ||
| ===== 使用例 ===== | ===== 使用例 ===== | ||
| + | |||
| + | MPINO-16A8R8TのA0アナログ入力を0~1023の生値として読み、PID計算に使用します。計算結果はシリアルモニタに表示するだけで、出力端子は駆動しません。接続するセンサに合わせてA0の電圧・電流設定を確認してください。 | ||
| <code cpp> | <code cpp> | ||
| - | bool IpidSet(uint8_t id, float kp, float ki, float kd, unsigned long sampleMs, float outMin, float outMax); | + | const uint8_t PID_ID = 0; |
| - | float IpidRun(uint8_t id, float pv, float sv); | + | |
| - | void IpidReset(uint8_t id); | + | void setup() { |
| - | void IpidReverse(uint8_t id, bool reverse); | + | Serial.begin(115200); |
| - | void IpidItermLimit(uint8_t id, float iMin, float iMax); | + | |
| - | float IpidOutput(uint8_t id); | + | |
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | const float currentValue = analogRead(A0); // A0のADC生値を読み出します。 | ||
| + | const float result = IpidRun(PID_ID, currentValue, 512.0F); // A0の生値と目標値512からPID出力を計算します。 | ||
| + | | ||
| + | delay(100); | ||
| + | } | ||
| </ | </ | ||
| 行 32: | 行 42: | ||
| * '' | * '' | ||
| * 同じ'' | * 同じ'' | ||
| + | |||
| + | ===== 同じカテゴリの内蔵コマンド ===== | ||
| + | |||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| [[: | [[: | ||
ja-jp_commands/reference/ipiditermlimit.1788785590.txt.gz · 最終更新: by 127.0.0.1
