Configurable dynamical model of quadcopter
Project description
QUADx88
Configurable dynamical model of quadcopter
API documentation
The Quadcopter
Class
To construct a quadcopter object we can call the constructor
import quadx88 as qx
copter = qx.Quadcopter(mass=1.15,
ts=0.0083,
prop_mass=0.01)
The following parameters can be provided to the above constructor
Parameter | Description | Default |
---|---|---|
ts |
Sampling time (s) | 1/125 |
mass |
Total mass of the copter (kg) | 1 |
arm_length |
Arm length (m) | 0.225 |
moi_xx |
x-x moment of inertia | 0.01788 |
moi_yy |
x-x moment of inertia | 0.03014 |
moi_zz |
z-z moment of inertia | 0.04614 |
gravity_acc |
gravitational acceleration (m/s2) | 9.81 |
air_density |
air density (kg/m3) | 1.225 |
K_v |
Kv constant of motors (rpm/V) | 1000 |
motor_time_constant |
motor time constant (s) | 0.05 |
rotor_mass |
rotor mass (kg) | 0.04 |
rotor_radius |
rotor radius (m) | 0.019 |
motor_mass |
motor mass (kg) | 0.112 |
voltage_max |
maximum voltage (V) | 16.8 |
voltage_min |
minimum voltage (V) | 15.0 |
thrust_coeff |
thrust coefficient of propellers | 0.112 |
power_coeff |
power coefficient of propellers | 0.044 |
prop_mass |
propeller mass (kg) | 0.009 |
prop_diameter_in |
propeller diameter (inches) | 10 |
Getters
Method/Property | Description |
---|---|
state |
Nine dimensional state of the system, $x=(q, \omega, n)$ |
quaternion |
Current quaternion |
hover_rpm |
Hovering spin in RPM |
euler_angles() |
Current Euler angles in degrees |
Setters
To initialise the state of the system the following methods are available
set_initial_quaternion(q)
, whereq
is the quaternionset_initial_angular_velocity(w)
set_initial_motor_spin(spin)
set_initial_euler_angles(yaw, pitch, roll, angle_unit=ANGLE_UNITS.RADIANS)
, whereyaw
,pitch
androll
and the three Euler angles (in this order) andangle_unit
is the units of measurement. For example to construct a quadcopter object with an initial attitude of $\phi=0^\circ$, $\theta=1^\circ$ and $\psi=-5^\circ$ we can do
copter = qx.Quadcopter()
copter.set_initial_euler_angles(-5, 0, 1, ANGLE_UNITS.DEGREES)
System matrices
The methods continuous_linearised_matrices
and discrete_linearised_matrices
return a dictionary with the continuous-time and discrete-time matrices of the linearised system respectively. The discrete-time linearised system has the form
$$\begin{aligned}
x_{t+1} =& Ax_t + Bu_t,
\
y_t =& Cx_t.
\end{aligned}$$
Nonlinear dynamical system
To simulate the nonlinear model you can use move(u)
which updates the system state following the application of a given control action for the duration of the sampling time.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file quadx88-0.3.1.tar.gz
.
File metadata
- Download URL: quadx88-0.3.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0178d21385086a172e605611ddb08f395707374276f60c4bd01e27697857a3 |
|
MD5 | 0a2db9708b5000af4c7c7b6453ce6c35 |
|
BLAKE2b-256 | f4313cc56a826016fac6290c797e4cba08fb87af893740892e2740594438b581 |
File details
Details for the file quadx88-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: quadx88-0.3.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2422c2ae8addbaab0ab95bbb78691dfa88153eb4df7e3848aaad6230b2752f04 |
|
MD5 | 94467bd540e7e684759f76b809bd2fea |
|
BLAKE2b-256 | 513c7edb32bfe73368496d0f32e8d1f8535c5df0cd66a8c035e5136868ac076d |