アート
美容とウェルネス
工芸
文化と歴史
エンターテインメント
環境
食品と飲料
リバースエンジニアリング
科学
スポーツ
テクノロジー
ウェアラブル
The Voice-Coil Actuator and Track Following
Martin

作成者

Martin

30. 8月 2026NO
32
0
0
0
0

The Voice-Coil Actuator and Track Following

A floppy drive finds a track by counting steps out from a stop and hoping. It works because its tracks are 188 micrometres apart, which is roughly the width of a human hair and enormous by any other standard. A hard disk cannot do that, and the reason is not precision — it is TEMPERATURE. An aluminium chassis fifty millimetres across grows twelve micrometres when it warms by twenty degrees, which is a normal morning for a drive. At 5000 tracks per inch that is four and a half whole tracks of movement, arriving while the drive is running, and no amount of factory calibration can anticipate it. The only answer is to stop guessing and MEASURE where the head actually is, continuously, and correct. The actuator that does the correcting is a voice coil — the same motor as a loudspeaker, and for the same reason. A stepper has detents and stiction and can only stop where its teeth allow. A voice coil produces a force proportional to current, anywhere, with nothing to catch on. What it does NOT produce is a position: force integrated twice is position, so the arm is a double integrator, and a double integrator under proportional control alone oscillates no matter how gently you push it. FULLY BUILDABLE, and this is the one in the batch worth doing properly. A loudspeaker, a position sensor and a PID loop on a microcontroller is a genuine track-following servo. The resonance you find and the settling time you measure are the same two numbers a drive engineer fights, four orders of magnitude apart.
上級者
5 hours

手順

1

Build the actuator and its sensor

Take a loudspeaker — a 3-inch full-range is ideal — and glue a stiff light pointer to the cone, a strip of card or a cocktail stick with a paper flag on the end. That flag is your head. Mount the QRD1114 reflective optical detector so the flag moves across its field as the cone moves. Adjust the standoff until the analogue output swings across most of the ADC range over a few millimetres of travel, and write down the volts per millimetre — that is your sensor gain and every later number depends on it. Drive the coil from an H-bridge or a power op-amp, NEVER straight from a GPIO pin: a voice coil is four to eight ohms and will draw an amp. Check the polarity by applying a small DC current and confirming the cone moves the way your sensor reads as positive.

このステップの材料:

Speaker (Lab)Speaker (Lab)1
Optical Detector / Phototransistor - QRD1114Optical Detector / Phototransistor - QRD11141
Full-Bridge Motor Driver Dual - L298NFull-Bridge Motor Driver Dual - L298N1
Resistor KitResistor Kit1

必要な工具:

Breadboard - ClassicBreadboard - Classic
Jumper Wire SetJumper Wire Set
Bench Power Supply (30V/5A)Bench Power Supply (30V/5A)
Digital Multimeter (Lab Grade)Digital Multimeter (Lab Grade)
Digital OscilloscopeDigital Oscilloscope
2

Close the loop and step the target

Flash the sketch. It runs a 500 Hz PID loop and steps the target every half second — a one-track seek — printing time, target, position, error and drive as CSV. Do this experiment in order, because the order is the lesson. First set KD to 0.0 and KI to 0.0, leaving only proportional control. Raise KP from very small. It will oscillate, and it will oscillate at ANY gain that is large enough to move the cone at all. That is not bad tuning: an actuator that produces FORCE gives you position two integrations later, which is 180 degrees of phase all by itself, so there is no phase margin left to lose. Now add KD. The oscillation stops, because derivative action is the only thing supplying the missing phase. Then add KI and watch the steady-state offset from gravity disappear. Finally, raise KP until it rings again and note the ringing frequency. That is your structure's first resonance, and it is the ceiling on everything.
voice_coil_servo.inocpp
// A real track-following servo, at a scale you can see.
//
// A voice coil is a force source with no gearing and no stiction, which is why every hard
// disk uses one and why a loudspeaker motor is the same part. Drive one from a position
// error and you have the actuator of blueprint 6.
//
// Hardware:
//   - a loudspeaker (any size; a 3-inch full-range is ideal) with a light pointer glued
//     to the cone
//   - an IR reflective sensor or a slot sensor watching the pointer -> GPIO34 (position)
//   - an H-bridge or a single power op-amp driving the voice coil from GPIO25 (DAC)
//   - do NOT drive the coil straight from a GPIO; a voice coil is 4-8 ohms
//
// What to look for: raise KD to zero and the loop will oscillate no matter how small KP
// is. That is not a tuning failure, it is the double integrator -- position lags force by
// 180 degrees all on its own, so proportional control alone has no phase margin at all.

