克劳德能驾驶飞机吗?
Can Claude Fly a Plane?

原始链接: https://so.long.thanks.fish/can-claude-fly-a-plane/

克劳德尝试使用X-Plane 12 API虚拟驾驶塞斯纳172飞机,从海口美兰(ZJHK)飞往琼海博鳌(ZJQH),并记录飞行日志。最初的尝试因API数据/截图与控制调整之间的延迟而导致不稳定和两次坠毁。 克劳德迭代改进了控制脚本,从基本的保持循环转变为专注于俯仰态度的比例控制器。第三次尝试显示出希望,在爬升和左转弯中实现了稳定飞行。然而,由于脚本执行之间控制器活动的中断,导致飞机失控下降,最终坠毁。 尽管遭遇失败,克劳德展示了管理稳定飞行段的能力。坠毁并非自动驾驶逻辑的固有缺陷,而是时机问题和着陆模式中的几何挑战。该实验强调了对连续、响应迅速的控制循环的需求,并表明通过进一步改进,克劳德有可能成功驾驶X-Plane 12中的飞机。

一场 Hacker News 的讨论围绕着使用像 Claude 这样的 LLM 来驾驶飞机的可行性,源于最近的一次实验。 普遍的观点倾向于 LLM 更适合*计划*飞行,而不是*驾驶*它所需的实时控制。 主要问题包括 LLM 响应的延迟(以每秒 token 数量衡量),与控制回路所需的毫秒级反应相比。 一些人认为,基于硬件的 AI,例如 Taalas 风格的系统,可能由于其确定性而更有效。 评论员还注意到实验中的一个奇怪的决定——Claude 将其控制回路简化为纯比例控制,放弃了积分和微分部分,这一选择受到了控制工程师的质疑。 最终,这场讨论凸显了将当前 LLM 技术应用于需要快速、精确物理控制的任务所面临的重大挑战。 并且,有人提出了一个问题:谁*愿意*乘坐由 LLM 驾驶的飞机!
相关文章

原文

I asked Claude to look up the X-Plane 12 API and try to fly a Cessna from Hainan to somewhere nearby. It kept a pilot's log. Everything below is Claude's own notes from during the flight. I occasionally had to remind it to keep the pilot log running, and had to tell it when it crashed as xplane would quickly restart to the runway. The main issue seemed to be delay from what it saw with screenshots and api data and changing course. It quickly made itself a python script to take off, then would add functions to the script as it needed to take action. It would position to land then not change angle quick enough and crash into the ground.

X-Plane cockpit with Claude Code setting up the flight

15:54 Lined up on RWY 09 at Haikou Meilan (ZJHK). Cessna 172, throttle idle, parking brake set. POS 19.93N 110.44E, ALT 73 ft MSL, HDG 092. Destination: Qionghai Bo'ao (ZJQH), ~47 nm south. Plan: full power, rotate ~55 kt, climb at Vy 75 kt to 4500 ft, turn south to 180, cruise, descend, attempt landing on RWY 18.

Cessna climbing after takeoff

15:57 AIRBORNE. Cleanly off the runway after a ~12-second ground roll. Rotated at 55 kt, climbing at +861 fpm, 70 kt IAS, 11.4 nose up, wings level, 411 ft AGL. Heading drifted 80-92 on the takeoff roll (left yaw on power application, typical 172) but the rudder loop pulled it back. Pitch is a bit steep, speed sagging below target Vy. Going to hand off to hold_loop and trade some pitch for airspeed.

Climbing with controller issues

15:59 UPSET. Handed off to hold_loop right after rotation and the controller decided 861 fpm was too much climb for its 700 fpm target. Commanded full forward elevator. We pitched over hard, hit 125 kt IAS, rolled to 60 LEFT bank, heading swung from 092 to 229 before the loop dragged it back. Currently 75 kt, +5 roll, hdg 100, climbing 143 fpm at full throttle, 415 ft MSL. Recovered but rattled. Root cause: elevator gain too high with no rate damping, AND I let the controller command nose-DOWN when we were 4000 ft below target altitude.

Back on the ground after first crash

16:00 CRASHED. Nose-first off the end of the upset. Position reset back to runway 09. Rewriting hold_loop with slew-rate limits, asymmetric VS targets (no nose-down when far below target), smooth handoff from takeoff state, and a low-altitude failsafe. Then we try again.

Second attempt taking off

16:09 STABLE FLIGHT, third attempt. Rewrote controller as pure proportional: alt_err to target_pitch (capped) to P-controller on pitch attitude to elevator. NO integral term in the inner loop, the airframe is the integrator. After takeoff, cruise hold settled at 82 kt IAS, +7 pitch, +780 fpm climb, 1 roll, holding heading within 4. Currently 763 ft MSL climbing toward 1500. Plan: continue climb, then left circuit (crosswind 002, downwind 272, base 182, final 092), descent, landing.

Climbing steadily on second attempt

16:12 Stable cruise. Overshot 1200 MSL target by ~600 ft (climbed at full power, controller couldn't stop the climb in time, needs anticipation logic), but settled at 1819 MSL, 82 kt, on heading 092. About 4 nm east of the runway. Turning LEFT to crosswind heading 002 next.

Stable cruise heading toward destination

16:15 Downwind leg 272, 1438 ft MSL, 83 kt, wings level, descending 110 fpm. Currently 5 nm E, 2.3 nm N of the runway threshold. Need to fly west across the airport, then south, then turn back east for final.

Wings level over Hainan

16:20 Downwind extended successfully. 2.0 nm WEST of RWY 09 threshold, 2.3 nm NORTH. 800 ft MSL, 81 kt, wings level. Plane wouldn't slow to 75 kt, speed-to-throttle gain too gentle. Setting flaps 20 to slow down, then turning LEFT base 182.

Base turn too tight

16:23 Base turn complete but still 1.4 nm NORTH of the runway centerline. Base leg was too short, only got 0.9 nm south. Also dropped IAS to 58 kt (too slow, flaps + descent throttle limit). Patched the controller to bring throttle back up if speed sags during descent. Extending the base leg another ~90s to reach the centerline before turning final.

Final approach with drift

16:31 CRASHED #2, different cause. Plane was stable in a slow descent but between fly.py invocations (~20 sec gap while I logged and computed the next maneuver) there was no active controller. Plane kept descending under its last commanded controls until it hit terrain at 26 ft MSL, 1.7 nm short of the runway. Lesson: never leave the controller idle in flight.

16:31 END OF SESSION. Two crashes, one stable cruise, no successful landing. Took off 3 times cleanly. The third controller (pure proportional, P-on-pitch-attitude) was stable through climb, level cruise, and three 90 turns of a left circuit at 1500-1800 MSL. The geometry of the pattern and the no-controller-gap killed the landing attempt, not the autopilot itself.

Can Claude fly a plane? so far, no. I think an impoved harness loop and it would be able to, a few tweaks and its probably as yes, to be continued...

联系我们 contact @ memedata.com