<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{../common_latex_packages}
\input{../common_latex_definitions}
\input{../common_latex_memo_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Mokai Speed Adjustments}
\vspace{0.1in}
\labdate{Summer 2018}
\vspace{0.1in}
\labauth{Paul Robinette paulrobi@mit.edu}
\labauth{Department of Mechanical Engineering, CSAIL}
\labauth{MIT, Cambridge MA 02139}
\labtoc{small}
\end{labcover}

\wikidoc{file=Memo.MokaiThrottle}
\wikidoc{auth=paulrobi@mit.edu}

%======================================================================
\section{Overview}
%======================================================================
The newer Mokai throttles use a Pololu Maestro servo controller. The controller takes in forward and lateral values from the joystick using an analog to digital converter and outputs commands to servos controlling the throttle and steering. The controller can be programmed using the Maestro Control Center program from Polulu (only works on Windows and Linux at this point) and the built-in scripting language. For more information, please review the user guide at \urlx{https://www.pololu.com/docs/0J40}.

%======================================================================
\section{Changing the Maximum Speed}
%======================================================================
The servo controller maps joystick inputs from the range of approximately 125-925, centered on 525, as they are interpreted by the analog to digital converter to values of approximately 4500 to 7500, centered on 6000, for the servos. These values were found empirically and may not be consistent on all boxes.

To achieve the full range of both servos, input x should be mapped to output y as y=$15/4(x-525)+6000$. Note that the scripting language only works with integers, so fractions should be used instead of floats when determining the equation. The steering servo should ALWAYS use this equation unless and individual servo responds differently.

The throttle maps from input 0 to servo 2. Steering maps from input 1 to servo 3.

An example script that takes advantage of the full range of servo outputs is:

\begin{verbatim}
0 get_position
525 minus
15 times
4 divide
6000 plus
2 servo
	
1 get_position
525 minus
15 times
4 divide
6000 plus
3 servo
repeat
\end{verbatim}

The easiest way to reduce the throttle output is to increase the divisor ("4 divide") in the equation.

General form of the input to output mapping: $y=a/b(x-525)+6000$. Values for $a/b$ to make the vehicle speed approximately 2.2m/s are:

\begin{tabular}{c | c}
Vehicle &amp; Value \\
\hline
unmodified &amp; $15/4$ \\
3868 &amp; $15/14$
\end{tabular}
\end{document}</pre></body></html>