modèle de projet vérifié

arche/cart-pole

Cart-pole

A pole balanced upright on a cart pushed along a rail: encoders on the cart and the pole, a motor that pushes the cart, and an LQR controller whose gain comes from archec physics --linearize --lqr; its plant in MuJoCo, its test cases run against it.

plantmujococart-poleinverted-pendulumlqrcontrol

Partir de ce modèle

archec new my-project --template arche/cart-pole

Une copie devient votre projet, à vous de la modifier : ses fichiers dans un nouveau dossier, prêts pour archec build.

▶ Essayer ◆ 3D Ouvrir dans le Playground { } Voir le code son modèle tourne dans votre navigateur, rien à installer

Paquet

Typemodèle de projet
Version0.1.0
LicenceApache-2.0
Contrôle exportnone
Compatible avecarchec >=0.10
Édition0.12
Handlersle langage d’action (```arche), exécuté en TypeScript d’après son code
Sitehttps://github.com/arche-lang/arche-lang

Modèle

SystèmesCartPole Linearized
ComposantsCart Pole Bob Motor CartEncoder PoleEncoder Controller CartPole
Exigences2
Messages3

Code fourni

EmplacementLangageLignes
main.arche · Controller.on_cart.bodyarche4
main.arche · Controller.on_pole.bodyarche10

Ce que c’est

Architecture CartPole · ses parties et leurs liens
CartPole Cart Balance controller : Controller cart pole push

Cart-pole

A pole balanced upright on a cart that a motor pushes along a rail. The pole is a 0.5 m rod of 10 g with a 200 g bob at its tip, on a 1 kg cart. It starts 0.1 rad off upright, at rest.

| | | |---|---| | Plant | a slide (x, ±2 m) and a hinge (y), a force motor (±20 N, a 10 ms lag), 2 encoders (noisy, 4096 counts a turn and 0.1 mm), 1 ms step | | Controller | u = −K·(x − target_x, v, θ, ω), 200 Hz; gives up past 0.6 rad (Fallen) | | Requirements | REQ-CP-UP (within 0.2 rad; formal "never controller in Fallen"), REQ-CP-SETTLE | | Test plan | TP-CP: from 0.1 rad, back to the centre, the cart moved 0.5 m |

The gain is the LQR gain of the cart-pole's equations, written as a physical network in physics.arche (a point mass at the tip):

archec physics physics.arche Linearized --linearize --inputs push.f --lqr 1:1:10:1,0.1
K = -3.162278  -5.751839  -47.57699  -10.52418      (x, v, θ, ω)
archec new my-cart-pole --template cart-pole     a project from it, yours to change
archec gen main.arche --target mujoco -o out
archec sim main.arche --plant out/mujoco/plant_bridge.py --test

In MuJoCo (4.0): the pole never more than 0.1 rad off (its start), within 0.02 rad from 1.08 s, the cart at most 0.16 m from the centre and back within 4 mm at 5 s; at most 4.8 N. Change the masses or the length in both files, then compute K again.

The encoders read with noise and the motor lags, as their ports say (noise, resolution, lag): the noise is drawn from a seed, so a run repeats (archec sim … --plant … --test --seed 5 for other draws).

Fichiers 4 · 8,3 Ko

Télécharger le .archepkg Le .archepkg est signé : archec add le vérifie.

Utilise

N’utilise aucun autre paquet.

Utilisé par

Aucun paquet du store ne l’utilise encore.

Versions

★ 0 étoile↓ 0 téléchargement

VersionPubliée learchecÉtatChangementsTéléchargements
0.1.012 nov. 2026>=0.10publique0

Signature

Signé par arche avec la clé e660d0a8851875b9. Fichiers : 4, empreinte sha256-794c1294c659e59ee464…. archec add vérifie les deux avant d’écrire quoi que ce soit.

Discussion

Chargement…