{"id":22441449,"url":"https://github.com/decargroup/quanser_qube","last_synced_at":"2025-03-27T10:15:15.157Z","repository":{"id":213758083,"uuid":"697835408","full_name":"decargroup/quanser_qube","owner":"decargroup","description":"Code to run the Quanser QUBE-Servo using the HIL SDK","archived":false,"fork":false,"pushed_at":"2023-12-21T17:52:34.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T14:45:40.986Z","etag":null,"topics":["control","dynamical-systems","koopman","machine-learning","system-identification"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2303.15318","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decargroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-28T15:13:43.000Z","updated_at":"2023-12-22T19:56:08.000Z","dependencies_parsed_at":"2023-12-22T21:35:43.445Z","dependency_job_id":"18840bbf-2172-4c59-9845-8de87d81c96a","html_url":"https://github.com/decargroup/quanser_qube","commit_stats":null,"previous_names":["decargroup/quanser_qube"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fquanser_qube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fquanser_qube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fquanser_qube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decargroup%2Fquanser_qube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decargroup","download_url":"https://codeload.github.com/decargroup/quanser_qube/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245823316,"owners_count":20678173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["control","dynamical-systems","koopman","machine-learning","system-identification"],"created_at":"2024-12-06T02:14:36.087Z","updated_at":"2025-03-27T10:15:15.122Z","avatar_url":"https://github.com/decargroup.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quanser _QUBE-Servo_\n\nThis repository contains the C code required to generate the experimental\ndataset used in\n[Closed-Loop Koopman Operator Approximation](https://arxiv.org/abs/2303.15318),\nwhich can be found in the\n[companion repository](https://github.com/decargroup/closed_loop_koopman).\n\nThis dataset uses the\n[Quanser _QUBE-Servo_](https://www.quanser.com/products/qube-servo-2/) \n(version 1), but makes use of the\n[Quanser HIL SDK](https://github.com/quanser/hil_sdk_win64)\nto use the device, rather than Simulink.\n\n## Requirements\n\nThis software has only been tested with the Windows version of the Quanser\nHIL SDK, though a\n[Linux version](https://github.com/quanser/hil_sdk_linux_x86_64) does exist that\nshould be compatible with the _QUBE-Servo_.\n\nFirst, install the [Quanser HIL SDK](https://github.com/quanser/hil_sdk_win64)\nand ensure that the environment variable `%HIL_DIR%` is set to the appropriate\nlocation. This should be `C:\\Program Files\\Quanser\\HIL SDK`.\n\nNext, install\n[Microsoft Visual Studio Community](https://visualstudio.microsoft.com/vs/community/),\nas the HIL SDK only supports the `msvc` compiler.\n\nFinally, install [CMake](https://cmake.org/), which will be used to build the\nproject.\n\nOptionally, to run the unit tests, install\n[Catch2](https://github.com/catchorg/Catch2) with CMake integration via `vcpkg`.\nTo do so, follow\n[these instructions](https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#installing-catch2-from-vcpkg)\nin the `x86 Native Tools` terminal. However, be sure to install the 64-bit\nversion of Catch2 instead, by running\n`vcpkg.exe install catch2:x64-windows`.\n\n## Usage\n\nTo compile the project, first create a directory called `build/` inside the\nroot of the repository, navigate to it, and run CMake to generate the required\nVisual Studio projects:\n```\n\u003e mkdir build\n\u003e cd build\n\u003e cmake ..\n```\n\nThen run\n```\ncmake --build .\n```\nfrom within `build/` to compile the project.\n\nThe main executable is `build/src/Debug/QubeBalance.exe`, which can be run\nas-is, or with seeds for the pseudorandom binary sequences as arguments:\n```\n\u003e QubeBalance.exe 123 456 789\n```\n\nIf the _QUBE-Servo_ is connected, it will wait for the user to position the\npendulum upright before running the controller. After execution, the program\nwill save a CSV file containing the results wherever the program was run from.\nIt will have a name like\n`qube_\u003cTIMESTAMP\u003e_\u003cTHETA_SEED\u003e_\u003cALPHA_SEED\u003e_\u003cFEEDFORWARD_SEED\u003e.csv`\n\nOptionally, to run all the unit tests, run\n```\n\u003e ctest -C Debug\n```\n\n## Outputs\n\nThe CSV output has the following columns\n\n| Column | Description |\n| --- | --- |\n| `t` | Timestamp (s) |\n| `target_theta` | Target motor angle (rad) |\n| `target_alpha` | Target pendulum angle (rad) |\n| `theta` | Measured motor angle (rad) |\n| `alpha` | Measured pendulum angle (rad) |\n| `control_output` | Control signal calculated by the controller (V) |\n| `feedforward` | Feedforward signal to be added to `control_output` (V) |\n| `plant_input` | `control_output` summed with `feedforward` (V), saturated between -10V and 10V |\n| `saturation` | Signal indicating if saturation is active (_i.e._, -1 if saturating in the negative direction, +1 if saturating in the positive direction) |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecargroup%2Fquanser_qube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecargroup%2Fquanser_qube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecargroup%2Fquanser_qube/lists"}