Skip to content

Commit

Permalink
Remove brushed motor distinction
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Nov 4, 2024
1 parent 0d3cb19 commit 7641418
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ \subsection{Do flywheels need PD control?}
\end{align}

For an explanation of where these equations come from, read section
\ref{sec:dc_brushed_motor}.
\ref{sec:dc_motor}.

First, we'll solve for $\frac{d\omega}{dt}$ in terms of $V$.

Expand Down Expand Up @@ -107,14 +107,14 @@ \subsection{Do flywheels need PD control?}
armature, the response timescales increase and the inductance matters even less.
\begin{bookfigure}
\begin{minisvg}{2}{build/figs/highfreq_unstable_step}
\caption{Step response of second-order DC brushed motor plant augmented with
\caption{Step response of second-order DC motor plant augmented with
position ($L = 230$ μH)}
\label{fig:cs_tf_highfreq_unstable_step}
\end{minisvg}
\hfill
\begin{minisvg}{2}{build/figs/highfreq_stable_step}
\caption{Step response of first-order DC brushed motor plant augmented with
position ($L = 0$ μH)}
\caption{Step response of first-order DC motor plant augmented with position
($L = 0$ μH)}
\label{fig:cs_tf_highfreq_stable_step}
\end{minisvg}
\end{bookfigure}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
\subsection{Steady-state error}
\index{steady-state error!classical}

To demonstrate the problem of \gls{steady-state error}, we will use a DC brushed
motor controlled by a velocity PID controller. A DC brushed motor has a transfer
function from voltage ($V$) to angular velocity ($\dot{\theta}$) of
To demonstrate the problem of \gls{steady-state error}, we will use a DC motor
controlled by a velocity PID controller. A DC motor has a transfer function from
voltage ($V$) to angular velocity ($\dot{\theta}$) of
\begin{equation}
G(s) = \frac{\dot{\Theta}(s)}{V(s)} = \frac{K}{(Js+b)(Ls+R)+K^2}
\end{equation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ \subsubsection{DC motor transfer function}
unmodeled high frequency, nonlinear dynamics, but they can be safely ignored
depending on the operating regime.

To demonstrate this, consider the transfer function for a second-order DC
brushed motor (a CIM motor) from voltage to velocity.
To demonstrate this, consider the transfer function for a second-order DC motor
(a CIM motor) from voltage to velocity.
\begin{equation*}
G(s) = \frac{K}{(Js + b)(Ls + R) + K^2}
\end{equation*}
Expand Down Expand Up @@ -134,14 +134,14 @@ \subsubsection{DC motor transfer function}
similar for low frequency operating regimes.
\begin{bookfigure}
\begin{minisvg}{2}{build/figs/highfreq_unstable_step}
\caption{Step response of second-order DC brushed motor plant augmented with
\caption{Step response of second-order DC motor plant augmented with
position ($L = 230$ μH)}
\label{fig:tf_highfreq_unstable_step}
\end{minisvg}
\hfill
\begin{minisvg}{2}{build/figs/highfreq_stable_step}
\caption{Step response of first-order DC brushed motor plant augmented with
position ($L = 0$ μH)}
\caption{Step response of first-order DC motor plant augmented with position
($L = 0$ μH)}
\label{fig:tf_highfreq_stable_step}
\end{minisvg}
\end{bookfigure}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\section{Why feedback control?}

Let's say we are controlling a DC brushed motor. With just a
Let's say we are controlling a DC motor. With just a
\glslink{model}{mathematical model} and knowledge of all current \glspl{state}
of the \gls{system} (i.e., angular velocity), we can predict all future
\glspl{state} given the future voltage \glspl{input}. Why then do we need
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\section{Elevator}
\label{sec:ss_model_elevator}

This elevator consists of a DC brushed motor attached to a pulley that drives a
mass up or down.
This elevator consists of a DC motor attached to a pulley that drives a mass up
or down.
\begin{bookfigure}
\input{figs/elevator-system-diagram}
\caption{Elevator system diagram}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\section{Flywheel}
\label{sec:ss_model_flywheel}

This flywheel consists of a DC brushed motor attached to a spinning mass of
This flywheel consists of a DC motor attached to a spinning mass of
non-negligible moment of inertia.
\begin{bookfigure}
\input{figs/flywheel-system-diagram}
Expand Down Expand Up @@ -236,7 +236,7 @@ \subsection{Do flywheels need PD control?}
\end{align}

For an explanation of where these equations come from, read section
\ref{sec:dc_brushed_motor}.
\ref{sec:dc_motor}.

First, we'll solve for $\frac{d\omega}{dt}$ in terms of $V$.

Expand Down Expand Up @@ -300,14 +300,14 @@ \subsection{Do flywheels need PD control?}
armature, the response timescales increase and the inductance matters even less.
\begin{bookfigure}
\begin{minisvg}{2}{build/figs/highfreq_unstable_step}
\caption{Step response of second-order DC brushed motor plant augmented with
\caption{Step response of second-order DC motor plant augmented with
position ($L = 230$ μH)}
\label{fig:cs_ss_highfreq_unstable_step}
\end{minisvg}
\hfill
\begin{minisvg}{2}{build/figs/highfreq_stable_step}
\caption{Step response of first-order DC brushed motor plant augmented with
position ($L = 0$ μH)}
\caption{Step response of first-order DC motor plant augmented with position
($L = 0$ μH)}
\label{fig:cs_ss_highfreq_stable_step}
\end{minisvg}
\end{bookfigure}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\section{Single-jointed arm}
\label{sec:ss_model_single-jointed_arm}

This single-jointed arm consists of a DC brushed motor attached to a pulley that
spins a straight bar in pitch.
This single-jointed arm consists of a DC motor attached to a pulley that spins a
straight bar in pitch.
\begin{bookfigure}
\input{figs/single-jointed-arm-system-diagram}
\caption{Single-jointed arm system diagram}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ \section{What is a dynamical system?}
integrals. You can define reasonably accurate linear \glspl{model} for pretty
much everything you'll see in FRC with just those relations.

But let's say you have a DC brushed motor hooked up to a power supply and you
applied a constant voltage to it from rest. The motor approaches a steady-state
angular velocity, but the shape of the angular velocity curve over time isn't a
line. In fact, it's a decaying exponential curve akin to
But let's say you have a DC motor hooked up to a power supply and you applied a
constant voltage to it from rest. The motor approaches a steady-state angular
velocity, but the shape of the angular velocity curve over time isn't a line. In
fact, it's a decaying exponential curve akin to
\begin{equation*}
\omega = \omega_{max}\left(1 - e^{-t}\right)
\end{equation*}

where $\omega$ is the angular velocity and $\omega_{max}$ is the maximum angular
velocity. If DC brushed motors are said to behave linearly, then why is this?
velocity. If DC motors are said to behave linearly, then why is this?

Linearity refers to a \gls{system}'s equations of motion, not its time domain
response. The equation defining the motor's change in angular velocity over time
Expand All @@ -33,12 +33,11 @@ \section{What is a dynamical system?}

Also of note is that the relation between the input voltage and the angular
velocity of the output shaft is a linear regression. You'll see why if you model
a DC brushed motor as a voltage source and generator producing back-EMF (in the
equation above, $bV$ corresponds to the voltage source and $-a\omega$
corresponds to the back-EMF). As you increase the input voltage, the back-EMF
increases linearly with the motor's angular velocity. If there was a friction
term that varied with the angular velocity squared (air resistance is one
example), the relation from input to output would be a curve. Friction that
scales with just the angular velocity would result in a lower maximum angular
velocity, but because that term can be lumped into the back-EMF term, the
response is still linear.
a DC motor as a voltage source and generator producing back-EMF (in the equation
above, $bV$ corresponds to the voltage source and $-a\omega$ corresponds to the
back-EMF). As you increase the input voltage, the back-EMF increases linearly
with the motor's angular velocity. If there was a friction term that varied with
the angular velocity squared (air resistance is one example), the relation from
input to output would be a curve. Friction that scales with just the angular
velocity would result in a lower maximum angular velocity, but because that term
can be lumped into the back-EMF term, the response is still linear.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ \subsection{Bryson's rule}
\subsection{Pole placement vs LQR}

This example uses the following continuous second-order \gls{model} for a CIM
motor (a DC brushed motor).
motor (a DC motor).
\begin{align*}
\mat{A} = \begin{bmatrix}
-\frac{b}{J} & \frac{K_t}{J} \\
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
\section{Differential drive}
\label{sec:ss_model_differential_drive}

This drivetrain consists of two DC brushed motors per side which are chained
together on their respective sides and drive wheels which are assumed to be
massless.
This drivetrain consists of two DC motors per side which are chained together on
their respective sides and drive wheels which are assumed to be massless.
\begin{bookfigure}
\begin{bookminifig}{2}
\input{figs/differential-drive-fbd}
Expand Down
12 changes: 6 additions & 6 deletions system-modeling/newtonian-mechanics-examples.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ \chapter{Newtonian mechanics examples}
servo mechanisms (it's just the flywheel \gls{model} augmented with a position
\gls{state}).

These \glspl{model} assume all motor controllers driving DC brushed motors are
set to brake mode instead of coast mode. Brake mode behaves the same as coast
mode except where the applied voltage is zero. In brake mode, the motor leads
are shorted together to prevent movement. In coast mode, the motor leads are an
open circuit.
These \glspl{model} assume all motor controllers driving DC motors are set to
brake mode instead of coast mode. Brake mode behaves the same as coast mode
except where the applied voltage is zero. In brake mode, the motor leads are
shorted together to prevent movement. In coast mode, the motor leads are an open
circuit.

\renewcommand*{\chapterpath}{\partpath/newtonian-mechanics-examples}
\input{\chapterpath/dc-brushed-motor}
\input{\chapterpath/dc-motor}
\input{\chapterpath/elevator}
\input{\chapterpath/flywheel}
\input{\chapterpath/single-jointed-arm}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
\section{DC brushed motor}
\label{sec:dc_brushed_motor}

We will be deriving a first-order \gls{model} for a DC brushed motor. A
second-order \gls{model} would include the inductance of the motor windings as
well, but we're assuming the time constant of the inductor is small enough that
its affect on the \gls{model} behavior is negligible for FRC use cases (see
subsection \ref{subsec:do_flywheels_need_pd_control} for a demonstration of this
for a real DC brushed motor).
\section{DC motor}
\label{sec:dc_motor}

We will be deriving a first-order \gls{model} for a DC motor. A second-order
\gls{model} would include the inductance of the motor windings as well, but
we're assuming the time constant of the inductor is small enough that its affect
on the \gls{model} behavior is negligible for FRC use cases (see subsection
\ref{subsec:do_flywheels_need_pd_control} for a demonstration of this for a real
DC motor).
\begin{remark}
For the brushless motor commutation methods currently available in FRC
(trapezoidal commutation, field-oriented control), brushed and brushless DC
motors have the same dynamics. However, more advanced commutation methods can
break the linear back-EMF assumption of the brushed motor model.
\end{remark}

The first-order \gls{model} will only require numbers from the motor's
datasheet. The second-order \gls{model} would require measuring the motor
Expand All @@ -15,7 +21,7 @@ \section{DC brushed motor}

\subsection{Equations of motion}

The circuit for a DC brushed motor is shown in figure
The circuit for a DC motor is shown in figure
\ref{fig:dc_motor_circuit}.
\begin{bookfigure}
\begin{tikzpicture}[auto, >=latex', circuit ee IEC,
Expand All @@ -34,7 +40,7 @@ \subsection{Equations of motion}
to (end);
\end{tikzpicture}

\caption{DC brushed motor circuit}
\caption{DC motor circuit}
\label{fig:dc_motor_circuit}
\end{bookfigure}

Expand All @@ -47,7 +53,7 @@ \subsection{Equations of motion}
V = IR + \frac{\omega}{K_v} \label{eq:motor_V}
\end{equation}

The mechanical relation for a DC brushed motor is
The mechanical relation for a DC motor is
\begin{equation}
\tau = K_t I
\end{equation}
Expand All @@ -60,7 +66,7 @@ \subsection{Equations of motion}

Substitute this into equation \eqref{eq:motor_V}.

\index{FRC models!DC brushed motor equations}
\index{FRC models!DC motor equations}
\begin{equation}
V = \frac{\tau}{K_t} R + \frac{\omega}{K_v} \label{eq:motor_tau_V}
\end{equation}
Expand Down Expand Up @@ -124,11 +130,11 @@ \subsubsection{Angular velocity constant $K_v$}

\subsection{Current limiting}

Current limiting of a DC brushed motor reduces the maximum input voltage to
avoid exceeding a current threshold. Predictive current limiting uses a
projected estimate of the current, so the voltage is reduced before the current
threshold is exceeded. Reactive current limiting uses an actual current
measurement, so the voltage is reduced after the current threshold is exceeded.
Current limiting of a DC motor reduces the maximum input voltage to avoid
exceeding a current threshold. Predictive current limiting uses a projected
estimate of the current, so the voltage is reduced before the current threshold
is exceeded. Reactive current limiting uses an actual current measurement, so
the voltage is reduced after the current threshold is exceeded.

The following pseudocode demonstrates each type of current limiting.
\begin{code}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
\section{Differential drive}
\label{sec:differential_drive}

This drivetrain consists of two DC brushed motors per side which are chained
together on their respective sides and drive wheels which are assumed to be
massless.
This drivetrain consists of two DC motors per side which are chained together on
their respective sides and drive wheels which are assumed to be massless.
\begin{bookfigure}
\input{figs/differential-drive-system-diagram}
\caption{Differential drive system diagram}
Expand Down
10 changes: 5 additions & 5 deletions system-modeling/newtonian-mechanics-examples/elevator.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\section{Elevator}

This elevator consists of a DC brushed motor attached to a pulley that drives a
mass up or down.
This elevator consists of a DC motor attached to a pulley that drives a mass up
or down.
\begin{bookfigure}
\input{figs/elevator-system-diagram}
\caption{Elevator system diagram}
Expand All @@ -17,8 +17,8 @@ \subsection{Equations of motion}
$v$) given an input voltage $V$, which we can integrate to get carriage velocity
and position.

First, we'll find a torque to substitute into the equation for a DC brushed
motor. Based on figure \ref{fig:elevator}
First, we'll find a torque to substitute into the equation for a DC motor. Based
on figure \ref{fig:elevator}
\begin{equation}
\tau_m G = \tau_p \label{eq:elevator_tau_m_ratio}
\end{equation}
Expand All @@ -30,7 +30,7 @@ \subsection{Equations of motion}
\end{equation}

where $r$ is the radius of the pulley. Substitute equation
\eqref{eq:elevator_tau_m_ratio} into $\tau_m$ in the DC brushed motor equation
\eqref{eq:elevator_tau_m_ratio} into $\tau_m$ in the DC motor equation
\eqref{eq:motor_tau_V}.
\begin{align}
V &= \frac{\frac{\tau_p}{G}}{K_t} R + \frac{\omega_m}{K_v} \nonumber \\
Expand Down
4 changes: 2 additions & 2 deletions system-modeling/newtonian-mechanics-examples/flywheel.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\section{Flywheel}

This flywheel consists of a DC brushed motor attached to a spinning mass of
This flywheel consists of a DC motor attached to a spinning mass of
non-negligible moment of inertia.
\begin{bookfigure}
\input{figs/flywheel-system-diagram}
Expand All @@ -17,7 +17,7 @@ \subsection{Equations of motion}
$\dot{\omega}_f$ given an input voltage $V$, which we can integrate to get
flywheel angular velocity.

We will start with the equation derived earlier for a DC brushed motor, equation
We will start with the equation derived earlier for a DC motor, equation
\eqref{eq:motor_tau_V}.
\begin{align}
V &= \frac{\tau_m}{K_t} R + \frac{\omega_m}{K_v} \nonumber
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\section{Single-jointed arm}

This single-jointed arm consists of a DC brushed motor attached to a pulley that
spins a straight bar in pitch.
This single-jointed arm consists of a DC motor attached to a pulley that spins a
straight bar in pitch.
\begin{bookfigure}
\input{figs/single-jointed-arm-system-diagram}
\caption{Single-jointed arm system diagram}
Expand All @@ -17,7 +17,7 @@ \subsection{Equations of motion}
$\dot{\omega}_{arm}$ given an input voltage $V$, which we can integrate to get
arm angular velocity and angle.

We will start with the equation derived earlier for a DC brushed motor, equation
We will start with the equation derived earlier for a DC motor, equation
\eqref{eq:motor_tau_V}.
\begin{align}
V &= \frac{\tau_m}{K_t} R + \frac{\omega_m}{K_v} \nonumber
Expand Down

0 comments on commit 7641418

Please sign in to comment.