This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 3 years have passed since last update.

5.c. Motors and Gearboxes (Pololu 3pi Robot User’s Guide) 日本語訳【非公式】

Last updated at Posted at 2019-12-31

これは Pololu 3pi Robot User’s Guide ≫ 5.c. Motors and Gearboxes の非公式日本語訳です。
目次
前: 5.b. Power management
次: 5.d. Digital inputs and sensors

5.c. Motors and Gearboxes

画像
A typical small brushed DC motor, with no gearbox.

A motor is a machine that converts electrical energy to motion. There are many different kinds of motors, but the most important for low-cost robotics is the brushed DC motor, which is the type used on the 3pi. A brushed DC motor typically has permanent magnets on the outside and several electromagnetic coils mounted on the motor shaft (armature). The “brushes” are sliding pieces of metal that switch the power from one coil to the next as the shaft turns so that magnetic attraction between the coil and the magnets continuously pulls the motor in the same direction.

モーターは電気エネルギーを運動に変換する機械です。モーターの種類は様々ですが、低コストのロボット工学で最も重要なのは、3piでも使用されているブラシ付きDCモーターです。ブラシ付きDCモーターは、通常、外側に永久磁石があり、モーターシャフト(電機子)上にいくつかの電磁コイルが取り付けられています。"ブラシ"は、シャフトの回転にあわせて電力をあるコイルから次のコイルへと切り替える、滑る金属部品です。そのため、コイルと磁石の間の磁力はモーターを絶えず同じ方向に引っ張ります。

The primary values that describe a running motor are its speed, measured in rpm, and its torque, measured in kg·cm or oz·in (pronounced “ounce-inches”). The units for torque show the dependence on both force and distance; for example, a motor that produces 6 oz·in of torque can product a force of 6 oz. with a 1-inch lever arm, 3 oz. with a 2-inch lever, and so on. Multiplying the torque and speed (measured at the same time) give us the power delivered by a motor. We see, therefore, that a motor with twice the speed and half the torque as another has the same power output.

駆動しているモーターを説明する最初の値は、rpmで測定される速度と、kg・cmやoz・in(オンスインチと発音)で測定されるトルクです。トルクの単位は力と距離の両方に依存することを示しています。例えば、6oz・inのトルクを生み出すモーターは、1inのレバーアームで6oz、2inのレバーアームで3ozなどの力を生み出します。(同時に測定された)トルクと速度の掛け算はモーターによって伝えられる力が得られます。従ってあるモーターとそのモーターの2倍の速度と半分のトルクをもつモーターは同じ力を出力します。

Every motor has a maximum speed (when no force is applied) and a maximum torque (when the motor is completely stopped). We call these the free-running speed and the stall torque. Naturally, a motor uses the least current when no force is applied to it, and the current drawn from the batteries goes up until it stalls, so the free-running current and stall current are also important parameters characterizing the motor. The stall current is usually much higher than the free-running current, as shown in the graph below:

あらゆるモーターには最高速度(力が加えられていないとき)と最大トルク(モーターが完全に停止しているとき)があります。これらはフリーラン速度とストールトルクと呼びます。もちろん、モーターは力が加えられていない時は最小の電流を消費し、バッテリから出る電流はストールするまで上昇します。そのため、フリーラン電流とストール電流もモーター特性の重要なパラメタです。以下のグラフに示すように、通常、ストール電流はフリーラン電流よりもはるかに大きいです。

画像
Motor operation: current and speed vs. torque.

The free-running speed of a small DC motor is usually many thousands of rotations per minute (rpm), much higher than the speed we want the wheels of a robot to turn. A gearbox is a system of gears that converts the high-speed, low-torque output of the motor into a lower-speed, higher-torque output that is a much better suited for driving a robot. The gear ratio used on the 3pi is 30:1, which means that for every 30 turns of the motor shaft, the output shaft turns once. This reduces the speed by a factor of 30, and (ideally) increases the torque by a factor of 30. The resulting parameters of the 3pi motors are summarized in this table:

小型DCモーターのフリーラン速度は、通常、数千回転/分(rpm)であり、ロボットの車輪に回転させたい速度よりも速度よりもはるかに高速です。ギアボックスは、高速で低トルクのモーター出力を低速で高トルクの出力(=ロボットの駆動用に適しています)に変換するギアのシステムです。3piに使われているギア比は30:1です。つまり、モーターシャフトが30回転する毎に出力シャフトは1回転します。これは速度が30分の1に減少し、(理想的には)トルクが30倍に増加します。3piのモーターのパラメタは次の表にまとめられます。

