Skip to content

Grahmification/hexapod-simulator

Repository files navigation

Description

Hexapod simulator is a piece of software written to simulate the movement of a 6 degree of freedom Stewart platform balancing a ball. The software handles inverse kinematic calculations to determine positions of 6 actuators based on the translation and tilt of the hexapod in real time.

License

GitHub Hexapod Simulator is available for free under the MIT license.

Projects

  1. Hexapod Simulator - A GUI for simulating the hexapod written using winforms and OpenTK.
  2. Hexapod Simulator.Helix - An improved GUI written using WPF and HelixToolKit.
  3. Hexapod Simulator.Shared - Shared lower level components handling all of the math which are used by each GUI.

Hexpod Simulator.Helix GUI Hexpod Simulator GUI

Dependencies

Getting Started

  1. Compile the code in Visual Studio.
  2. Run the desired executable file (Hexapod Simulator.exe or Hexapod Simulator.Helix.exe).
  3. The 3D view of the hexapod can be moved/rotated/zoomed by dragging with the mouse buttons and scrolling.
  4. The geometry of the hexapod can be setup using the configuration tab at the top left.
  5. The position of the hexapod can be moved around with the manual control sliders. If the simulation is not running, the position will be updated instantly.
  6. Click "Start Simulation" to start the realtime simulation. The ball's position will now respond to tilting the hexapod.
  7. Checking the "Servo Active" button will activate automatic hexapod servoing. The hexapod will automatically tilt to keep the ball centered on itself. Adjust the XY positition and watch the hexapod re-center the ball.
  8. Actuator positions are calculated after each hexapod movement. Actuators that cannot obtain a valid solution within their travel range get highlighted in red.
    • Currently actuators are defined by having a vertical linear travel range with pivoting connecting link. Code is also in place to simulate actuators using an arm extending from a rotary motor, but it is currently not possible to change from the GUI.

Screenshots

Hexapod Simulator HelixToolKit GUI

Hexpod Simulator.Helix GUI

Hexapod Simulator OpenTK GUI

Hexpod Simulator GUI

Implementation

  • Ball physics are calculated by a very simplistic model which integrates the platform's XY normal force components based on tilt to get linear XY velocity and acceleration. This assumes no friction, rolling, inertia, etc. The true model of the ball including friction and inertia is extremely complicated and would take a lot of work to implement.
  • Z position of the ball is calculated to make the ball tangent to the hexapod platform at it's given XY position.
  • During the simulation, hexapod translation and rotation is linked to the manual control sliders by 6 seperate PID controllers with a large integral term to create smooth movement. A better future implementation would be to control each DOF with a trapezoidal trajectory that respectly velocity/acceleration limits.
  • There are two PID controllers running to keep the ball centered on the hexapod. One PID controller eliminates error in the X direction by controlling pitch rotation of the platform. The second PID controller eliminates error in the Y direction by controlling roll rotation of the platform.
  • Actuator positions are calculated iteratively to try and maintain a distance equal to the connecting link between the tip of the actuator and the corresponding node on the platform. This is somewhat resource intensive but works very well.

About

Simulator for a 6 DOF hexapod system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages