0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

サーボモーターが震える(ブルブルする)のを抑えるための方法(micro:bit)

Posted at
サーボモーターを使っているとたまに起きること

サーボモーターを使っていると本来止まっているべき時に震える(ブルブルする)ことがあります。
現象としては「ハンチング」と呼ぶそうですがなんとか防止したいものです。
無駄に動いているわけなので電気も無駄に使ってしまいます。

技術的には様々なアプローチがあると思いますが、とりあえず成功したのでここに記します。

サンプルコード

シンプルにサーボモーターへの出力を切るという解決策です。
一時停止のブロックを入れていますがこれを入れないとサーボ出力直後に出力を切ってしまい、サーボモーターが動きません。
100ミリ秒=0.1秒程度が丁度良いようです。

image.png

下記のリンクから入手可能です
https://makecode.microbit.org/S32938-83459-09148-16134

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?