画像
The 30:1 gearmotor used on the 3pi.

パラメタ
Gear ratio (ギア比) 30:1
Free-running speed (フリーラン速度) 700 rpm
Free-running current (フリーラン電流) 60 mA
Stall torque (ストールトルク) 6 oz·in
Stall current (ストール電流) 540 mA

The two wheels of the 3pi each have a radius of 0.67 in, which means that the maximum force it can produce with two motors when driving forward is 2×6/0.67 = 18 oz. The 3pi weighs about 7 oz with batteries, so the motors are strong enough to lift the 3pi up a vertical slope or accelerate it at 2 g (twice the acceleration of gravity). The actual performance is limited by the friction of the tires: on a steep enough slope, the wheels will slip before they stall – in practice, this happens when the slope is around 30-40°.

3piの2つの車輪の半径はそれぞれ0.67インチです。これは、前進するときに2つのモーターが生み出す力の最大値が2×6/0.67=18ozであることを意味します。3piの重量はバッテリ込みで7ozであるため、モーターには3piに垂直の坂を上らせたり、2g(重力の2倍の加速度)で加速したりするのに十分な強度があります。実際の性能はタイヤの摩擦によって制限されます。十分に急勾配な坂では、車輪はストールするまえにスリップします。実際には、坂が30~40°付近のときに発生します。

Driving a motor with speed and direction control

速度と方向の制御とモーターの駆動

One nice thing about a DC motor is that you can change the direction of rotation by switching the polarity of the applied voltage. If you have a loose battery and motor, you can see this for yourself by making connections one way and then turning the battery around to make the motor spin in reverse. Of course, you don’t want to take the batteries out of your 3pi and reverse them every time it needs to back up – instead, a special arrangement of four switches, called an H-bridge, allows the motor to spin either backwards or forwards. Here is a diagram that shows how the H-bridge works:

DCモーターの良い点の1つは、印加する電圧の極性を切り替えることで回転の方向を変更できることです。バラの状態のバッテリとモーターを持っている場合、モーターバッテリをつなぎ、その後バッテリの向きを転換することで、モーターが逆回転にすることをあなた自身で見ることができます。もちろん、後退が必要になるたびにバッテリを3piから取り外して向きを逆にすることはしたくありません。代わりに、Hブリッジと呼ばれる4つのスイッチの特別な配置によって、モーターが前進と後退の両方向に回転することを可能にします。こちらはHブリッジの仕組みの図解です。

画像

If switches 1 and 4 are closed (the center picture), current flows through the motor from left to right, and the motor spins forward. Closing switches 2 and 3 causes the current to reverse direction and the motor to spin backward. An H-bridge can be constructed with mechanical switches, but most robots, including the 3pi, use transistors to switch the current electronically. The H-bridges for both motors on the 3pi are all built into a single motor driver chip, the TB6612FNG, and output ports of the main microcontroller operate the switches through this chip. Here is a table showing how output ports PD5 and PD6 on the microcontroller control the transistors of motor M1:

スイッチ1と4が閉じている場合(中央の図)、電流はモーターを左から右へ流れ、モーターは前方に回転します。スイッチ2と3を閉じると、電流の向きが反転してモーターは逆回転します。Hブリッジはメカニカルスイッチで構成できますが、3piを含むほとんどのロボットはトランジスタを用いて電子的に電流を切り替えます。3piの両モーター用のHブリッジは、すべて1つのモータードライバチップ(TB6612FNG)の中に組み込まれており、メインマイコンの出力ポートはこのチップを介して操作します。次の表は、マイコンの出力ポートPD5とPD6がどのようにモーターM1のトランジスタを制御するかを示しています。

PD5 PD6 1 2 3 4 M1
0 0 off off off off off (coast) (オフ/惰性)
0 1 off on on off forward (前進)
1 0 on off off on reverse (後退)
1 1 off off on on off (brake) (オフ/ブレーキ)

Motor M2 is controlled through the same logic by ports PD3 and PB3:

モーターM2はポートPD3とPB3によって同じ論理で制御されます。

PD3 PB3 1 2 3 4 M2
0 0 off off off off off (coast) (オフ/惰性)
0 1 off on on off forward (前進)
1 0 on off off on reverse (後退)
1 1 off off on on off (brake) (オフ/ブレーキ)