const int PIN_POS = 34;      // position sensor
const int PIN_DRV = 25;      // DAC -> power stage

// --- gains. Start here, then follow the experiment in the step text.
float KP = 0.60;
float KI = 0.08;
float KD = 0.22;             // set this to 0.0 and watch it ring

const float DT = 0.002;      // 500 Hz loop
float integ = 0.0, prevErr = 0.0;

int   target = 2048;         // the "track" we are following
long  tStep  = 0;

float readPos() {
  long acc = 0;
  for (int i = 0; i < 4; i++) acc += analogRead(PIN_POS);
  return acc / 4.0;
}

void drive(float u) {
  // u is signed; the power stage takes 0..255 with 128 as zero force
  int v = (int)(128 + u);
  if (v < 0) v = 0;
  if (v > 255) v = 255;
  dacWrite(PIN_DRV, v);
}

void setup() {
  Serial.begin(115200);
  delay(300);
  analogReadResolution(12);
  analogSetPinAttenuation(PIN_POS, ADC_11db);
  drive(0);
  delay(500);

  Serial.println("# voice-coil track following");
  Serial.printf("# KP=%.2f KI=%.2f KD=%.2f, loop %.0f Hz\n", KP, KI, KD, 1.0/DT);
  Serial.println("ms,target,position,error,drive");
}

void loop() {
  static unsigned long last = 0;
  unsigned long now = micros();
  if (now - last < (unsigned long)(DT * 1e6)) return;
  last = now;

  // Step the target every 500 ms: this is a one-track seek.
  if (++tStep % 250 == 0) target = (target == 2048) ? 2248 : 2048;

  float pos = readPos();
  float err = target - pos;

  integ += err * DT;
  if (integ >  4000) integ =  4000;        // anti-windup, or a saturated stage never recovers
  if (integ < -4000) integ = -4000;

  float deriv = (err - prevErr) / DT;
  prevErr = err;

  float u = KP * err + KI * integ + KD * deriv;
  if (u >  127) u =  127;
  if (u < -127) u = -127;
  drive(u);

  Serial.printf("%lu,%d,%.0f,%.0f,%.1f\n", millis(), target, pos, err, u);
}

必要な工具:

ESP32 Development BoardESP32 Development Board
Desktop ComputerDesktop Computer
Digital OscilloscopeDigital Oscilloscope
Bench Power Supply (30V/5A)Bench Power Supply (30V/5A)
3

Error budget, resonance, and where to put the servo

Jupyter ノートブックを読み込み中…

必要な工具:

Desktop ComputerDesktop Computer
4

Compendium: force is not position

VOICE COIL, NOT STEPPER. A stepper is a position source with detents: strong, holds without feedback, and can only stop where its teeth allow. A voice coil is a FORCE source — F = BIL, linear in current, no cogging, no backlash, no stiction — so it can be commanded anywhere. It also cannot hold position unpowered, which is why a drive parks its heads with a spring or a latch. THE COST OF BEING A FORCE SOURCE. Position is force integrated twice, so the plant arrives with 180 degrees of lag before you add anything. Proportional control alone therefore has zero phase margin and oscillates at every usable gain — you measured this in step 2. Derivative action supplies the missing phase and is not optional. Integral action then removes the standing error from gravity and windage, and needs an anti-windup clamp or a saturated stage never recovers. SEEK IS NOT FOLLOWING. Getting to the track is bang-bang — accelerate, coast, decelerate — limited by the current the coil takes before it cooks. STAYING there is the linear loop, limited by the arm's first resonance. Real drives run two controllers and switch, which is why a seek shows a distinct settling tail on a scope.

材料

4

必要な工具

7
見積もり合計
作った人が買ったもの。価格のない材料は、購入する店で入手します。
¥7

CC0 パブリックドメイン

このブループリントはCC0で公開されています。許可を求めずに、自由にコピー、修正、配布、あらゆる目的で使用できます。

メイカーを応援するには、ブループリント経由で製品を購入してください。メイカーには メイカーコミッション がベンダーにより設定されています。または、このブループリントの新しいイテレーションを作成し、自分のブループリントにコネクションとして含めて収益を共有できます。

ディスカッション

(0)

ログイン してディスカッションに参加

コメントを読み込み中...