Skip to main content

Add your description here

Project description

motorcalc - A package to calculate and plot DC - motors

Gerrit Kocherscheidt KOCO MOTION / KOCO automotive, March 2023

Intention

With this package a simple calculation of DC motor parameters based on the input voltage, no-load current, terminal resistance and torque constant is performed. Motor performance curves can be plotted.

Installation

Installation using pip

pip install motorcalc

Installation of sources from Github

git clone https://github.com/KOCOMOTION/motorcalc.git

Basic usage

To create a DC-motor object use the following code

import motorcalc.dcmotor as dcm

m = dcm.CDCmotor(U_N=12.0, I_0=0.02, k_M=0.014, R=25.0)

Here the parameter are

  • U_N: Driving voltage [V]
  • I_0: No-load current [A]
  • k_M: Torque constant [Nm/A]
  • R: Terminal resistance [Ohm]

Note that if not stated explicitely, parameter in this package are considered to be in SI-units without magnitude scaling, i.e., I use ampere instead of milli-ampere etc.

Get information about the object

To get information about the object the print function can be used

print(m)

INPUT PARAMETER:
------------------------------------------------------------------------------------------------------
parameter	voltage		term. resist.	no-load cur.	no-load speed	torque const.
------------------------------------------------------------------------------------------------------
unit		Volt		Ohm		    Ampere		RPM		    Nm/A
value		12.0		25.00		0.020		7844		0.014

PERFORMANCE DATA:
------------------------------------------------------------------------------------------------------
parameter	unit	no-load		@max eff.	@max power	stall		@working point
------------------------------------------------------------------------------------------------------
speed		RPM	7844		6514		3922		0		    7844
current		A	0.020		0.098		0.250		0.480		0.020
torque		Nm	0.000		0.001		0.003		0.006		0.000
power		W	0.00		0.74		1.32		0.00		0.00
eff.		%	0.0		    63.3		44.1		0.0		    0.0

In addition parameter can be plotted with the list_spec_table()-function of the CDCMotorExport-Module.

import motorcalc.dcmotorexport as dcmexp

dcmexp.CDCMotorExport(m).list_spec_table()

+----+-----------------------+---------+----------+
| No | Parameter             | Unit    | Value    |
+----+-----------------------+---------+----------+
| 1  | Voltage               | V       | 12       |
+----+-----------------------+---------+----------+
| 2  | Terminal resistance   | Ω       | 25       |
+----+-----------------------+---------+----------+
| 3  | Terminal inductance   | mH      | 0        |
+----+-----------------------+---------+----------+
| 4  | No-load speed         | rpm     | 7844     |
+----+-----------------------+---------+----------+
| 5  | No-load current       | A       | 0.020    |
+----+-----------------------+---------+----------+
| 6  | Nominal torque        | mNm     | 0        |
+----+-----------------------+---------+----------+
| 7  | Nominal speed         | rpm     | 7844     |
+----+-----------------------+---------+----------+
| 8  | Nominal current       | A       | 0.020    |
+----+-----------------------+---------+----------+
| 9  | Max. output power     | W       | 1.323    |
+----+-----------------------+---------+----------+
| 10 | Max. efficiency       | %       | 63.342   |
+----+-----------------------+---------+----------+
| 11 | Back-EMF constant     | mV/rpm  | 133.690  |
+----+-----------------------+---------+----------+
| 12 | Torque constant       | mNm/A   | 14       |
+----+-----------------------+---------+----------+
| 13 | Speed/torque gradient | rpm/mNm | 1218.023 |
+----+-----------------------+---------+----------+
| 14 | Rotor inertia         | gcm^2   | 0        |
+----+-----------------------+---------+----------+

Additional parameter

Missing or additional parameter can be added either on construction or by directly accessing the member variables of the CDCMotor-class.

m = dcm.CDCMotor(U_N=12.0, I_0=0.002, k_M=0.014, R=25.0, H=1.0E-3 Theta=1.0E-8, nPoints=100, n_WP=6000.0, M_WP=0.0015, motor_name:str='test-motor' application:str='test-application')
Parameters
----------
U_N : float
    nominal Voltage in V
I_0 : float
    noload current in A
k_M : float
    torque constant in Nm/A
R : float
    terminal resistance in Ohm
H : float
    terminal inductance in mH (for information only)
Theta : float
    rotor moment of inertia in gcm^2 (for information only)
nPoints : int
    number of points to be plotted in graph
n_WP : float
    required speed at working point
M_WP : float
    required torque at working point
motor_name : str
    name of the motor used for graph plotting
application : str
    short description of application for graph plotting

Plotting

To plot performance curves the CDCMotorPlot-class from the dcmotorplot-module is needed.

import motorcalc.dcmotorplot as dcmplt
dcmplt.CDCMotorPlot(m).plot_curves()

With this command the following Matplotlib-graph is generated:

Test graph

To-Do: Description of the motorcalc.physics module

This module shall be used to store material parameter und formulas for mechanical and electrical calculations needed for a motor project calculation

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

motorcalc-0.2.1.tar.gz (11.1 MB view details)

Uploaded Source

Built Distribution

motorcalc-0.2.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file motorcalc-0.2.1.tar.gz.

File metadata

  • Download URL: motorcalc-0.2.1.tar.gz
  • Upload date:
  • Size: 11.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for motorcalc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a1a3fd4eed41148e92f7fa0872eacbe09feb983709fdf1b65eb9a23f4972f608
MD5 38b91617d3aaf0ddd56426fc1dba9d10
BLAKE2b-256 39bcb02401c394011bdd5edadfd0ed027f432f848b1e0f07fc1d54c3a010c738

See more details on using hashes here.

File details

Details for the file motorcalc-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: motorcalc-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for motorcalc-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc9706819409e7c1139389f79900797f0dceaf9bfd0eaf409ee1de650c0a83a6
MD5 14b8aa093a9f13dad09664818034a1cb
BLAKE2b-256 2d2c2e1576b7ba74270a9d74482ca536ff1c2ab4a6279cf99b4928c7fe085525

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page