Speed control is achieved by rapidly switching the motor between two states in the table. Suppose we keep PD6 high (at 5 V, also called a logical “1”) and have PD5 alternate quickly between low (0 V or “0”) and high. The motor driver will switch between the “forward” and “brake” states, causing M1 to turn forward at a reduced speed. For example, if PD6 is high two thirds of the time (a 67% duty cycle), then M1 will turn at approximately 67% of its full speed. Since the motor voltage is a series of pulses of varying width, this method of speed control is called pulse-width modulation (PWM). An example series of PWM pulses is shown in the graph at right: as the size of the pulses decreases from 100% duty cycle down to 0%, the motor speed decreases from full speed down to a stop.

速度制御は、この表の2つの状態間でモーターを素早く切り替えることによって実現されます。仮に、PD6をHigh(5V、論理"1"とも呼ばれる)にしておき、PD5をLow(0V、論理"0")とHighの間で素早く交互に切り替えるとします。モータードライバは、"前進"状態と"ブレーキ"状態の間を切り替えて、M1を低速で前進させます。例えば、PD6が3分の2の時間の間Highの場合(デューティー比67%)、M1はフルスピードの約67%で回転します。モーター電圧は幅が変動する一連のパルスであるため、速度制御の方法はパルス幅変調(PWM)と呼ばれます。一連のPWMパルスを下のグラフに示します。パルスのサイズが100%のデューティーサイクルから0%に減少するに従って、モーターの速度はフルスピードから停止まで減少します。

画像
PWM speed control, showing gradual deceleration.

In the 3pi, speed control is accomplished using special PWM outputs of the main microcontroller that are linked to the internal timers Timer0 and Timer2. This means that you can set the PWM duty cycle of the two motors once, and the hardware will continue to produce the PWM signal, in the background, without any further attention.

3piでは、速度制御はメインマイコンの内部タイマTimer0とTimer2に接続された特別なPWM出力で実現されます。これは、2つのモーターのPWMデューティーサイクルを一度設定することで、それ以上のケアをすることなく、バックグラウンドで、ハードウェアがPWM信号を生成し続けるということです。

The set_motors() function in the Pololu AVR Library (see Section 6 for more information) lets you set the duty cycle, and it uses 8-bit precision: a value of 255 corresponds to 100% duty cycle. For example, to get 67% on M1 and 33% on M2, you would call

Pololu AVR Library のset_motors()関数(詳細はSection 6を参照)で8bit精度のデューティーサイクルを設定できます(255が100%のデューティーサイクルに対応します)。例えば、M1を67%に、M2を33%にするするときは次のように呼び出します。

set_motors(171,84);

To get a slowly decreasing PWM sequence like the one shown in the graph, you would need to write a loop that gradually decreases the motor speed over time.

グラフに示されたような、ゆっくりと減少していくPWMシーケンスを得るためには、モーターの速度を時間とともに徐々に減少させるループを記述する必要があります。

Turning with a differential drive

差動駆動による旋回

The 3pi has an independent motor and wheel on each side, which enables a method of locomotion called differential drive. It is also known as a “tank drive” since this is how a tank drives. It is completely unlike the steering system of automobile, which uses a single drive motor and steerable front wheels. Turning with a differential drive is accomplished by running the two motors at different speeds. In the previous set_motors() example, the left wheel will spin faster than the right, driving the robot forward and to the right. The difference in speeds determines how sharp the turn will be, and spinning in place can be accomplished by running one motor forward and one backward. Spinning is an especially effective maneuver for a round robot, and you won’t have to worry about parallel parking!

3piはその両サイドに独立したモーターと車輪があり、差動駆動と呼ばれる移動方法を可能にします。これは戦車の移動方法であることから"tank drive"としても知られています。これは1つの駆動モーターと操舵可能な前輪からなる自動車のステアリングシステムとはまったく異なります。差動駆動による旋回は2つのモーターを別々の速度で駆動することで実現されます。前述したset_motors()の例では、左の車輪は右の車輪よりも早く回転し、ロボットを右前方に駆動します。速度の差で旋回の半径が決まり、また、一方のモーターを前進し、もう一方を後退することで、その場での旋回が可能になります。旋回は丸いロボットにとって特に効果的な機動であり、縦列駐車について心配する必要はありません。

画像
The 3pi demonstrating the effects of various motor settings.

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