ステッピングモータードライバA4988 を試す
ステッピングモータードライバA4988を試します。
A4988
ステップと回転方向のシンプルな制御方式 5段階のステップ解像度:full-step, half-step, quarter-step, eighth-step, and sixteenth-step 電流調整機能によりボリューム操作で最大出力電流を設定可能。 インテリジェントチョッピング制御が自動的に正しい電流減衰モードを選択(高速減衰/低速減衰) 過熱シャットダウン、低電圧ロックアウト、クロス電流保護機能 接地短絡および負荷短絡保護機能
スイッチサイエンスから購入
ステッピングモータードライバA4988 - スイッチサイエンス
モーター
仕様 ・2相バイポーラ ステッピングモータ ・推奨動作電圧:DC12V ・ステップ数:200ステップ(1.8度) ・電流:0.33A/相 ・シャフト径:5mm ・シャフト長さ:24mm(方軸) ・コイル抵抗:34Ω ・重量:200g ・保持トルク:0.23N・m ・絶縁抵抗:100MΩ以上(500VDC) ・サイズ:42(W)x42(H)x34(D)mm
配線
モーターを 100μF のコンデンサでつなぐ。
出力電流の調整
可変抵抗を調整することで、モーターに流れる最大の電流を設定できるようです。
Pololu - MP6500 Stepper Motor Driver Carrier, Digital Current Control
Current limiting
を読む
基板に乗っている抵抗?によって、式は変わる。
[0.05Ω] Current Limit = VREF × 2.5 [0.10Ω] Current Limit = VREF × 1.25 [0.20Ω] Current Limit = VREF × 0.625
測定電圧=可変抵抗とGNDの電圧差
どうやら、モータにながれる最大電流=測定電圧 x 2.5
0.33A にする場合には、0.132 と調整すればいい?
プルプルする
何もしていないの状態で、勝手に動いたりします。
ノイズが原因ではないかと思います。
STEPとDIRをそれぞれ 1kΩ でプルアップするとう方法を見つけやってみたところ、たしかに安定する。
プログラミング
制御方法がよくわかってない。
こちらを使用しました。
ステッピングモーター + Raspberry Pi ② モーター使いの第一歩「動いた・・・」 | ☆世界が変わる☆
#!/usr/bin/python # coding: utf-8 import RPi.GPIO as GPIO import time import sys stepPin = 22 dircPin = 17 enabPin = 23 GPIO.setmode(GPIO.BCM) # GPIOで指定 GPIO.setup(enabPin, GPIO.OUT) # 2:Enableに定義 GPIO.setup(dircPin, GPIO.OUT) # 3:Dir GPIO.setup(stepPin, GPIO.OUT) # 4:Step #GPIO.setup(17, GPIO.OUT)#17:MS1 #GPIO.setup(27, GPIO.OUT)#27:MS2 #GPIO.setup(22, GPIO.OUT)#22:MS3 def main(): GPIO.output(enabPin, 0) time.sleep(0.5) #GPIO.output(17, 0) #GPIO.output(27, 0) #GPIO.output(22, 0) GPIO.output(dircPin, 0) for num in range(0,200): GPIO.output(stepPin, 1) time.sleep(0.001) GPIO.output(stepPin, 0) time.sleep(0.001) time.sleep(1) GPIO.output(dircPin, 1)# 逆回転 for num in range(0,200): GPIO.output(stepPin, 1) time.sleep(0.001) GPIO.output(stepPin, 0) time.sleep(0.001) time.sleep(1) GPIO.output(dircPin, 0) for num in range(0,100): GPIO.output(stepPin, 1) time.sleep(0.0005) GPIO.output(stepPin, 0) time.sleep(0.0005) GPIO.output(dircPin, 1)# 逆回転 for num in range(0,100): GPIO.output(stepPin, 1) time.sleep(0.0005) GPIO.output(stepPin, 0) time.sleep(0.0005) GPIO.cleanup() try: main() except KeyboardInterrupt: print('interrupted!') GPIO.cleanup()