Skip to content

tiralonghipol/vcopter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniV-Bat Simulator

An interactive browser-based flight dynamics simulator for the MiniV-Bat, a sub-250g micro bi-copter with bias center-of-gravity, servo-tilt rotors, and a rotor-disk frame attitude controller.

Based on the paper: MiniV-Bat: A Micro Bi-Copter UAV With Bias-CoG Stability and Optimized Flight Endurance — IEEE/ASME Transactions on Mechatronics, 2026.

VCopter Interface

Quick start

Requirements: Node.js v18+ (v20 recommended)

git clone <repo-url>
cd vcopter

# If using nvm and your shell defaults to an older Node version:
source ~/.nvm/nvm.sh && nvm use 20

npm install
npm run dev

Opens at http://localhost:5173.

What it simulates

  • 6-DOF rigid body dynamics in NED (North-East-Down) frame (Paper Eq. 2–3)
  • Rotor-disk frame controller with PSO-optimized PID gains (Paper Table II, Fig. 5)
  • Position controller (outer loop): altitude, X/Y hold with tilt-compensation and safe-tilt recovery
  • Actuator dynamics: motor electrical/mechanical, servo delay + deadband + slew limiting, ESC first-order lag, battery sag model
  • Steady-state solver: hover RPM, thrust, power, endurance vs. mass sweep
  • Live strip charts: pitch/roll/yaw (tabbed), angular rates, servo angles, thrust, RPM, altitude, position
  • 3D position plot: real-time trajectory with interactive setpoint drag
  • Debug console: scrolling telemetry log with copy-to-clipboard and autoscroll control

Hardware it models

Component Spec
Motors Sunnysky 2305 KV1450
Servos RCOMG 2 kg·cm
Battery FEB 18650 3.5 Ah 3C (2S)
Propellers GWS 10×4.7
Flight Controller HAKRCF405V2
ESC 40A 2-in-1 DShot150
Total mass ~233.7 g (sub-250g)

Build for production

npm run build       # outputs to dist/
npm run preview     # serve the production build locally

Tabs

Tab Description
Dynamics Live strip charts; inject pitch commands and disturbances; position controller toggle
Act. Params Tune motor, servo, ESC, battery, and controller gains in real time
Diagram Rotor-disk frame visualization (body frame, NED frame, CoG offset)
Endurance Endurance vs. total mass sweep curve
BOM Hardware bill of materials with mass breakdown

Dynamics panel

Attitude charts (tabbed)

Switch between PITCH, ROLL, and YAW — each tab shows the angle and its angular rate below.

Position controller

Toggle with the POS CTRL button. When active:

  • Altitude hold via throttle modulation with tilt compensation
  • X/Y position hold via pitch/roll commands (outer loop)
  • Safe-tilt recovery: freezes position demand and levels out if tilt exceeds 30°

Disturbances

  • CoG ±2cm — shift center of gravity along the body x-axis
  • Rate +20°/s — inject a pitch rate impulse
  • Gust +5N — apply a horizontal force pulse

Debug console

Scrolling telemetry at 4 Hz. Autoscrolls to latest by default; scroll up to pin at an earlier line (border turns orange, "↓ latest" button appears). Click "↓ latest" to re-enable autoscroll. Use "⎘ copy" to copy all lines to clipboard.

Design parameters (sliders)

  • Geometry: arm length D, CoG drop L, CoG offset B, servo pre-tilt δL/δR
  • Propulsion: prop diameter/pitch, motor Kv, total mass
  • Battery: voltage, capacity, motor resistance Rm, efficiency η

Project structure

src/
  constants.js          Math helpers (G, RHO, clamp, degRad, …)
  data/
    bom.js              Hardware bill of materials
  physics/
    defaults.js         Design, actuator, and controller default parameters
    aero.js             Thrust and torque aerodynamic functions
    solver.js           Steady-state hover solver
    dynamics.js         Full 6-DOF step integrator (createDynState, stepDynamics)
  styles/
    colors.js           Color palette and font stack
  components/
    ui/                 Slider, Stat, TabBtn widgets
    StripChart.jsx      Real-time scrolling chart (SVG)
    DynamicsPanel.jsx   Live dynamics view with tabbed attitude charts, 3D plot, position charts
    PositionPlot3D.jsx  Interactive 3D trajectory viewer
    DebugConsole.jsx    Scrolling telemetry log
    Diagram.jsx         Rotor-disk frame SVG diagram
    EnduranceChart.jsx  Endurance vs. mass curve
    BOMPanel.jsx        Bill of materials breakdown
  App.jsx               Main component — state, sim loop, layout

About

vcopter project: simulation, design, control and hardware implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors