Autotune an embedded controller
autotune_embedded_controller_with_c_codegenTune a linear plant and write a zero-heap C99 bundle.
The reply's codegen object lists mpc_bundle.h and mpc_bundle.c
plus usage_example_c and controller_kind. A linear plant is a
condensed QP (linear_qp). A nonlinear plant, including differential
drive, is a linearized iteration (linearized_rti): Jacobians
at the current state, then projected-gradient steps. That is not a full
nonlinear SQP. Compile with
gcc -O3 -std=c99 -Wall -Wextra -fPIC -shared -lm. Each control step is
mpc_compute_u0 then, after the plant measurement, mpc_observer_update.
Neither function allocates on the heap. MPC_NX, MPC_NU, MPC_ND,
and MPC_HORIZON in the header are the array sizes.
Same payment as autotune_template: X-API-Key spends 2 autotune credits, and a missing key or an empty pack is HTTP 402 for x402.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "autotune_embedded_controller_with_c_codegen"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_trials | No | Optuna trials before the C99 bundle is written. Default 1. Values below 1 are raised to 1. Paid at $2.00: X-API-Key spends 2 autotune credits, or HTTP 402 is x402 Base USDC. Each call starts a new study and writes a new bundle. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||