ラベル M5StickC の投稿を表示しています。 すべての投稿を表示
ラベル M5StickC の投稿を表示しています。 すべての投稿を表示

2022年4月1日金曜日

M5StickCとサーボでバランスロボ

 倒立振子を研究されている n_shinichi さんとのやり取りの中で、思いついたバランスロボです。M5StickCと連続回転サーボと車輪だけの構成です。

 サーボはFS90R、車輪は「ちっちゃいものくらぶ」のプーリー+Oリングです。 


 

裏側です。サーボの電源はM5StickCの5V出力を使っていますが、BATから取ったほうがよいかもしれません(試してません)。


ビデオです。


回路図です。(2022/6/4 追加)


ソースコードはこちら。


2021年7月28日水曜日

M5StickC Clock Auto Tuner

M5StickC (ESP32) controls the accuracy of a small pendulum clock.  The pendulum has a small magnet attached to it.  The CPU detects pendulum vibration with a Hall sensor (A3144), and determines the rate of the clock.  It then compares with the internet time, and depending on the difference, the coil under the pendulum pulls down or push up the pendulum.  This has the same effect as adjusting the gravity.


Here is the close-up of pendulum, magnet, coil and Hall sensor.

 

The accuracy chart of the clock displayed on the M5StickC.


The chart below shows accuracy and current for about 4 hours.  The blue line is clock accuracy (left scale in seconds).  Once it gets stable, the deviation is within +/- 0.2 seconds.  The red line is relative coil current.  As the clock's mainspring gets unwound, the coil current is gradually changing.



Below is the schematic diagram.  The clock has a tiny pendulum which weighs only 3.3 grams including the magnet, thus does not require much magnetic force to change cycle time.  So the coil is connected directly to the M5StickC GPIO with a series resistor of 100ohm.


Here is the video.  The clock accuracy chart and the relative coil current chart are alternating every 5 seconds.