# The Experimental Multi-Arm Pendulum on a Cart:
A Benchmark System for Chaos, Learning, and Control

Kadierdan Kaheman1,∗, Urban Fasel1, Jason J. Bramburger2, Benjamin Strom3,
J. Nathan Kutz4, Steven L. Brunton1
1 Department of Mechanical Engineering, University of Washington, Seattle, WA
98195, United States of America
2 Department of Mathematics and Statistics, Concordia University, Montréal, QC
H3G 1M8, Canada
3 XFlow Energy Company, Seattle, WA, 98108, United States of America
4 Department of Applied Mathematics, University of Washington, Seattle, WA
98195, United States of America

###### Abstract

The single, double, and triple pendulum has served as an illustrative
experimental benchmark system for scientists to study dynamical behavior for
more than four centuries. The pendulum system exhibits a wide range of
interesting behaviors, from simple harmonic motion in the single pendulum to
chaotic dynamics in multi-arm pendulums. Under forcing, even the single
pendulum may exhibit chaos, providing a simple example of a damped-driven
system. All multi-armed pendulums are characterized by the existence of index-
one saddle points, which mediate the transport of trajectories in the system,
providing a simple mechanical analog of various complex transport phenomena,
from biolocomotion to transport within the solar system. Further, pendulum
systems have long been used to design and test both linear and nonlinear
control strategies, with the addition of more arms making the problem more
challenging. In this work, we provide extensive designs for the construction
and operation of a high-performance, multi-link pendulum on a cart system.
Although many experimental setups have been built to study the behavior of
pendulum systems, such an extensive documentation on the design, construction,
and operation is missing from the literature. The resulting experimental
system is highly flexible, enabling a wide range of benchmark problems in
dynamical systems modeling, system identification and learning, and control.
To promote reproducible research, we have made our entire system open-source,
including 3D CAD drawings, basic tutorial code, and data. Moreover, we discuss
the possibility of extending our system capability to be operated remotely to
enable researchers all around the world to use it, thus increasing access.

††∗ Corresponding author (kadierk@uw.edu); Code availalbe at
https://github.com/dynamicslab/MultiArm-Pendulum

###### Contents

  1. 1 Introduction
  2. 2 Overview of the System
  3. 3 Pendulum Arm
    1. 3.1 Design
    2. 3.2 Assembly
  4. 4 Pendulum Cart
    1. 4.1 Design
    2. 4.2 Assembly
  5. 5 Real-Time System
    1. 5.1 System Choice and Specifications
    2. 5.2 Assembly
  6. 6 Electrical System
    1. 6.1 Electrical Component of Pendulum Arm
    2. 6.2 Electrical Part of Linear Motor Connection
  7. 7 Conclusions and Discussion
    1. 7.1 Cloud Access to Experiments
    2. 7.2 Software Setup
    3. 7.3 Operation and Safety
    4. 7.4 Parameter Estimation of Pendulum Arms
  8. Acknowledgments
  9. A Real-Time System Using Simulink Desktop Real-Time
  10. B Pendulum Arm Details
    1. B.1 Design Details
    2. B.2 Manufacturing Details
    3. B.3 Assembly Details of Second and Third Arm
  11. C Pendulum Cart Details
    1. C.1 Manufacturing Details
  12. D System Frame Details
    1. D.1 Design Details
    2. D.2 Manufacturing Details
    3. D.3 Assembly Details
  13. E Electrical System Details
    1. E.1 Pendulum Arm Wiring Details
    2. E.2 Components Choice of Linear Motor’s Electrical System and Wiring Details
  14. F Software Setup Details
    1. F.1 Software Setup of Motor Drive Details
    2. F.2 Software Set Up of the Simulink Model Details
  15. G Step by Step Operation Details
    1. G.1 Pre-Experiment Preparations
    2. G.2 Peri-Experiment Operations and Precautions
    3. G.3 Post-Experiment Operations
  16. H Safety Mechanism and Notes Details
  17. I Parameter Estimation Details
    1. I.1 Equations of Motion
    2. I.2 Parameter Estimation
  18. J Bill of Materials
    1. J.1 Bill of Materials for Building Pendulum Arm
    2. J.2 Bill of Materials for Building Pendulum Cart
    3. J.3 Bill of Materials for System Frame
    4. J.4 Bill of Materials for Real-Time System
    5. J.5 Bill of Materials for the Electronic Parts

##  1 Introduction

In its simplest form, the single gravity pendulum constitutes a body suspended
by a cord or rod that swings back and forth under the influence of gravity
[1]. Investigations of this nonlinear system date at least to the seventeenth
century and the work of Galileo Galelei [2, 3, 4], with derivations and
explanations of the dynamics now commonplace in introductory mechanics
courses. Perhaps the most well known application of the single pendulum is in
the measurement of time, with Christiaan Huygens’ proposed pendulum clock
concept of 1656 being the most accurate time keeping device until the 1930s.
The predictable oscillatory motion has also been used to infer the constant of
gravitational acceleration, $g$ [5]. As a mechanical benchmark system, the
single pendulum has many notable variants: the single pendulum on a cart [6,
7], Foucault’s pendulum [8, 9], Furuta’s pendulum [10], the vertical take-off
and landing (VTOL) single pendulum [11], the inertial wheel pendulum [12, 13],
the spherical pendulum on a puck [14], and the inverted wheel pendulum [15].

In the eighteenth century, Daniel Bernoulli advanced the study of the pendulum
by introducing a second mass suspended by a cord or rod from the first mass,
resulting in the double pendulum111The double pendulum can also be referred to
as a compound or linked pendulum. [16, 17, 18]. Although the gravity pendulum
leads to predictable periodic motion, the double pendulum is a prototypical
example of a chaotic system [19, 20, 21, 22], requiring specialized numerical
integration techniques such as symplectic [23] and variational [24]
integrators. The double pendulum has played a central role in the historical
development of dynamical systems, attracting the attention of early pioneers,
such as Johann Bernoulli and D’Alembert [16]. Notable variants of the system
include: the double pendulum on the cart [25], the rotary double pendulum [26,
27, 28], the “acrobot" [29], which is a double pendulum with actuation torque
on the second arm, and the “pendubot" [30, 31], which is a double pendulum
with actuation torque on the first arm. The double pendulum remains relevant
in the study of nonlinear dynamics and has emerged as an important benchmark
problem in system identification [32, 11, 33, 34, 35] and machine learning
[15, 36, 37, 11, 38, 39, 34, 40, 41].

Beyond the double pendulum, one can continue adding “arms” (masses suspended
by rods attached to the previous point masses) to form a chain resulting in
the triple pendulum, and so on. The study of such pendulum systems have a long
tradition in classical mechanics for a good reason: they are simple mechanical
analogs that display much of the rich dynamical behavior observed in far more
complex systems. Figure 1 illustrates the single, double, and triple pendulum.

The single, double, and triple pendulum are also widely used in the control
community to develop and test new algorithms. The wide adoption of the multi-
arm pendulum as a benchmark problem stems from the simple derivation of the
equations of motion, the tunable complexity of behavior, and to the wide
applicability in the physical sciences, including to robotics [42],
engineering [43], and biology [44, 45]. In the case of the single pendulum,
controllers have been designed to swing the pendulum up and/or stabilize it in
the inverted position [46, 47, 48, 49, 50, 51, 52, 53, 47, 54, 55, 56, 11, 57,
58, 59]. Similar control methods have been developed to swing up the arms of
the double and triple pendulums [58, 60, 61, 62, 63, 64, 65, 28, 66, 67, 68,
69, 70, 25, 71, 72], stabilize their arms in various unstable vertical
positions [58, 60, 73, 74, 75], and perform time-periodic motion [26, 76, 27,
77, 31, 78]. Due to the chaotic nature of multi-armed pendulums, the
sensitivity increases as more arms are added to the pendulum, thus making it
an increasingly difficult control benchmark. The multi-arm pendulum is
characterized by the existence of index-one saddle points (i.e., saddle points
with exactly one unstable direction), that mediate the chaotic transport of
trajectories in phase space; this provides an analog for several more complex
systems, such as transport in the solar system [79, 80, 81] and chemical
reaction kinetics [82].

\begin{overpic}[width=314.37714pt]{Figures/PendulumIllustration_NoText.pdf}
\put(10.0,120.0){\small Single Pendulum} \put(122.0,120.0){\small Double
Pendulum} \put(240.0,120.0){\small Triple Pendulum} \end{overpic} Figure 1: A
schematic illustration of the single, double, and triple pendulum.

With such interest in understanding and controlling the dynamics of pendulums,
a number of researchers have build physical models to visualize and test their
theoretical calculations; these experimental demonstrations include the single
[10, 12, 30, 58, 83, 83, 6, 7, 84, 85, 46, 13, 48, 50, 51, 53, 32, 57, 9],
double [29, 30, 58, 86, 25, 87, 19, 88, 89, 67, 21, 90, 31], and triple
pendulum [73, 74, 75, 91, 70, 71, 92]. Among these physically-realized
pendulums, it is the pendulum on a moving cart that has received the most
attention. The general idea is to use the motion of the cart to control and
stabilize the motion of the pendulum arms, with benchmark control problems
typically focusing on forcing the arms into the unstable upright vertical
position. Such a control problem is a proxy for more complex upright
stabilization, including human beings standing using their feet as the pivot
and applying small muscular adjustments to remain in the upright position.
This control procedure is becoming increasingly important for the development
of robots that stand upright, and for personal transportation devices, such as
self-balancing scooters and single-wheeled electric unicycles. Much like these
physical balancing problems, the difficulty in controlling pendulums on a cart
usually lies in the physical constraints of the system, such as the pendulum
cart having a limited travel range and velocity. Other difficulties come from
the specific hardware of the system, the control authority of the cart, and
the placement of sensors for real-time measurements of the dynamics. The most
common method to measure the rotational angle of each pendulum arm uses
encoders and a motion capturing camera [89, 93], with variability in
transmitting the collected data using hard wiring or wireless technology [71,
92]. In terms of the actuation of the cart, variants in the physical models
use a rotational motor, a servo motor and belt drive, or a linear motor. All
of these choices have a profound impact on the robustness of developed control
methods.

In this paper we introduce the process and materials needed for constructing a
high-performance, fully instrumented, multi-link pendulum on a cart. With
regards to the variations on the physical model discussed above, we detail
reasons for our choice of sensors, signal transmission, pendulum arm design,
and actuation method. In particular, our pendulum on a cart uses an optical
encoder and slip-ring to record and transmit the rotational angle of each arm,
a linear motor for cart actuation, and Speedgoat and Simulink for the real-
time control interface. The goal of this work is to provide a reference guide
and tutorial for the construction of the pendulum on a cart system with a
flexible design that can further be mounted for nonlinear dynamical
demonstrations or easily altered to various other pendulum models to initiate
new studies. Our contributions are as follows:

  1. 1.

A detailed tutorial on how to build a multi-link pendulum on a cart system.

  2. 2.

Open-source design files, including 3D CAD files and the Simulink files for
data collection and control of the system.

  3. 3.

Open access data sets of the pendulum system with its rotational angle and
velocity recorded with and without control input.

These data sets could be of great benefit to the system identification,
machine learning, and artificial intelligence communities to test their
techniques and algorithms. Finally, in the conclusion we introduce the concept
of cloud experiments so that researchers worldwide can access our model and
run experiments without having to build their own system.

We organize our work as follows: In Sec. 2, we present the major components of
the multi-arm cart pendulum system. In Sec. 3, we describe the design and
manufacturing procedure of the pendulum arm. In Sec. 4, we show the design
process of the pendulum cart. In Sec. 5, the selection of the real-time
control interface is presented. In Sec. 6, we discuss the electrical
components of the system and illustrate the wiring specification of the entire
system. Finally, Sec. 7 summarizes the work and explores the idea of cloud
experiments. Sec. 7 also includes the discussion of software setup, operation
and safety, and parameter estimation of the pendulum arms.

##  2 Overview of the System

In this section we introduce the main components, design, and closed-loop
control of the multi-link pendulum on the cart system. The system can be used
to gather experimental data of a single, double and triple pendulum’s
oscillatory motion, and can be used to validate different control laws and
system identification algorithms. An overview of the system can be seen in
Fig. 2.

\begin{overpic}[width=385.92152pt]{Figures/SystemOverview_LowRes_NoText.pdf}
\put(110.0,105.0){\small Assembled Multi-Link Pendulum on the Cart}
\put(12.0,-5.0){\small Servo Drive} \put(123.0,-5.0){\small Linear Motor}
\put(222.0,-5.0){\small Real-Time System} \put(342.0,-5.0){\small Pendulum
Arm} \end{overpic} Figure 2: Assembled multi-link pendulum on the cart system.
The major components of the system are the servo drive, linear motor, real-
time control system, and pendulum arm on the cart.

The proposed system consists of four major components: 1) the servo drive
(motor drive), which provides proper current to the linear motor to move it
according to the desired speed; 2) the linear motor with a $1\mu m$ resolution
magnetic encoder, which provides actuation forces to the pendulum; 3) the
real-time system, which controls the motion of the pendulum cart and pendulum
arm; and 4) the pendulum arm, which can rotate freely around its joint. The
pendulum arm has an optical encoder with $10000$ counts per revolution (CPR)
to measure its angular position. The four main components are mounted on a
frame, as shown in Fig. 2.

In order to form the closed-loop control, the measurements from the pendulum
arm and linear motor are sent to the Speedgoat real-time system. The real-time
system then runs the user defined controller and calculates the control action
needed for the next time step given the control objective. The corresponding
control value is then converted to an analog voltage output, and this voltage
is sent to the servo drive. In velocity mode, the servo drive measures the
voltage of the analog signal generated by the real-time system, and determines
the desired velocity of the linear motor. To achieve the desired velocity
required by the user, the servo drive uses encoder measurements from the
linear motor to calculate its position and velocity. By comparing the actual
and the user defined velocity of the linear motor, the servo drive
internally222To the best of our knowledge, the servo drive uses a PID
controller to achieve the target speed set by the user. calculates the
currents needed to achieve the target velocity. The closed loop control
diagram is illustrated in Fig. 3.

\begin{overpic}[width=390.25534pt]{Figures/ControlLoop_LowRes_NoText.pdf}
\put(120.0,20.0){\footnotesize{Controller Feedback (Analog Voltage Output)}}
\put(120.0,70.0){\small{Pendulum Arm}} \put(95.0,160.0){\small{Servo Drive}}
\put(86.0,150.0){\small{(Velocity Mode)}}
\put(95.0,242.0){\footnotesize{Current}} \put(60.0,230.0){\footnotesize{Cart
Position and Velocity}} \put(270.0,230.0){\footnotesize{Cart Position and
Velocity}} \put(220.0,200.0){\small{Linear Motor}}
\put(210.0,160.0){\footnotesize{Actuation}} \put(253.0,180.0){\small{Real-Time
System}} \put(243.0,115.0){\footnotesize{Angular Position}}
\put(253.0,105.0){\footnotesize{and Velocity}} \par\end{overpic} Figure 3:
Closed loop control diagram of the proposed system. The linear motor and
pendulum arm sends measurement data to the real-time system, which is used to
calculate the corresponding control action needed to achieve the control
object, such as stabilization, swing-up, stabilizing periodic orbit, etc.
After the control command is received by the servo drive as an analog signal,
the servo drive controls the linear motor to achieve the desired motion.

Our pendulum design enables simple manufacturing and reliable and accurate
operation. It offers several advantages compared to alternative designs: 1) A
linear motor overcomes the backlash that can occur in belt-driven cart
systems, which poses a challenge for multi-link pendulum control. 2) Using a
slip-ring to transfer the electrical signal in the rotating pendulum arm
avoids latency that may occur in pendulum designs with wireless transmission.
Moreover, using slip-rings avoids adding a battery to the pendulum arm and
enables light weight designs [71, 92]. However, using slip-rings results in a
more complicated pendulum arm design, which is more difficult to machine.
Also, due to the limited number of channels the slip-ring provides (5 or 8
signal wires), it is difficult to add a gyro sensor to measure the
acceleration of the pendulum arm. 3) The Speedgoat baseline machine used as
our real-time control system fully supports the Simulink Real-Time software,
which simplifies the controller validation and testing. In case the system is
designed to only study a single pendulum, the Speedgoat machine can be
replaced with a less expensive solution, discussed in Appendix. A. 4) The same
system can be used to study both controlled and uncontrolled behavior, and the
user can add/detach pendulum arms to study single, double, or triple pendulums
using one system. 5) The pendulum can be detached from the linear motor, and
the system can be used to perform other experiments, such as oscillation
studies. 6) Different pendulum arm designs can be installed and tested. Thus,
the resulting system has great flexibility for future extensions.

##  3 Pendulum Arm

The main component of the cart-pendulum system is the pendulum arm. The most
simple design consists of an off-the-shelf rod with a mass attached to its
end. This design is widely used for single and double pendulums due to its
simplicity, but it limits the integration of sensors to measure angular
position. For the triple pendulum, it is more common to machine custom
aluminum pendulum arms with integrated sensors that can record the rotational
angle of the pendulum. In this section, we detail our multi-link pendulum arm
design based on custom machined parts with integrated sensors. We introduce
the pendulum arm design and assembly, and refer to Appendix. B for a detailed
description of the design and manufacturing of the arm.

Figure 4: Design of the multi-link pendulum arm. The main components of the
assembled pendulum arm are: 1) the pendulum arm body, which is used to install
different parts of the pendulum arm, such as sensors, wires, slip-ring, etc.;
2) the pendulum shaft, which is mainly used to support the rotational movement
of the pendulum arm; 3) the bearing plate, which is used to secure the
pendulum shaft and connect two pendulum arms; and 4) the protection case,
which is used to enclose the sensors and slip-ring and prevent them from being
damaged.

###  3.1 Design

An overview of our pendulum arm design is illustrated in Fig. 4. The main
components of the pendulum arm are: 1) pendulum body; 2) shaft; 3) bearing
plate; and 4) 3D printed protection case. The overall structure of the
pendulum arm is determined by how it transmits the rotational information
measured by the encoders. In our design, a slip-ring sends the encoders’
electrical signals to the real-time system. The advantage of the slip-ring
design is the low latency in the signal transmission compared to vision-based
and wireless communication systems. Also, no additional computational
resources are needed to determine the rotational angle of the pendulum,
compared to vision-based tracking systems. This characteristic is particularly
beneficial for achieving high sampling rates. One drawback of the slip-ring
design is the additional friction on the contact between the slip-ring shaft
and brush block. This can be minimized by using a miniature slip-ring and
slip-ring brush with gold contact surfaces, which also reduce the electrical
noise during the rotational movement of the pendulum arm. An additional
challenge of using slip-rings is the requirement for precision machining of
the pendulum shaft and also the fixed number of channels to transmit signals.
This may reduce the flexibility of the setup if new sensors (e.g. an inertial
measurement unit (IMU) sensor) are required for future experiments.

Figure 5: Components and assembly of the first and second pendulum arm.

In our design, the shafts of the first and second pendulum arms are hollow to
accommodate the slip-ring and the connections to the sensors. The slip-ring
wires are clipped to the pendulum arm to prevent twining of the cables.
Moreover, two holes on the side of the pendulum arm facilitate the
installation of the encoder disk on the pendulum shaft. A stair case shoulder
properly secures the bearing that is installed on the first and second
pendulum arm. Ceramic bearings are used to minimize the friction during the
rotational movement. The advantage of ceramic bearings is that they operate
without lubrication. Two bearings are used to fully support the rotational
movement of the pendulum arm. To avoid the pendulum shaft sliding out of the
pendulum arm during operation, external retaining rings are used to secure the
pendulum shaft. The main components of the pendulum arm are manufactured using
CNC milling and turning. Further details are provided in Appendix. B.

Figure 6: Components and assembly of the second and third pendulum arm.

###  3.2 Assembly

The assembly of the pendulum arms is shown in Fig. 5 and Fig. 6. The pendulum
body and bearing plate are assembled first. In order to assemble the pendulum
arm body, the following steps are performed: 1) the bearing ($12$) is
installed to the pendulum arm body ($3$, $15$) (the transitional fit between
the bearing and bearing hole should facilitate the assembly). To make sure the
bearing stays in place, a thin layer of Loctite is applied to the outer ream
of the bearing before it is push into the bearing hole. Once the bearing is
installed, a paint tape is used to cover the bearing to prevent dust entering
the assembly. 2) The pendulum shaft ($1$, $13$, $22$) is press fitted into the
pendulum arm body ($3$, $15$, $23$). To make sure the installation is smooth,
it is recommended to lubricate the pendulum shaft and shaft hole before the
press fit. 3) The slip-ring ($2$, $14$) is then installed onto the pendulum
shaft ($1$, $13$). Those steps complete the assembly of the individual
pendulum arm. The assembly of the bearing plate follows a similar process. The
outer ream of the bearing ($12$) is applied with a thin layer of Loctite, then
pressed into the bearing plate ($20$). This step should also be
straightforward, since the fit tolerance between the bearing and bearing plate
is a transitional fit.

To assemble the double pendulum (first and second arm), the following steps
are performed: 1) the shim ($11$) is slid onto the shaft of the second arm
($13$). Next, the pendulum shaft is slid into the bearing of the first arm
($12$) until the shim ($11$) contacts the inner ring of the bearing. 2) The
shim ($16$), encoder disk ($17$), and another shim ($18$) are slid onto the
second arm’s shaft ($13$). Then, the assembled bearing plate is slid onto the
shaft ($13$) as well. Finally, the external retaining ring is clipped onto the
shaft ($13$). This should hold everything together while still allowing
adjustments, since the bearing plate is not screwed yet. 3) The 3D printed
shim ($6$) and the encoder reader ($7$) are pushed onto the desired place by
aligning the holes. Then, the screws ($8$) are positioned. 4) The 3D printed
shim ($9$) and slip-ring brush block ($10$) are installed by aligning the
holes on the bearing plate, and the screws ($8$) are tightened. After this
step, the contact between the slip-ring and slip-ring brush block should be
carefully observed. The slip-ring brush should be centered to its
corresponding channel. 5) Next, the protection case is installed by aligning
the holes on the pendulum arm body, bearing plate, and protection case. The
screws ($4$) are mounted to fasten the assembly. 6) Finally, the wire clipper
($5$) is installed onto the pendulum arm ($3$) by aligning the holes, and the
screws ($4$) are tightened. The above steps finish the assembly of the first
and second pendulum arm. Fig. 6 shows the assembly of the triple pendulum arm,
following similar steps as for the assembly of the double pendulum arm. The
difference though is that the third arm’s shaft does not have a slip-ring
installed. In Appendix. B the detailed steps to assemble the triple pendulum
arm are introduced.

##  4 Pendulum Cart

In this section we introduce the design and assembly process of the pendulum
cart. We first discuss the motor type selection and sizing, and then introduce
the design and assembly process of the pendulum cart and the bearing house
that is used to connect the pendulum arm to the motor, as shown in Fig. 4. The
detailed design and manufacturing of the cart and linear motor support frame
is introduced Appendix. C and D.

###  4.1 Design

The pendulum cart has two main functionalities: 1) mounting and supporting the
pendulum arm; and 2) providing the actuation to the first pendulum arm to
control the system dynamics. The first step in the design of the pendulum cart
is the selection and sizing of the motor. Once the motor type and size are
selected, a mechanism has to be designed to connect the pendulum arm and
motor. Fig. 7 illustrates the designed pendulum cart with the assembled
pendulum arm.

Figure 7: Overall assembly of the pendulum arm and pendulum cart. The main
components of the pendulum cart are an aluminum plate and a bearing house.

The actuation of the pendulum arm is provided by a linear motor. The advantage
of using a linear motor is that it does not have backslash issues, which
frequently happen in belt-drive type servo motors. This allows accurate
control of sensitive maneuvers, such as the swing-up of the double and triple
pendulum. Once the type of linear motor is determined, the next step is to
size the linear motor. First, the desired maximum speed and acceleration of
the cart is defined. To determine the maximum speed and acceleration, we look
at the pendulum cart’s desired motion profile. We take the feed-forward
trajectory [94] that is needed to swing up the double or triple pendulum.
Using this desired motion profile, we determine the peak force and velocity
required and use this information to size the linear motor. Here, we determine
the pendulum cart’s top speed and acceleration to be $5m/s$ and $20m/s^{2}$.
The pendulum arm we designed in Fig. 4 weights less than $0.5kg$ and the mass
of the linear motor stage is $5kg$. Thus, the total continuous force provided
by the linear motor should be around $110N$. We choose a HIWIN linear motor
system 333See Appendix A of the HIWIN linear motor system manual document
”Linear Motor System(EN).pdf” [95]. LMX1K-SA12-1-2000-PGS1-V103+HS. This
linear motor can provide a peak force of $579N$ with a peak current of
$12.7A_{rms}$ and a continuous force of $205N$ with a continuous current of
$4.2A_{rms}$. This motor is powerful enough to provide the desired
acceleration and speed. Moreover, the effective stroke of the linear motor is
$2m$ with a magnetic incremental encoder of $1\mu m$ resolution.

Once the linear motor has been selected, the next step is to design the
connection between the pendulum arm and the linear motor stage. As illustrated
in Fig. 7 (A) and (B), a bearing housing is needed to provide support for the
first pendulum arm shaft and to secure it so that the pendulum arm can perform
free swing. Moreover, an aluminum plate is machined so that the bearing
housing can be connected with the linear motor stage. The detailed design of
the bearing house is introduced in Appendix. C. The final components we design
for the pendulum cart are the limit switch plates, as shown in Fig. 7 (B).
Fig. 7 (B) shows two limit switch plates installed on the back side of the
linear motor stage. They are responsible to block the laser limit switch when
the pendulum cart moves to the edge of the linear rail. Same as the pendulum
arm, the main components of the pendulum cart are manufactured using CNC
milling. The details of the design and manufacturing are provided in Appendix.
C.

###  4.2 Assembly

The assembly of the cart plate, bearing housing, pendulum arm, and the linear
motor stage is illustrated in Fig. 8. First, the bearing housing is assembled,
which includes two steps: 1) a 3D printed spacer ($32$) is press-fitted into
the bearing hole ($33$). 2) A thin layer of Loctite is applied to the outer
ream of the bearing ($31$). Then, the bearing is installed on the backside of
the bearing house. Next, the same process is repeated to install the bearing
on the front side. It is important to avoid excess Loctite to enter the
bearing, which may damage it. Once finished, the bearing housing is left for
24 hours to ensure the bearing is securely installed. This process can be seen
in Fig. 8 (B). Next, the cart plate is assembled. First, the circular level
indicator ($28$) is installed to the cart plate ($29$). To secure it, a thin
layer of Loctite is applied to the outer ream of the circular level. Next, the
3D printed cable management tool ($25$) is screwed ($4$) to the cart plate
($29$), and the differential driver ($26$) is installed on the cable
management tool ($25$). Then, the cart plate ($29$ ) is mounted to the linear
motor stage ($30$) using 4 screws ($27$). This completes the installation of
the cart plate to the linear motor, as shown in Fig. 8 (A).

Figure 8: Assembly process of the pendulum cart, pendulum arm and bearing
housing. (A) Installation of the bearing housing, cart plate and linear motor
stage. (B) Assembly of the ceramic bearing and the bearing housing. (Bottom)
Installation of the pendulum arm and bearing housing.

The installation of the pendulum arm to the bearing housing is shown in Fig.
8. 1) The spring steel ring shim ($34$) is slid onto the first pendulum arm
shaft ($1$). Then the shaft ($1$) is slid into the bearing ($31$) until the
shim contacts the inner ring of the bearing. 2) A spacing shim ($35$) is
placed onto the shaft until it contacts the inner ring of the bearing ($31$).
The encoder disk ($36$) is installed onto the shaft, which allows the
measurement of the first arm’s rotational angle. 3) A nut ($37$) is tightened
using the thread on the first pendulum arm. This allows the application of
axial force to the bearing housing, which helps to reduce the oscillation of
the pendulum arm on the axial direction. The nut should not be tightened too
much, to prevent damage of the bearing and to reduce the friction between the
bearing ball and bearing case. 4) The encoder reader ($7$) is placed so that
its holes are aligned with the holes on the bearing housing. Next, the holes
are aligned on the 3D printed slip-ring brush base ($38$) with the holes on
the bearing housing. Once the holes are aligned, the bearing housing, encoder
reader, and 3D printed slip-ring brush block base are mounted with screw
($39$). 5) The differential driver ($26$) is installed onto the encoder reader
($7$). 6) The slip-ring brush block ($40$) is installed onto the 3D printed
base ($38$) with screw ($4$). It is important to make sure that each brush is
centered with the corresponding channel on the slip-ring ($2$). The above
steps complete the assembly of the pendulum arm and the linear motor.

The assembly of the limit switch plate ($41,43$) and the linear motor stage
($30$) is shown in Fig. 9 (A). The left and right limit switches ($49$) are
connected to the linear motor frame with the 3D printed limit switch base
($45$). The 3D printed base ($45$) is first connected with the linear motor
frame using drop in T-slotted framing fasteners ($44$) and screws ($47$).
Next, the limit switch ($49$) is connected with the 3D printed base using
screws ($48$) and nuts ($46$). The detailed assembly process is illustrated in
Fig. 9 (B).

Figure 9: Assembly of the limit switch plate and limit switches.

##  5 Real-Time System

Sec. 3 and 4 introduce the major hardware components of the pendulum on the
cart system. In this section, we introduce the real-time system that is
responsible for: 1) processing the signal sent by the pendulum arm, linear
motor, and other sensors; and 2) using the received signal to determine the
control action in real-time based on the user program. The major components of
the real-time system include: 1) baseline real-time target machine by
Speedgoat. 2) User-selected I/O modules, including modules installed inside
the real-time system, terminal boards connected to the sensors, and cables
connecting the terminal boards and the real-time system. 3) Computer used to
program the controller using Simulink Real-Time. 4) Other components such as
the power cord, power adapter, Ethernet cable, software drivers, etc. Fig. 10
(A) illustrates the overall Real-Time system. We use the Speedgoat machine
with Simulink Real-Time for several reasons: 1) Matlab and Simulink have a
wide application in both industry and academia. 2) Speedgoat and Simulink
Real-Time simplify rapid prototyping and hardware in the loop control. 3) The
Speedgoat machine has a responsive customer service that helps users to solve
their software and hardware problems while using the Real-Time machine. One
drawback of the system is that it is comparably expensive. In Appendix. A, we
introduce an alternative custom-made Real-Time system using the National
Instrument Data Acquisition (DAQ) board with Simulink Desktop Real-Time. Other
alternatives of the Real-Time system include dSPACE, Typhoon HIL, National
Instrument, and others [96].

###  5.1 System Choice and Specifications

The number and types of I/O channels and the desired sampling frequency
determines which specific Speedgoat Real-Time system can be used. In our
design, the Real-Time system needs to read at least four quadrature
differential encoder signals (three from the pendulum arm and one from the
linear motor). We need to have at least two digital input channels to read the
limit switch signal, one digital output channel to enable/disable the linear
motor drive, and one analog output to control the linear motor in velocity
mode. The IO-191-EDU-Baseline as our Digital and Analog I/O module meets these
requirements. The IO-191-EDU-Baseline is a 16-bit analog I/O module with eight
single-ended or four differential sequential sampling analog inputs. The
supported voltage ranges of the analog inputs are $\pm 0.64V$, $\pm 1.28V$,
$\pm 2.56V$, $\pm 5.12V$, $\pm 10.24V$, $\pm 12.288V$, $\pm 20.48V$, and $\pm
24.576V$. Moreover, it has four single-ended analog outputs with supported
voltage ranges of $\pm 10V$, $\pm 5V$, $\pm 2.5V$, $0-10V$, or $0-5V$. Both
the input and output range of the analog signal is software configurable.
Finally, it also has 16 x general-purpose digital TTL I/O lines. Thus, the
module meets our requirements for digital and analog I/O capability. More
details can be found in the IO-191-EDU-Baseline manual. As for the encoder
reading, we select the IO-392-Baseline configurable FPGA-based I/O module with
50k Artix 7 FPGA and 13x RS422 digital I/O lines. This module can read four
quadrature differential encoder signals while providing a $5V$ power supply to
the encoder sensor. The Pin-Out map for this module while using the driver
IO-392-QAD4RS422 can be seen in Table. 1. More details can be found in the
user manual444All the user manuals can be found on
https://github.com/dynamicslab/MultiArm-Pendulum.

Figure 10: Assembly of the real-time system. (A) rough connection illustration
of the target system. The terminal block is used to connect with the sensors.
A cable is used to send the signals to the target system. The running status
of the target machine is shown on the monitor and the target system and host
computer is connected using an Ethernet cable which allows the update of the
real-time program to be executed. (B) Assembly of the real-time system. The
target machine is place on top of the host machine while the host computer is
place on top the system frame. (C) Assembly of the DIN rail that is used to
mount the terminal block of the real-time system.

After selecting the I/O modules, the next step is to determine which specific
Speedgoat system is used. This is mainly determined by the sampling frequency,
which depends on the user-specific program/algorithm. The desired sampling of
the rotational information of the pendulum arm is $5kHz$ when no control is
applied. When stabilizing the single, double and triple pendulum, the sampling
rate should be at least $1kHz$ (using LQR with Kalman filter). According to
the user manual of the Baseline Speedgoat system, the I/O latency for reading
and sending signals is around $31.5\mu s$ when using IO-191-EDU-Baseline and
IO-392-Baseline. For the baseline machine, the algorithmic calculation takes
about $56\mu s$ when running a Simulink model with $1550$ blocks and $250$
continuous states (equals to $25$ Simulink benchmark model F14). Thus, the
total latency time is around $87.5\mu s$, which theoretically enables a
sampling rate of $11.4kHz$, which meets our requirements. Therefore, we choose
a baseline real-time target machine by Speedgoat as our real-time controller.
After testing, we found a maximum sampling rate of around $12.5kHz$ for pure
data collection, and $5kHz$ during double/triple pendulum stabilization (using
a time-varying LQR controller and a Kalman filter). The sampling rate is
problem-specific and using a highly optimized code can further increase the
maximum sampling rate. Finally, the host machine used for developing the
control law has an Intel(R) Core(TM) i7-3770 CPU with 3.40GHz frequency and
32GB of RAM. The host machine runs on Windows 10 Pro with Matlab 2021b.

###  5.2 Assembly

The assembly of the real-time system is straightforward, as shown in Fig.10
(B). The host computer ($68$) is directly placed on the aluminum extrusion
($64$), while the target computer ($67$) is placed on top of the host
computer. The Speedgoat target machine can be mounted on the system frame
following the steps specified in the user manual of the real-time system. By
directly placing the host and target machine on the system frame, the center
of mass of the whole system is lowered, making the system frame more stable. A
DIN rail ($71$) is mounted on the system frame ($64$) using a drop-in
fastener. This DIN-rail allows the mounting of the terminal block ($65$). The
bill of materials of the real-time system can be found in Table.
LABEL:table:RealTimeSys in Appendix. J.

##  6 Electrical System

In this section we introduce the major electrical components of the
experimental setup. We introduce the functionality of the components and
illustrate the wiring specification of the entire system. The electrical
system of the whole setup can be divided into two parts: 1) Linear motor power
supply. 2) Pendulum arm sensor system. In the following, we introduce each
part separately and illustrate the entire wiring diagram of the electrical
system. WARNING: None of the authors of this paper is a certified electrician.
The wiring diagram of the system is provided as a reference and it has not
been examined by an electrician. To the best of the author’s knowledge, the
provided wiring diagram is safe to be used but NONE of the authors GUARANTEE
its safety.

Figure 11: Electrical wiring and assembly of the pendulum arm. (A) Major
electrical components of the pendulum arm. (B) connection method of
differential driver and encoder reader. (C) to (E) wiring of the slip-ring.

###  6.1 Electrical Component of Pendulum Arm

The electrical component of the pendulum arm mainly consists of an encoder
reader ($7$), slip-ring ($2,15$), slip-ring brush block ($10,40$),
differential driver ($25$), and differential driver cable ($73$). Fig.11 (A)
illustrates all those components. The encoder reader’s single-ended A, B, and
C/Index channel is transferred into the differential signal using differential
drivers to improve the noise robustness of the encoder measurements. Using a
differential signal helps to avoid the effect of electrical noise generated by
the linear motor. It is generally recommended to use a differential signal
whenever possible. Three US Digital CA-C10-SH-NC 10 feet cables are used
(differential driver cable) to transfer the differential signals to the target
computer. One end of the differential driver cable is connected to a 10-pin
female standard (non-latching) connector. This connector is then inserted into
the differential driver. The other end of the differential driver cable is
unterminated. Thus, it is stripped and inserted into the corresponding
channels on the real-time system terminal block ($65$). This process completes
the connection of the differential driver and target system. Last, the
differential driver and encoder reader are connected, as shown in Fig.11 (B).

The first pendulum arm’s encoder reader (measuring the arm’s rotational angle)
is directly connected to the differential driver, since the encoder reader is
mounted on the bearing housing. This mounting position simplifies the
connection of the differential driver to the encoder reader. However, the
encoder reader and differential driver connection on the second and third arm
are located inside the pendulum arm. This mounting position prohibits the
direct connection of the driver and encoder reader. Therefore, two slip-rings
are used that connect the encoder reader inside the first and second pendulum
arm, as shown in Fig. 11 (E). This allows an indirect connection of the
differential driver and encoder reader through the slip-ring brush block,
which conducts the encoder reader signal out of the pendulum arm. Next, the
breadboard jumper cable connects the slip-ring brush block and differential
driver. One end of the breadboard jumper cable is stripped away using a wire
stripper and soldered onto the slip-ring brush block. The other end is
directly inserted into the differential driver, as shown in Fig.11 (B). As for
the slip-ring, it is first installed onto the pendulum shaft. The unterminated
slip-ring wire is striped and then pushed into the pendulum arm using the
groove and hole in the front of the pendulum arm, as shown in Fig.11 (C, D).
Inside the pendulum arm, the slip-ring wire is clipped using a 3D printed
cable management tool ($5$). Next, the other end is soldered with the locking
clip contact pin, and the locking clip contact pin is insulated with a heat
shrink tube to avoid the shortage of the wire connection. Finally, it is
connected with the encoder to allow the transmission of the encoder signal
through the slip-ring. Fig.11 (C, D, E) illustrates the slip-ring wiring.
Details of the wiring diagram are in Appendix. E.1.

Figure 12: Electrical components needed to provide power supply to the linear
motor. An electrical box is used to organize all the components.

###  6.2 Electrical Part of Linear Motor Connection

The electrical part of the linear motor mainly concerns the following: 1)
properly connecting the motor drive and motor; and 2) connecting the motor
drive to the target computer. The connection guidance of the linear motor and
linear motor drive is detailed in the user manual of Mega-Fabs D1
Drive555Available on https://github.com/dynamicslab/MultiArm-Pendulum. The
user manual also shows the pin out of the control signal cable, which enables
the communication between the motor drive and target computer. The main
challenge of the electrical part of the linear motor is to reduce the effect
of electromagnetic interference (EMI) generated by the linear motor and motor
drive. Several techniques can be used for this: 1) use a ground filter to
filter out the noise generated by the linear motor and the drive in the ground
line; 2) use shielded cables to transmit the signal; 3) use twisted pairs of
wires to transmit differential signals; and 4) proper grounding of the all
electronic components. With all these techniques combined, EMI is reduced and
a proper and safe connection of the linear motor electrical parts is achieved.

Several electrical components are required to connect the linear motor. We use
the components that are suggested in the user manual of the D1 motor drive: 1)
emergency stop switch; 2) circuit breaker; 3) noise filter; 4) magnetic
contactor; 5) line reactor; 6) motor drive; 7) edge filter; 8) regenerative
resistor; 9) DC voltage supply; 10) linear motor; 11) electrical box and
mounting plate; and 12) other miscellaneous parts that help connecting the
electrical components, such as wires, connectors, cables, etc. A summary of
the major electrical components can be seen in Fig. 12. The details of these
parts are introduced in Appendix. E.2, along with a detailed wiring diagram.

##  7 Conclusions and Discussion

In this paper, we have introduced an experimental multi-link pendulum on a
cart system. This system can be used to collect experimental data from the
single, double, and triple pendulum. Moreover, the user can control the
pendulum motion by actuating the cart via a linear motor. This makes the
experimental system a powerful tool for studying the control of chaotic
systems. Our experimental setup is open source, with all the detailed design
choices and CAD files freely available, which allows reproduction of the
system. We have also collected experimental data sets of the single, double,
and triple pendulum and made them freely available. We believe this data will
be valuable for the machine learning and modeling communities to test various
algorithms. All code and design files can be downloaded on our Github
page666Code available at https://github.com/dynamicslab/MultiArm-Pendulum.

To make it possible to reproduce this pendulum on a cart system, we have
provided a detailed description of the assembly and manufacturing process.
Furthermore, the wiring diagrams of the electrical components and the software
set up are also documented. Although the detailed manufacturing process of our
setup is documented, we realize that many labs may not have the time and
funding to replicate this system. Beyond this, the time needed to manufacture
the experiment and the effort needed to maintain it may not be worth the
investment for groups that only need occasional use of the experimental setup.
This high cost can be mitigated by using more standard parts and 3D printing
technology, but it does not solve the maintenance effort and the time
consuming manufacturing and assembly process. This drawback motivates a future
modification to our experimental set up to allow cloud access for remote
users, discussed below, so that they can remotely access the system for data
collection and control experiments. To conclude this manuscript we also
briefly discuss the system operation procedures, safety instructions, and the
estimated parameter values associated to the pendulum arms, which are explored
in more depth in the appendices.

Figure 13: Overall schematic of a cloud experiment of the pendulum on the cart
system.

###  7.1 Cloud Access to Experiments

Figure 13 shows the remote cloud experiment concept. This is similar to cloud
services where infrastructure, hardware, or software can be accessed by remote
users through the internet. In our case, the user accesses the pendulum
hardware. The user must first develop their own program to achieve some
objective using the experimental system. The program could be a controller to
move the pendulum cart for data collection or for a control objective. This
program should be coded according to a given template. After the user uploads
their program to the cloud, it is necessary to test for any compiling errors
and controller errors. Testing whether the proposed controller is safe is a
difficult task. For example, some controllers might require the pendulum cart
to move at unreasonable speeds or accelerations. If the controller is
unstable, then it might damage the experimental setup. To avoid this, it may
be necessary to test the controller in a digital twin of the pendulum. If
position, velocity, or acceleration limits are violated, then a debug report
will be sent to the user to allow revision and resubmission. Once the user
program passes all tests on the digital twin, it may be deployed on the real
experimental system. In the physical experiment, failsafe hardware limits may
also be imposed, operating outside the user specified code.

During the experiment, the system should record all available data, including
pendulum arm rotational angle and angular speed, linear motor position and
velocity. The system should also record user defined variables. The collected
data will be sent to the user to allow further analysis. A video camera will
also record the experiments. The user will then be responsible for determining
whether the desired objective is achieved by reviewing the recorded data and
videos. The user should also be allowed to send a bug report to allow the
maintenance of the hardware system.

There are several challenges that must be addressed for the cloud experiments.
First is to deploy the user program to the real-time system automatically. In
the current design, we use the Speedgoat machine as our real-time controller.
Every time a controller is deployed, the user manually starts Simulink. A
pipeline to automatically read, load, compile, and start the code must be
developed. The second challenge is to automatically self-check the system. The
real-time system should be able to perform the self-check and determine if any
components must be replaced.

###  7.2 Software Setup

Two major software packages are used for successful and safe experiments: 1)
The HIWIN Lightning software and 2) Simulink Real-Time model. The former is
used to set up the parameters of the linear drive, while the latter is used to
develop the real-time control algorithm for the system. The motor drive’s
Lightning software allows the selection of motor type and motor parameters,
for which the motor drive uses this information to determine the control
parameters needed to move the linear motor in the desired motion profile. The
Lightnight software also configures the linear motor’s encoder reading, allows
the setup of the linear motor’s Hall sensor, allows the user to select which
in mode the linear motor should operate (position, velocity, force/torque, or
stand-alone mode), configures the programmable I/Os of the D1 drive’s CN2
channel, and finally, can set up software safety mechanisms. Appendix F.1
enumerates the details to setup these functionalities. The Simulink Real-Time
software is used to develop the controller for the real-time pendulum
experiments. To read the sensor signal and output control signal, the Simulink
Real-Time and Speedgoat needs to be configured properly. The main aspects to
be considered when setting up the Simulink model are: 1) setting up the
Simulink blocks to allow the desired digital I/O functionalities, 2) setting
up the FPGA module to enable encoder reading, 3) utilizing the digital I/Os to
start the linear motor and stop it when the limit switches are triggered, 4)
switching of the operating mode of the linear motor drive and activating
homing function, 5) sending the analog signal to control the velocity of the
linear motorm and 6) reading encoder sensors. These aspects are detailed in
greater depth in Appendix. F.2.

###  7.3 Operation and Safety

The operation procedures of the system include pre-experiment preparations,
operations required during the experiments, and post-experiment operations.
During the pre-experiment preparations, the operator should check all the
wiring connections of the system and make sure there is no electrical shortage
and hardware damage before starting. Then the controller file is prepared, and
the system is turned on while ensuring safety. The main operation that must be
performed during the experiment is to check whether the experiments are going
as planned. If not, the operator should stop the experiments immediately and
cut off all the power supply to the system. After the experiment, inspect any
damage to the setup and then cut off all power to avoid any electrical
hazards. For a detailed step-by-step operation guidance see Appendix. G. While
operating the system, safety should always be the number one priority. To
ensure the safe use of the experimental setup, mechanical, electrical,
software, and personal safety measures must be implemented. A critical
mechanical safety measure is to install a shock absorber on the side of the
linear motor rail. This will help absorb the extra kinetic energy of the
linear motor in case of controller failure. We further recommend purchasing a
protective panel to surround the experimental setup. This can reduce the risk
of personal injury caused by pendulum parts detaching while the linear motor
is in motion. Appendix H describes other safety measures that must be
followed. Besides the safety notes in this paper, the reader must also follow
all the safety instructions written in the individual components’ user
manuals. We close this section by emphasizing that the proposed design of the
multi-link pendulum on a cart has been tested and used safely in the lab
environment by the authors. One should always exercise caution when building
and operating the system and none of the authors can be held responsible for
any damage or injury caused by reproducing the design shown in this paper.

###  7.4 Parameter Estimation of Pendulum Arms

Estimating the parameters of the pendulum system requires data collected from
the designed system. An optimization problem is solved to find the pendulum
system’s parameters that best predict the data. This also requires an
analytical model of the pendulum, which is shown in Appendix I.Parameter
estimation is a standard task in pendulum control experiments where the model
of the system is needed along with its parameters, while the model derivation
of the single, double, and triple pendulum all follows through a similar
process. We omit the model derivation for single and triple pendulums since
they are similar. The former is standard and the latter can be derived through
similar methods to the double pendulum [63, 89, 70].

In the case of the experimental pendulum, there are several parameters that
must be identified, including the mass of the pendulum arm $m$ and the
position of center of mass, defined as $a$. We also require the length of the
pendulum arm $l$ and the inertial of the pendulum arm $J$, as depicted in Fig.
1. Although frequently ignored in parameter estimation, we also seek to
determine the local constant of gravitational acceleration, $g$, which plays
an important role on the chaotic dynamics of the double and triple pendulum.
Some parameters do not show up in the derived equation of motion of the cart-
pendulum, such as the mass of the cart $M$ when the control is taken to be the
acceleration of the cart. We summarize these definitions using the double
pendulum as an example in Figure 39 and Table. 4 provides details of the
estimated pendulum arm parameters. Finally, Table. 4 also provides the values
of the the friction coefficients $\varepsilon_{i}$ which lead energy
dissipation in the physical system. For more details on the method of
parameter estimation, please see Appendix. I for an exposition with the double
pendulum.

## Acknowledgments

The authors acknowledge funding support from the Army Research Office (ARO
W911NF-19-1-0045) and National Science Foundation AI Institute in Dynamic
Systems (grant number 2112085). The authors also would like to thank Eamon
McQuaide and Veasna Thon for providing useful tutorials and instructions
during the machining process and Zachary G. Nicolaou for helping set up the
slow-motion camera.

## References

  * [1] M. Gitterman, _The Chaotic Pendulum_. World Scientific, 2010.
  * [2] G. Galilei, _Dialogue concerning the two chief world systems_. University of California press, 1967.
  * [3] ——, _Dialogues concerning two new sciences_. Dover, 1914.
  * [4] P. Palmieri, “Galileo’s experiments with pendulums: Then and now,” _PhilSci Archive_ , 2007. [Online]. Available: http://philsci-archive.pitt.edu/3549/
  * [5] G. L. Baker and J. A. Blackburn, _The pendulum: A case study in physics_. OUP Oxford, 2008.
  * [6] L. T. Aguilar, J. A. Ortega, and A. Ferreira, “Self-excited oscillations in an inverted cart–pendulum based on the two-relay approach,” _ISA transactions_ , vol. 121, pp. 306–315, 2022.
  * [7] H. Oka, Y. Maruki, H. Suemitsu, and T. Matsuo, “Nonlinear control for rotational movement of cart-pendulum system using homoclinic orbit,” _International Journal of Control, Automation and Systems_ , vol. 14, no. 5, pp. 1270–1279, 2016.
  * [8] M. R. Matthews, C. F. Gauld, and A. Stinner, _The pendulum: Scientific, historical, philosophical and educational perspectives_. Springer Science & Business Media, 2005.
  * [9] L. B. Freidovich, A. S. Shiriaev, and I. R. Manchester, “Experimental implementation of stable oscillations of the Furuta pendulum around the upward equilibrium,” in _2007 IEEE/RSJ International Conference on Intelligent Robots and Systems_. IEEE, 2007, pp. 171–176.
  * [10] J. Acosta, “Furuta’s pendulum: A conservative nonlinear model for theory and practise,” _Mathematical Problems in Engineering_ , vol. 2010, 2010.
  * [11] I. Abraham, G. De La Torre, and T. D. Murphey, “Model-based control using Koopman operators,” _arXiv preprint arXiv:1709.01568_ , 2017.
  * [12] D. J. Block, K. J. Åström, and M. W. Spong, “The reaction wheel pendulum,” _Synthesis Lectures on Control and mechatronics_ , vol. 1, no. 1, pp. 1–105, 2007.
  * [13] L. B. Freidovich, P. La Hera, U. Mettin, A. Robertsson, A. S. Shiriaev, and R. Johansson, “Shaping stable periodic motions of inertia wheel pendulum: Theory and experiment,” _Asian journal of control_ , vol. 11, no. 5, pp. 548–556, 2009.
  * [14] A. S. Shiriaev, L. B. Freidovich, and S. V. Gusev, “Transverse linearization for controlled mechanical systems with several passive degrees of freedom,” _IEEE Transactions on Automatic Control_ , vol. 55, no. 4, pp. 893–906, 2010\.
  * [15] M. Meindl, D. Lehmann, and T. Seel, “Bridging reinforcement learning and iterative learning control: Autonomous reference tracking for unknown, nonlinear dynamics,” _TechRxiv_ , 2021.
  * [16] D. D. Nolte, “The ups and downs of the compound double pendulum,” Dec 2020. [Online]. Available: https://galileo-unbound.blog/2020/10/18/the-ups-and-downs-of-the-compound-double-pendulum/
  * [17] L. Euler and C. Truesdell, _The Rational Mechanics of Flexible Or Elastic Bodies 1638 - 1788: Introduction to Vol. X and XI_ , ser. Leonhard Euler, Opera Omnia. Springer Basel AG, 1980. [Online]. Available: https://books.google.com/books?id=gxrzm6y10EwC
  * [18] D. Bernoulli, “Theoremata de oscillationibus corporum filo flexili connexorum et catenae verticaliter suspensae,” _Comm. Acad. Sci. Petrop_ , vol. 6, no. 1732-1733, pp. 108–122, 1738.
  * [19] T. Shinbrot, C. Grebogi, J. Wisdom, and J. A. Yorke, “Chaos in a double pendulum,” _American Journal of Physics_ , vol. 60, no. 6, pp. 491–499, 1992\.
  * [20] J. Chen, “Chaos from simplicity: An introduction to the double pendulum,” 2008\.
  * [21] M. Rafat, M. Wheatland, and T. Bedding, “Dynamics of a double pendulum with distributed mass,” _American Journal of Physics_ , vol. 77, no. 3, pp. 216–223, 2009.
  * [22] T. Stachowiak and T. Okada, “A numerical analysis of chaos in the double pendulum,” _Chaos, Solitons & Fractals_, vol. 29, no. 2, pp. 417–422, 2006\.
  * [23] H. Yoshida, “Construction of higher order symplectic integrators,” _Physics letters A_ , vol. 150, no. 5-7, pp. 262–268, 1990.
  * [24] J. E. Marsden and M. West, “Discrete mechanics and variational integrators,” _Acta Numerica_ , vol. 10, pp. 357–514, 2001.
  * [25] J. Timmermann, S. Khatab, S. Ober-Blöbaum, and A. Trächtler, “Discrete mechanics and optimal control and its application to a double pendulum on a cart,” _IFAC Proceedings Volumes_ , vol. 44, no. 1, pp. 10 199–10 206, 2011.
  * [26] Z. Wang, L. B. Freidovich, and H. Zhang, “Periodic motion planning and control for double rotary pendulum via virtual holonomic constraints,” _IEEE/CAA Journal of Automatica Sinica_ , vol. 6, no. 1, pp. 291–298, 2017\.
  * [27] ——, “Almost periodic motion planning and control for double rotary pendulum with experimental validation,” _Asian Journal of Control_ , vol. 22, no. 6, pp. 2434–2443, 2020.
  * [28] K. J. Åström, K. Furuta, M. Iwashiro, and T. Hoshino, “Energy based strategies for swinging up a double pendulum,” _IFAC Proceedings Volumes_ , vol. 32, no. 2, pp. 6450–6455, 1999.
  * [29] M. W. Spong, “The swing up control problem for the Acrobot,” _IEEE control systems magazine_ , vol. 15, no. 1, pp. 49–55, 1995.
  * [30] I. Fantoni, R. Lozano, and M. W. Spong, “Energy based control of the Pendubot,” _IEEE Transactions on Automatic Control_ , vol. 45, no. 4, pp. 725–729, 2000.
  * [31] L. Freidovich, A. Robertsson, A. Shiriaev, and R. Johansson, “Periodic motions of the pendubot via virtual holonomic constraints: Theory and experiments,” _Automatica_ , vol. 44, no. 3, pp. 785–791, 2008.
  * [32] M. S. Saad, L. N. H. M. Deri, Z. Shayfull, S. Nasir, and M. Fathullah, “Parameter estimation of damped compound pendulum using bat algorithm,” in _MATEC Web of Conferences_ , vol. 78. EDP Sciences, 2016, p. 01118.
  * [33] J. Bongard and H. Lipson, “Automated reverse engineering of nonlinear dynamical systems,” _Proceedings of the National Academy of Sciences_ , vol. 104, no. 24, pp. 9943–9948, 2007.
  * [34] H. Schaeffer and S. G. McCalla, “Sparse model selection via integral terms,” _Physical Review E_ , vol. 96, no. 2, p. 023302, 2017.
  * [35] K. Kaheman, J. N. Kutz, and S. L. Brunton, “SINDy-PI: A robust algorithm for parallel implicit sparse identification of nonlinear dynamics,” _Proceedings of the Royal Society A_ , vol. 476, no. 2242, p. 20200279, 2020\.
  * [36] P. Langley, “Data-driven discovery of physical laws,” _Cognitive Science_ , vol. 5, no. 1, pp. 31–54, 1981.
  * [37] P. Langley, G. L. Bradshaw, and H. A. Simon, “BACON 5: The discovery of conservation laws,” in _IJCAI_ , vol. 81. Citeseer, 1981, pp. 121–126.
  * [38] M. P. Deisenroth, _Efficient reinforcement learning using Gaussian processes_. KIT Scientific Publishing, 2010, vol. 9.
  * [39] E. Kaiser, J. N. Kutz, and S. L. Brunton, “Data-driven discovery of Koopman eigenfunctions for control,” _Machine Learning: Science and Technology_ , vol. 2, no. 3, p. 035023, 2021.
  * [40] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra, “Continuous control with deep reinforcement learning,” _arXiv preprint arXiv:1509.02971_ , 2015.
  * [41] J. W. Burby, Q. Tang, and R. Maulik, “Fast neural Poincaré maps for toroidal magnetic fields,” _Plasma Physics and Controlled Fusion_ , vol. 63, no. 2, p. 024001, 2020.
  * [42] K. Ono, K. Yamamoto, and A. Imadu, “Control of giant swing motion of a two-link horizontal bar gymnastic robot,” _Advanced Robotics_ , vol. 15, no. 4, pp. 449–465, 2001.
  * [43] L. Ramli, Z. Mohamed, A. M. Abdullahi, H. I. Jaafar, and I. M. Lazim, “Control strategies for crane systems: A comprehensive review,” _Mechanical Systems and Signal Processing_ , vol. 95, pp. 1–23, 2017.
  * [44] P. Morasso, A. Cherif, and J. Zenzeri, “Quiet standing: The single inverted pendulum model is not so bad after all,” _PloS one_ , vol. 14, no. 3, p. e0213870, 2019.
  * [45] J. E. Bertram and Y.-H. Chang, “Mechanical energy oscillations of two brachiation gaits: Measurement and simulation,” _American Journal of Physical Anthropology: The Official Publication of the American Association of Physical Anthropologists_ , vol. 115, no. 4, pp. 319–326, 2001.
  * [46] P. X. La Hera, L. B. Freidovich, A. S. Shiriaev, and U. Mettin, “New approach for swinging up the Furuta pendulum: Theory and experiments,” _Mechatronics_ , vol. 19, no. 8, pp. 1240–1250, 2009.
  * [47] K. J. Åström and K. Furuta, “Swinging up a pendulum by energy control,” _Automatica_ , vol. 36, no. 2, pp. 287–295, 2000.
  * [48] D. Kennedy and J. Conlon, “Inverted pendulum swing up controller,” 2011.
  * [49] T. Takahashi, K. Furuta, S. Hatakeyama, S. Suzuki, and A. Sugiki, “Swing-up control of inverted pendulum by periodic input,” _IFAC Proceedings Volumes_ , vol. 35, no. 1, pp. 283–286, 2002.
  * [50] K. Furuta, M. Yamakita, and S. Kobayashi, “Swing up control of inverted pendulum,” in _Proceedings IECON ’91: 1991 International Conference on Industrial Electronics, Control and Instrumentation_ , 1991, pp. 2193–2198 vol.3.
  * [51] I. Kapnisakis and C. Francesco, “Swing up control of inverted pendulum,” Master’s thesis, Aalborg University, Oct 2016.
  * [52] N. Matsuda, M. Izutsu, J. Ishikawa, K. Furuta, and K. J. Astrom, “Swinging-up and stabilization control based on natural frequency for pendulum systems,” in _2009 American Control Conference_. IEEE, 2009, pp. 5291–5296.
  * [53] A. Mills, A. Wills, and B. Ninness, “Nonlinear model predictive control of an inverted pendulum,” in _2009 American control conference_. IEEE, 2009, pp. 2335–2340.
  * [54] T. Maeba, M. Deng, A. Yanou, and T. Henmi, “Swing-up controller design for inverted pendulum by using energy control method based on Lyapunov function,” in _Proceedings of the 2010 International Conference on Modelling, Identification and Control_. IEEE, 2010, pp. 768–773.
  * [55] K. Yoshida, “Swing-up control of an inverted pendulum by energy-based methods,” in _Proceedings of the 1999 American Control Conference (Cat. No. 99CH36251)_ , vol. 6. IEEE, 1999, pp. 4045–4047.
  * [56] K. Graichen and M. Zeitz, “Feedforward control design for finite-time transition problems of nonlinear systems with input and output constraints,” _IEEE Transactions on Automatic Control_ , vol. 53, no. 5, pp. 1273–1278, 2008.
  * [57] E. Aranda-Escolástico, M. Guinaldo, M. Santos, and S. Dormido, “Control of a chain pendulum: A fuzzy logic approach,” _International journal of computational intelligence systems_ , vol. 9, no. 2, pp. 281–295, 2016.
  * [58] J. Driver and D. Thorpe, “Design, build and control of a single/double rotational inverted pendulum,” _The University of Adelaide, School of Mechanical Engineering, Australia_ , vol. 4, 2004.
  * [59] Y. Chen, M. Bruschetta, D. Cuccato, and A. Beghi, “An adaptive partial sensitivity updating scheme for fast nonlinear model predictive control,” _IEEE Transactions on Automatic Control_ , vol. 64, no. 7, pp. 2712–2726, 2018.
  * [60] W. Zhong and H. Rock, “Energy and passivity based control of the double inverted pendulum on a cart,” in _Proceedings of the 2001 IEEE International Conference on Control Applications (CCA’01)(Cat. No. 01CH37204)_. IEEE, 2001, pp. 896–901.
  * [61] C. W. Tao, J. Taur, J. Chang, and S.-F. Su, “Adaptive fuzzy switched swing-up and sliding control for the double-pendulum-and-cart system,” _IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics)_ , vol. 40, no. 1, pp. 241–252, 2009.
  * [62] T. Henmi, M. Deng, and A. Inoue, “Unified method for swing-up control of double inverted pendulum systems,” in _Proceedings of the 2014 International Conference on Advanced Mechatronic Systems_. IEEE, 2014, pp. 572–577.
  * [63] K. Graichen, M. Treuer, and M. Zeitz, “Swing-up of the double pendulum on a cart by feedforward and feedback control with experimental validation,” _Automatica_ , vol. 43, no. 1, pp. 63–71, 2007.
  * [64] V. D. Pamulaparthy, _An Evolutionary Model-Free Controller and its Application to the Swing-Up of a Double Inverted Pendulum_. California State University, Long Beach, 2017.
  * [65] X. Xin, “Analysis of the energy-based swing-up control for the double pendulum on a cart,” _International journal of robust and nonlinear control_ , vol. 21, no. 4, pp. 387–403, 2011.
  * [66] P. Jaiwat and T. Ohtsuka, “Real-time swing-up of double inverted pendulum by nonlinear model predictive control,” in _5th International Symposium on Advanced Control of Industrial Processes_ , 2014, pp. 290–295.
  * [67] J. Rubı, A. Rubio, and A. Avello, “Swing-up control problem for a self-erecting double inverted pendulum,” _IEE Proceedings-Control Theory and Applications_ , vol. 149, no. 2, pp. 169–175, 2002.
  * [68] K. Xu, J. Timmermann, and A. Trächtler, “Swing-up of the moving double pendulum on a cart with simulation based LQR-Trees,” _IFAC-PapersOnLine_ , vol. 50, no. 1, pp. 4094–4100, 2017.
  * [69] S. Nakayama, M. Deng, S. Bi, and A. Yanou, “Genetic algorithm with a robust solution searching scheme based controller parameters selection of a cart-type inverted pendulum,” in _Proceedings of the 2010 International Conference on Modelling, Identification and Control_. IEEE, 2010, pp. 568–573.
  * [70] T. Glück, A. Eder, and A. Kugi, “Swing-up control of a triple pendulum on a cart with experimental validation,” _Automatica_ , vol. 49, no. 3, pp. 801–808, 2013.
  * [71] V. Šetka, R. Čečil, and M. Schlegel, “Triple inverted pendulum system implementation using a new ARM/FPGA control platform,” in _2017 18th International Carpathian Control Conference (ICCC)_. IEEE, 2017, pp. 321–326.
  * [72] D. Liu and H. Yamaura, “Stabilization control for giant swing motions of 3-link horizontal bar gymnastic robot using multiple-prediction delayed feedback control with a periodic gain,” _Journal of System Design and Dynamics_ , vol. 5, no. 1, pp. 42–54, 2011.
  * [73] K. G. Eltohamy and C.-Y. Kuo, “Real time stabilisation of a triple link inverted pendulum using single control input,” _IEE Proceedings-Control Theory and Applications_ , vol. 144, no. 5, pp. 498–504, 1997.
  * [74] G. Medrano-Cerda, “Robust stabilization of a triple inverted pendulum-cart,” _International Journal of Control_ , vol. 68, no. 4, pp. 849–866, 1997.
  * [75] V. A. Tsachouridis, “Robust control of a triple inverted pendulum,” in _Proceedings of the 1999 IEEE International Conference on Control Applications (Cat. No. 99CH36328)_ , vol. 2. IEEE, 1999, pp. 1235–1240.
  * [76] A. C. Luo and C. Guo, “Period motions in a periodically forced, damped double pendulum,” in _ASME International Mechanical Engineering Congress and Exposition_ , vol. 52040. American Society of Mechanical Engineers, 2018, p. V04BT06A029.
  * [77] J. Llibre, D. D. Novaes, and M. A. Teixeira, “On the periodic solutions of a perturbed double pendulum,” _arXiv preprint arXiv:1109.6378_ , 2011.
  * [78] B. Jahn, L. Watermann, and J. Reger, “On the design of stable periodic orbits of a triple pendulum on a cart with experimental validation,” _Automatica_ , vol. 125, p. 109403, 2021.
  * [79] W. S. Koon, M. W. Lo, J. E. Marsden, and S. D. Ross, “Heteroclinic connections between periodic orbits and resonance transitions in celestial mechanics,” _Chaos: An Interdisciplinary Journal of Nonlinear Science_ , vol. 10, no. 2, pp. 427–469, 2000.
  * [80] G. Gómez, W. S. Koon, M. Lo, J. E. Marsden, J. Masdemont, and S. D. Ross, “Connecting orbits and invariant manifolds in the spatial restricted three-body problem,” _Nonlinearity_ , vol. 17, no. 5, p. 1571, 2004.
  * [81] W. S. Koon, M. W. Lo, J. E. Marsden, and S. D. Ross, “Dynamical systems, the three-body problem and space mission design,” _available online. Accessed_ , vol. 21, p. 9, 2008.
  * [82] F. Gabern, W. S. Koon, J. E. Marsden, and S. D. Ross, “Theory and computation of non-RRKM lifetime distributions and rates of chemical systems with three or more degrees of freedom,” _Physica D_ , vol. 211, no. 3-4, pp. 391–406, 2005.
  * [83] S. Mandal, S. Sinha, and M. D. Shrimali, “Machine learning potential of a single pendulum,” _arXiv preprint arXiv:2201.13390_ , 2022.
  * [84] A. Sorensen and A. S. Shiriaev, “Friction compensation in the Furuta pendulum for stabilizing rotational modes,” in _Proceedings of the 40th IEEE Conference on Decision and Control (Cat. No. 01CH37228)_ , vol. 4. IEEE, 2001, pp. 3772–3777.
  * [85] A. Shiriaev, L. Paramonov, A. Sørensen, and A. Robertsson, “Stabilization of rotational modes for the Furuta pendulum,” _IFAC Proceedings Volumes_ , vol. 34, no. 6, pp. 813–818, 2001.
  * [86] B. J. Knudson, “The double pendulum: Construction and exploration,” _Physics Department, California Polytechnic State University_ , 2012.
  * [87] M. Hesse, J. Timmermann, E. Hüllermeier, and A. Trächtler, “A reinforcement learning strategy for the swing-up of the double pendulum on a cart,” _Procedia Manufacturing_ , vol. 24, pp. 15–20, 2018.
  * [88] D. J. Christini, J. J. Collins, and P. S. Linsay, “Experimental control of high-dimensional chaos: The driven double pendulum,” _Physical Review E_ , vol. 54, no. 5, p. 4824, 1996.
  * [89] A. D. Myers, J. R. Tempelman, D. Petrushenko, and F. A. Khasawneh, “Low-cost double pendulum for high-quality data collection with open-source video tracking and analysis,” _HardwareX_ , vol. 8, p. e00138, 2020.
  * [90] K. Kaheman, E. Kaiser, B. Strom, J. N. Kutz, and S. L. Brunton, “Learning discrepancy models from experimental data,” _arXiv preprint arXiv:1909.08574_ , 2019.
  * [91] K. Graichen, M. Treuer, and M. Zeitz, “Fast side-stepping of the triple inverted pendulum via constrained nonlinear feedforward control design,” in _Proceedings of the 44th IEEE Conference on Decision and Control_. IEEE, 2005, pp. 1096–1101.
  * [92] R. Čečil, V. Šetka, and M. Schlegel, “Radio module for fast real-time control of inverse triple pendulum,” in _2016 3rd International Symposium on Wireless Systems within the Conferences on Intelligent Data Acquisition and Advanced Computing Systems (IDAACS-SWS)_. IEEE, 2016, pp. 80–84.
  * [93] M. Schmidt and H. Lipson, “Distilling free-form natural laws from experimental data,” _Science_ , vol. 324, no. 5923, pp. 81–85, 2009.
  * [94] K. Graichen, M. Treuer, and M. Zeitz, “Swing-up of the double pendulum on a cart by feedforward and feedback control with experimental validation,” _Automatica_ , vol. 43, no. 1, pp. 63–71, 2007.
  * [95] HIWIN, _Linear Motor System Technical Information_ , HIWIN MIKROSYSTEM CORP, Taichung 40852, Taiwan, 2017.
  * [96] Y. P. Kumar and R. Bhimasingu, “Alternative hardware-in-the-loop (HIL) setups for real-time simulation and testing of microgrids,” in _2016 IEEE 1st International Conference on Power Electronics, Intelligent Control and Energy Systems (ICPEICES)_. IEEE, 2016, pp. 1–6.
  * [97] T. Glück, A. Eder, and A. Kugi, “Swing-up control of a triple pendulum on a cart with experimental validation,” _Automatica_ , vol. 49, no. 3, pp. 801 – 808, 2013.
  * [98] V. Kraz, “Mitigating EMI issues in servo motors and variable frequency drives,” _2016 EMC Test and Design Guide_ , pp. 9–16, 2016.
  * [99] HIWIN, _mega-fabs D1 Drive User Guide_ , HIWIN MIKROSYSTEM CORP, Taichung 40852, Taiwan, 2011.

##  Appendix A Real-Time System Using Simulink Desktop Real-Time

Besides using the Speedgoat Real-Time machine and Simulink Real-Time, it is
possible to use a low-cost alternative as the Real-Time system. This solution
uses the National Instrument Data Aqcusition (DAQ) device PCIe-6341 as the
data collection device (I/O module). PCIe-6341 can read up to four quadrature
encoders at the same time. Moreover, it has multiple digital I/Os and analog
I/Os. For more details on the device specification, please check the user
manual. In this setup, the sensors are connected to the National Instrument
terminal connector SCB-68A. Then, the terminal connector and DAQ are connected
using cable SHC68-68-EPM. This connection completes the sensor data
acquisition task. To read sensor signals in real-time and send control command
(analog signal) to the motor drive (velocity mode), the Simulink Desktop Real-
Time is used as the real-time operating system. In this case, only one
computer is needed to develop the user program and perform real-time control.
This real-time system setup has been tested in our previous paper [90]. When
using Simulink Desktop Real-Time, the real-time program only runs on a single
core instead of multi-cores as Simulink Real-Time does. This drawback
decreases the maximum sampling frequency of the Simulink Desktop Real-Time
setup. Our previous experiments show the maximum sampling rate in pure data-
collection mode is around $5kHz$ when using Simulink Desktop Real-Time with
the host machine we mentioned in Sec. 5. The maximum sampling rate of the
double pendulum stabilization task (using time-varying LQR and Kalman filter)
is around $2kHz$ in this case.

##  Appendix B Pendulum Arm Details

###  B.1 Design Details

An overview of our pendulum arm’s design is described in section 3. Here, we
describe the design of the pendulum arm in more detail. The main components of
the pendulum arm are: 1) pendulum body, 2) shaft, 3) bearing plate, and 4) 3D
printed protection case. The overall structure of the pendulum arm is
determined by how it transmits the rotational information measured by the
encoders. In our design, a slip-ring sends the encoders’ electrical signals
(mainly the A-, B-, and I-channel signals) to the real-time system, and
conducts currents to the encoder sensors on the rotational component. The
slip-ring design introduces friction on the contact between the slip-ring
shaft and brush block. To minimize this additional effect of friction, a
miniature slip-ring and slip-ring brush are used with gold contact surfaces
that reduce the electrical noise during the rotational movement of the
pendulum arm. Other designs based on vision tracking or wireless technology to
measure the pendulum arm rotational angle could avoid these additional
friction effects. However, the slip-ring design is simple and does not have
latency in the signal transmission that occur in vision-based and wireless
communication type pendulum arms. Also, no additional computational resources
are needed to determine the rotational angle of the pendulum compared to
vision-based tracking systems. This characteristic is particularly beneficial
for achieving higher sampling rates. The challenge of using a slip-ring is
that it requires precision machining of the pendulum shaft. Moreover, the
slip-ring has a fixed number of channels to transmit signals. This may reduce
the flexibility of the setup if new sensors (e.g. an inertial measurement unit
(IMU) sensor) are required for future experiments. To accommodate the slip-
ring and to connect it with the sensors, the first and second pendulum arm’s
shaft is designed to be hollow, as shown in Fig. 14. As the first pendulum arm
shaft takes most of the static and dynamic load, it has a larger diameter than
the second and third pendulum arm shafts. Moreover, to minimize the axial
oscillation of the pendulum arm, a thread is machined on the first pendulum
shaft such that the axial load of the pendulum arm is adjustable. When more
axial force is applied, we can reduce the axial oscillation of the pendulum
arm.

Figure 14: Design of the bearing plate and pendulum arm’s shaft. The bearing
can be installed on the bearing plate and together support the free rotational
movement of the pendulum shaft and pendulum arm. The pendulum arm’s shaft is
designed hollow to accommodate the slip-ring wires. The groove on the bottom
of the pendulum shaft is used to place guide the slip-ring wires into the
pendulum arm.

The slip-ring wires enter the pendulum arm through a small hole on the front
side of the pendulum arm, near the position where the pendulum shaft is
mounted, as shown in Fig. 15 (A). The slip-ring wire enters the pendulum arm
through this hole and connects with the encoder located on the backside of the
pendulum arm. The groove in Fig. 15 (A) is aligned with the groove on the
pendulum arm’s shaft, as shown in Fig. 14. Together, they guide the slip-ring
wire and provide space to store it and avoid the cable to stick out of the
front face of the pendulum arm. To properly manage the slip-ring wires inside
the pendulum arm, a 3D printed cable clip is designed, shown in Fig. 4 (B).
This cable clip holds the slip-ring wire to its place and prevents twining of
the slip-ring wire. To reduce the weight of the pendulum arm, several holes
are drilled near the shaft hole, indicated in Fig. 15 (B). Moreover, two holes
on the side of the pendulum arm facilitate the installing of the encoder disk
on the pendulum shaft, shown in Fig. 15 (C). In Fig. 15 (C), the stair case
shoulder is shown that properly secures the bearing that is installed on the
pendulum arm. This stair case shoulder is not needed in the third pendulum arm
since no other pendulum arm is attach to it, shown in Fig. 15 (D).

Figure 15: Design of the pendulum arm. (A) design features necessary to allow
proper wiring of the slip-ring, and the hole where the pendulum shaft is
installed. (B) back side of the pendulum where the shaft is installed, and a
sequence of drilled holes that reduce the weight of pendulum arm. (C) place
where the bearing and encoder are installed. (D) third pendulum arm without
bearing hole.

Ceramic bearings are used to minimize the friction during the rotational
movement. They are installed on the bearing plate shown in Fig. 14 and the
pendulum arm shown in Fig. 15. The great advantage of the ceramic bearing is
that it operates without lubrication, effectively decreasing the drag force
caused by lubricants. Moreover, a bearing without sealing is used to further
reduce the friction force, since the pendulum setup is used in a clean lab
space. Thus, special care must be taken when assembling and dissembling the
pendulum arm to ensure that no dust or chips enter the bearing during the
process. Two bearings are used to fully support the rotational movement of the
pendulum arm. Moreover, the bearings are aligned by connecting the bearing
plate and pendulum arm body together. Together, they form a bearing housing
where the shaft is installed. To make sure the pendulum shaft does not slide
out during the rotational movement of the pendulum arm, external retaining
rings are used to secure the pendulum shaft. To install the external retaining
rings, grooves are machined onto the top of the second and third pendulum arm
shafts, shown in Fig. 14.

###  B.2 Manufacturing Details

Several components of the pendulum arm are manufactured: 1) pendulum arm (Fig.
15), 2) pendulum shaft (Fig. 14), 3) bearing plate (Fig. 14), 4) protection
case (Fig. 15 (E) and (F)), and 5) wire clipper (Fig. 15 (B)). In this
section, we talk about the manufacturing details of those components.

Figure 16: Overall steps needed to manufacture the pendulum arm: (A) the
inside features of the pendulum arm is machined, and the outline of the
pendulum arm is processed until only a thin layer of aluminium connects the
pendulum arm and aluminium block. (B) and (C) the machined pendulum arm is
knocked off using a robber hammer. (D) the machined pendulum arm is polished
to get rid of any burr on the edge of the pendulum arm.

The pendulum body is CNC milled from a multipurpose 6061 aluminum block with a
dimension of 5/8" thick, 3" wide, 1 foot long. The aluminum block is first
face milled on the front and back faces. Then the edge of the aluminum block
is machined. This step allows to make the faces of the aluminum block parallel
to each other (front and back, edge to edge). Next, the aluminum block is
secured on the CNC machine, and the center of the shaft hole is used as the
origin of the x, y, and z coordinates. The back side of the pendulum arm is
first machined. While more material remains in the aluminum bar, the hole for
the pendulum shaft is first drilled to a diameter close to the actual diameter
needed. Next, the CNC mill is used to refine the shape and dimension of the
hole until it is close to the desired dimensions. Finally, the reamer is used
to refine the size of the hole for a smooth installation of the shaft. We
choose to first machine the hole for pendulum shaft when there is more
material left, since this will increase the rigidity of the aluminum bar
during the drilling and milling process, resulting in a more precise hole.
After manufacturing the hole for the shaft, the hole for the bearing
installation is machined using similar steps, where the hole is first drilled,
then milled, and finally refined using a reamer. Next, the threaded hole for
connecting the bearing plate and the pendulum arm is drilled, as shown in Fig.
15 (C). After this step, the weight reducing hole shown in Fig. 15 (B) is
machined. Next, the aluminum block is flipped and recenter using edge finder.
Then, the hole shown in Fig. 15 (A) is milled to correct shape and depth.
Next, a threaded hole is drilled to install the wire clipper and encoder,
shown in Fig. 4 (B) and Fig. 15 (C). Then the pendulum arm is flipped again to
the back side to machine the inner part. The inner side of the pendulum arm is
milled by programming the CNC machine to achieve the desired shape, shown in
Fig. 15 777The inner side corner of the manufactured pendulum arm will not be
a straight corner. Instead, its shape is an arc whose radius is determined by
the radius of the end mill used to machine the inner side.. Once this step is
finished, the outer shape of the pendulum arm is milled, shown in Fig. 16 (A).
The TiAlN Coated, 2 flute, 1/4" mill diameter, 2-1/2" overall length end mill
is used to mill the outer shape of the pendulum arm. At the final round of
machining, a thin layer (0.5 mm) of aluminium is left to connect the pendulum
arm body and the remaining of aluminum block, then a rubber hammer is used to
knock out the pendulum arm, as shown in Fig. 16 (A) and (B). The resulting
pendulum arm will have rough edges, shown in Fig. 16 (C). Thus, the pendulum
arm is polished after the holes on the side of the pendulum arm shown in Fig.
15 (C) are drilled. The final pendulum arm is shown in Fig. 16 (D).

The similar process is used to machine the bearing plate by using a 0.16"
thick, 6" x 6" multipurpose 6061 aluminum sheet. After the aluminum sheet is
secured on the CNC machine, the face mill is used to get the correct height of
the bearing plate. Next, the bearing hole is manufactured. Then the through
holes shown in Fig. 14 are drilled. Finally, the outer shape of the bearing
plate is milled until there is only a thin layer of aluminum connecting the
bearing plate and aluminum sheet, and the bearing plate is knocked out using
the same approach shown in Fig. 16 888Same as footnote 3, the straight corner
in Fig. 14 will be an arc whose radius is determined by the radius of the end
mill..

The material we used for the pendulum shaft is 1566 carbon steel, which
balance high strength and good machinability. For the first pendulum arm, 12"
long material with 1/2" diameter raw material is used, while 12" long 3/8"
diameter raw material is used for the second and third shaft. To manufacture
the shaft, a lathe is used. When machining the first and second arm shaft, a
through hole is first drilled. Then, a shallow hole is drilled to create a
step which allows proper installation of the slip-ring. This can be seen in
Fig. 14. Next, the main diameter of the shaft is lathed. After the major shape
of the shaft is obtained, a groove is lathed for the second and third arm to
allow installing the external retaining ring. For the first arm, a thread is
lathed to allow application of the axial force by screwing a nut. The groove
on the bottom of the first and second shaft is milled after it is press fitted
into the pendulum arm body. After the machining, all the parts are polished
and cleaned to remove dust or metal chips. Finally, the protection case and
wire clip is 3D printed using Polylactic Acid (PLA) material. The main
functionality of the case is to protect the slip-ring inside the pendulum arm
from accidental collision.

###  B.3 Assembly Details of Second and Third Arm

The assembly of the double pendulum is described in section 3. For the
assembly of the triple pendulum illustrated in Fig. 6, the following steps are
needed: 1) Follow all the assembly steps of the double pendulum. 2) Slide the
shim ($11$) into the shaft of the third arm ($22$). Next, slide the third
pendulum shaft ($22$) into the bearing of the second arm ($12$) and stop until
the shim ($11$) contacts the inner ring of the bearing. 2) Slide the shim
($16$), encoder disk ($17$), and another shim ($18$) onto the third arm’s
shaft ($22$). Then, slide the assembled bearing plate onto the shaft ($22$).
Finally, clip the external retaining ring ($19$) onto the shaft ($22$). This
step is the same as mentioned before. 3) Slide the 3D printed shim ($6$) and
encoder reader ($7$) into the desired place by aligning the holes. Then,
install the screws ($8$) to secure its position. 4) Next, install the
protection case by aligning the holes on the pendulum arm body, bearing plate,
and protection case. Mount the screws ($4$) to fasten the assembly. 6)
Finally, install the wire clipper ($5$) into the pendulum arm ($15$) by
aligning the holes and tighten the screws ($4$). The above steps finish the
assembly of the second and third pendulum arm, and results in the final
assembly shown in Fig. 4. The complete assembly process of the second and
third arm are illustrated in Fig. 6.

##  Appendix C Pendulum Cart Details

Our multi-link pendulum uses a linear motor to provide actuation to the
pendulum arm. The advantage of using the linear motor is that it does not have
backslash issues, which frequently happen in the belt-drive type servo motor.
This benefit allows accurate control of sensitive maneuvers, such as the
swing-up of double and triple pendulums. As discussed in section 4, to size
the linear motor, first, the desired maximum speed and acceleration of the
cart are defined using desired motion profile of the pendulum. We choose a
HIWIN linear motor system LMX1K-SA12-1-2000-PGS1-V103+HS. For more details on
choosing the linear motor size, we refer the readers to see Appendix A of the
HIWIN linear motor system manual [95]. The overall look of the selected linear
motor can be seen in Fig. 17. As Fig. 17 shows, the linear motor already comes
with a cable management track and motor stage. Moreover, Fig. 17 (A) suggests
the motor stage is not flat, which suggests the proper design of connection
between the pendulum arm and linear motor stage is needed. Fig. 17 (B)
indicates there are pre-drilled holes on the backside of the linear motor
stage. Those pre-drilled holes can facilitate the installation of a switch
plate. Finally, Fig. 17 also indicates that the both side of the linear motor
rail has shock absorbers installed which prevents the direct collision of the
motor stage and the end of linear motor rail.

Figure 17: Overview of the linear motor that drives the pendulum cart, with
the linear motor cable track and the stage with pre-drilled holes, which allow
the installation of user designed parts. This linear motor stage is used to
mount the aluminum plate that is used to install the bearing housing and the
pendulum arm. (B) Limit switch plate installed on the back side of the linear
motor stage.

The connection between the pendulum arm and the linear motor stage are shown
in Fig. 7 (A) and (B). A bearing housing is needed to provide support for the
first pendulum arm shaft and secure it so that the pendulum arm can perform
free swing. Moreover, an aluminum plate is machined so that the bearing
housing can be connected with the linear motor stage. The details of the
bearing housing can be seen in Fig. 18. As Fig. 18 shows, one thorough hole is
drilled on the front and back side of the housing. This hole is used to
install the bearings that mate with the first pendulum shaft. In order to
maintain the relative distance of the bearings, a spacer needs to be
installed. Same as the pendulum arm, the ceramic bearing is used to minimize
the drag force. Four more thorough holes are been drilled on the bottom of the
bearing house which is used to mount the bearing housing to the aluminum plate
and linear motor stage. Two threaded holes are drilled on the side panel of
the bearing house and are used to mount the encoder reader. To avoid collision
of the encoder disk and bearing housing, the bottom of the bearing housing has
been designed as a C shape. As for the aluminum plate, the design is
straightforward as Fig. 7 and Fig. 18 shows. It has four holes that is used to
mate the aluminum plate with linear motor stage. The back side of the aluminum
plate has multiple stripes that acts as a stiffener which is used to
strengthen the plate. Four small threaded holes are drilled on the top of the
aluminum plate to install 3D printed cable managing tool while one bigger hole
is milled to install the circular level indicator. This circular level
indicator is useful as it can help user to level the pendulum cart. The final
piece we designed for the pendulum cart are the limit switch plate as it shown
in Fig. 7 (B). Fig. 7 (B) shows two limit switch plates installed on the back
side of the linear motor stage, they are responsible to block the laser limit
switch when the pendulum cart moves to the edge of the linear rail. The laser
limit switch is installed on the linear motor by designing a 3D printed base
as Fig. 9 (B) shows.

Figure 18: This figure illustrates the overall look of the bearing housing and
cart plate. The main features on the bearing housing is the thorough hole that
is used to install the bearing. To make the manufacturing process easier, a
thorough hole is used and a spacer is later installed to maintain the distance
of two bearings. As for the cart plate, it has simple shape and features. The
four tiny threaded holes are used to install the cable management tool while
the larger hole is milled to install the circular level indicator.

###  C.1 Manufacturing Details

The major parts that need to be manufactured in the pendulum cart are: 1)
Bearing housing. 2) Pendulum cart plate. 3) Limit switch plate. 4) 3D printed
cable management tool. 5) 3D printed limit switch base. This section will go
through the manufacturing process of those components.

To manufacture the bearing housing, a 3" multi-purpose aluminum cube is
machined. Fig. 19 shows the overall machining process.

1) To start with, the raw material is face milled on all fronts to create
datum planes. Next, a shallow hole whose diameter is smaller than the diameter
of the bearing is milled, and the center of the hole is set as the origin of
the coordinate system. Then, the front of the bearing housing is milled to
create the wanted shape. The milling continues until the end mill reaches the
same height as the side panel used to mount the encoder reader. 2) Once the
front shape of the bearing housing is machined, it is flipped over to
manufacture the features on the backside. The aluminum cube is first milled
until the end mill is at the same height as the total width of the bearing
housing. Next, a through-hole is drilled whose diameter is smaller than the
bearing to be installed. Then a reamer is used to refine the shape and
diameter of the hole. The goal is to make the bearing hole and bearing have a
transitional fit. Once this step is done, the milling is continued until the
backside of the bearing housing is machined to desired shape. Then two
threaded holes are drilled for installing the encoder reader. When drilling
these two holes, the origin of the bearing hole is used as the center of the
coordinated system since the relative distance between the bearing hole and
the holes for installing the encoder reader is what matters. 3) Finally, the
bearing housing is milled in the upright position to produce a straight
corner. Once finished, it is polished using sandpaper, and the sharp edges are
smoothed using a deburring wheel. It is noteworthy that this bearing housing
can be 3D printed if it does not have too much load on it, for example, when
only a single pendulum formulation is needed.

Figure 19: This figure illustrates the overall process of machining the
bearing housing. To start with, the aluminum cube is face milled to create the
datum face. Then the features on the front of the bearing housing is machined.
Next, the aluminum cube is flipped over to machine the features on the
backside of the aluminum cube and all the necessary holes needed are drill.
Finally, the bearing housing is polished and sharp edges are smoothed.

The manufacturing of the pendulum cart plate is easy to do. A multipurpose
6061 Aluminum with 7/16" thickness and 8" x 8" length and width is used to
manufacture the pendulum cart plate. The following steps are needed to
manufacture it. 1) To start with, the raw material is face milled to create a
datum plane. Next, it is milled to have the same width and length as the
designed cart plate. 2) Next, the front face of the cart palate is face
milled, and all the holes needed are drilled. This process includes the hole
used to install the circular level indicator. 3) Once the features on the
front of the cart plate are manufactured, it is flipped over to mill the
stiffener. Finally, the post-processing is done to polish the cart plate, and
the deburring wheel is used to make the smooth edges. If the pendulum cart
does not have a considerable load and does not require high-speed movement, it
is also possible to 3D print the pendulum cart plate.

The left and right limit switch plates are manufactured using a multipurpose
6061 aluminum sheet with 0.016" thickness. The overall outline of the limit
switch plate is first drawn on the aluminum sheet using a marker pen and
ruler. Then, the holes are drilled, which are needed to install the plates to
the linear motor stage. Then, a metal brake and scissors cut the aluminum
sheet to the desired shape. Finally, the aluminum sheet is bent, polished, and
deburred. After using the above steps, the switch plates can be produced
easily. As for cable management tools and limit switch base, they are 3D
printed with PLA filament.

##  Appendix D System Frame Details

The linear motor selected in Sec. 4 is mounted on a support frame in order to
minimize the unwanted vibration during the cart movement. This motivates us to
design a system frame to mount the pendulum cart and provide support to it.
This section introduces the design and manufacturing of the system frame we
used. Moreover, we show how to install the linear motor to the system frame
and provide a detailed bill of materials for reproduction.

###  D.1 Design Details

Fig. 20 shows the overall view of the system frame we designed. Our design is
similar to the one shown in [92, 71]. To make sure the pendulum arm won’t
collide with the ground, four vertical aluminum extrusions are connected with
the linear motor using corner concealed brackets. This lifts up the linear
motor from the ground and creates space for the pendulum arm. To make sure the
vertical aluminum extrusion is stable in the $x-z$ plane, the diagonal brace
is used to connect the linear motor and vertical aluminum extrusion as shown
in Fig. 20 (A). Moreover, four more aluminum extrusions are connected together
using a machined connector plate to create a X shaped frame as shown in Fig.
20 (C). By connecting the X shaped frame and the four vertical aluminum
extrusions, the movement of the frame is further constrained in the $x-z$
plane. Next, the frame’s movement is constrained in the $y-z$ plane. This is
achieved by connecting the vertical frames using an aluminum extrusion as
shown in Fig. 20 (B) and (D). To provide more support, the vertical aluminum
extrusion on the back side is further connected to another aluminum extrusion
to form a triangle using T-slotted framing structural brackets, as shown in
Fig. 20 (E) and (F). To provide a space to place the electrical box, the real-
time system and the development system, two horizontal aluminum extrusions are
used to connect the left and right vertical aluminum extrusion as shown in
Fig. 20 (F). Finally, to allow easy movement of the experimental system from
place to place, four wheels can be installed as an option which is shown in
Fig. 20 (F). However, it is recommended that the wheels are only installed
when it is necessary to move the system frames. When performing actual
experiments, the wheels should be removed to avoid unwanted oscillation of the
system frame.

Figure 20: System frame. The linear motor is lifted up using four vertical
aluminum extrusion. Different aluminum extrusions are installed to constrain
the movement of system frame in the $x-z$ and $y-z$ plane. To allow easy
moving of the experimental setup, four wheels can be installed to the system
frame as shown in (E) and (F).

###  D.2 Manufacturing Details

Figure 21: Assembly of the system frame. (A) Installation procedure of the X
shaped frame. (B) Connection of the X shaped frame with the vertical aluminum
extrusion ($55$). (C) Installation of the wheel to the system frame. (D)
Installation of diagonal brace.

The manufacturing of the system frame is straightforward since most of the
components can be directly purchased online. The main components that need to
be manufactured are: 1) Aluminum extrusion, which has to be trimmed down to
the correct length. 2) Aluminum extrusion connector plate, which needs to be
machined. 3) 3D printed alignment tool, which is used to facilitate the
assembly of the X shaped frame. In order to trim the aluminum extrusion to the
correct length, the band saw is first used to trim the aluminum extrusion to a
length that is slightly longer than the desired length. Next, the CNC mill is
used to machine the cut surface of the aluminum extrusion to the correct
length. Finally, the machined end is polished and unwanted burr is removed. To
machine the connector plate shown in Fig. 20 (C), a 0.16" thick, 6" x 6"
aluminum plate (89015K255) is machined. First, the through holes that is used
to mate with the bolts and nuts are drilled. Then, a simple CNC program is
written to mill the outer shape of the connector. As for the alignment tool
that helps the assembly of the X frame, it is printed using PLA filament.

###  D.3 Assembly Details

To assemble the system frame, four major steps are needed: 1) The X shaped
frames are assembled. 2) The X shaped frame is connected with the four
vertical aluminum extrusions. 3) The assembled aluminum frame is connected
with the aluminum extrusion in the $x-y$ plane and diagonal braces for single
rails. 4) Finally, the linear motor is installed with the system frame and all
the screws are fastened accordingly. The above mentioned steps are illustrated
in Fig. 21.

As Fig. 21 (A) shows, to better assemble the X shaped frame, a 3D printed
alignment tool ($52,53$) is used. The alignment tool is first assembled by
inserting the 3D printed cylinder ($52$) into the 3D printed block ($53$). The
3D printed block ($53$) serves as a reference to make sure each aluminum frame
($50$) has the correct angle to each other. This is achieved by inserting the
aluminum frame ($50$) into the 3D printed cylinder ($54$), making sure it is
perpendicular to the surface of 3D printed block ($53$). Once the correct
angle between the aluminum frame ($50$) is achieved, the connector plate
($51$) is used to connect each frames using drop-in bolts and nuts ($54$).
This finishes the step 1, assembly of the X shaped frame.

In step 2, 60 degree bracket ($56$) is first slid into the aluminum frame
($50$) as shown in Fig. 21 (B) step 1 and step 2. Then the vertical aluminum
frame ($55$) is slid into the 60 degree bracket as shown in step 3 of Fig. 21
(B). This completes the assembly of the X shaped frame and vertical frame. To
avoid the collision of the pendulum arm and 60 degree bracket ($56$), the top
right and top left 60 degree bracket ($56$) is installed on the back side of
front X shaped frame, as shown in Fig. 21 (B).

Fig. 21 (C) and (D) illustrates the details of step 3. First, the corner
concealed bracket ($60$) is slid into the aluminum spacer ($59$). Then, this
aluminum spacer is slid into the middle of front and back X shaped frame as
shown in Fig. 21 (C) step 1. In step two, the wheel ($62$) of the system frame
is assembled with the aluminum frame ($61$). In step 3, the 30 degree bracket
($57$) is first slid into the vertical aluminum frame of the back X shaped
frame ($55$) and the bolts and nuts are slightly tightened to keep them in
place. Then, step 4 is conducted in which the aluminum frame ($58$) is slid
into the 30 degree plate ($57$). Next, in step 5 a 60 degree bracket ($56$) is
slid into the aluminum frame ($58$) and slightly tightened. In step 6, the
corner concealed bracket ($60$) is installed with the vertical aluminum frame
($55$) and in step 7 the aluminum frame ($61$) is slid into the corner
concealed bracket ($60$) and 60 degree plate ($56$). Next, the diagonal brace
in installed into the vertical frame as shown in Fig. 21 (D), and the screws
are slightly tightened to make sure the diagonal brace stays in place. The
procedure to install the horizontal aluminum extrusion ($64$) to the aluminum
extrusion with wheel ($61$) can be seen in Fig. 22 (A). As Fig. 22 (A) shows,
the corner concealed bracket ($60$) is first installed into the aluminum
extrusion ($64$) then extrusion ($64$) is slid into the extrusion ($61$). This
further stabilizes the system frame and extrusion ($64$) can be used to place
the development computer and electrical box, as shown in Fig. 2. The above
steps finish the assembly of the system frame. After the system frame is
assembled, the linear motor ($30$) can be installed onto the system frame
shown in Fig. 22 (B). To do so, the corner concealed bracket ($60$) is
installed onto the aluminum base of the linear motor. Then the corner
concealed bracket ($60$) is slid into the vertical aluminum frame ($55$).
Next, the diagonal brace is connected with the linear motor. Finally, all the
screws and nuts are tightened. Since the linear motor and aluminum frame can
be heavy, all the installation process mentioned above should be finished by
at least two persons.

Figure 22: Assembly process of the system frame (A) and linear motor (B).

##  Appendix E Electrical System Details

###  E.1 Pendulum Arm Wiring Details

Fig.23 and Table. 1 show the detailed wiring specification of the pendulum
arm. Fig.23 shows the first encoder is directly connected to the first
differential driver while the second and third encoders are connected with the
differential driver using slip-rings. Moreover, the output of the differential
driver connects to the US Digital CA-C10-SH-NC 10 feet cables, which then
connect to the target computer terminal board as Table. 1 suggests. It is
important to point out that the US Digital CA-C10-SH-NC 10 feet cables are
shielded cables. Thus, the shield also connects to the ground of the IO-392
ground pin, which helps reduce the effect of EMI noise.

Figure 23: This figure illustrates the overall electrical wiring of the
pendulum arm encoder. The first encoder is directly connected to the first
differential driver. To connected the second and third encoder to the
differential driver, two slip-rings (slip-ring and brush block) are used. The
second and third differential driver shares the 5V and ground channel of the
first slip-ring. Moreover, the first slip-ring’s 5V and ground channel is
connected to the second slip-ring, which then conducts electricity to the
third encoder. The third encoder uses the both the first and second slip-ring
to connect with the differential driver. The output of the differential driver
is connected to the US Digital CA-C10-SH-NC 10 feet cables, and those cables
are then connected to the IO-392 module as Table. 1 shows. Table 1: This table
shows the pin out of IO-392 module for encoder reading and its connections
with the differential driver. D1 to D3 represents the differential driver 1 to
3 shown in Fig. 23. "-x" represents the corresponding "x"-th pin of the
specific electrical component. The ground of the encoder sensor is connected
to "$0$ V" instead of "ground" as suggested by Speedgoat.

Pin |  | Code Module
---
Channel
Functionality | Direction | Transceiver | Connects To
1a |  | Ground |  |  |
2a |  | Ground |  |  |
3a | 1 | QAD-A | IN | RS422/485(+) | D1-6
4a | RS422/485(-) | D1-5
5a | 1 | QAD-B | IN | RS422/485(+) | D1-10
6a | RS422/485(-) | D1-9
7a | 1 | QAD-C/Index | IN | RS422/485(+) | D1-4
8a | RS422/485(-) | D1-3
9a | 2 | QAD-A | IN | RS422/485(+) | D2-6
10a | RS422/485(-) | D2-5
11a | 2 | QAD-B | IN | RS422/485(+) | D2-10
12a | RS422/485(-) | D2-9
13a | 2 | QAD-C/Index | IN | RS422/485(+) | D2-4
14a | RS422/485(-) | D2-3
15a |  | 0 V |  |  |  | D1-2, D2-2, D3-2,
---
Differential Cable Shield
16a |  | 5 V |  |  | D1-7, D2-7, D3-7
17a |  | Ground |  |  |
1b |  | 0 V |  |  |
2b |  | 5 V |  |  |
3b | 3 | QAD-A | IN | RS422/485(+) | D3-6
4b | RS422/485(-) | D3-5
5b | 3 | QAD-B | IN | RS422/485(+) | D3-10
6b | RS422/485(-) | D3-9
7b | 3 | QAD-C/Index | IN | RS422/485(+) | D3-4
8b | RS422/485(-) | D3-3
9b | 4 | QAD-A | IN | RS422/485(+) | HIWIN D1-CN2-16
10b | RS422/485(-) | HIWIN D1-CN2-17
11b | 4 | QAD-B | IN | RS422/485(+) | HIWIN D1-CN2-18
12b | RS422/485(-) | HIWIN D1-CN2-19
13b | 4 | QAD-C/Index | IN | RS422/485(+) | HIWIN D1-CN2-20
14b | RS422/485(-) | HIWIN D1-CN2-21
15b | 1 | Interrupt Input | IN | RS422/485(+) |
16b | RS422/485(-) |
17b |  | Ground |  |  |

###  E.2 Components Choice of Linear Motor’s Electrical System and Wiring
Details

This section will detail the functionalities and specifications of the
electrical parts used to power the linear motor. A complete wiring diagram of
the entire system is also provided.

The first component introduced here is the emergency stop button module.
During the multi-link pendulum experiments, the linear motor may perform
undesired motion due to coding error or controller failure. It is also
possible that unwanted electrical shortage happens due to the improper use of
the system. In those undesired situations, the user must press the emergency
stop button to cut all the power supplied to the linear motor, avoiding damage
to the setup and protecting the operator around the equipment. It is also
necessary to have an On/Off button that controls the system’s power supply.
The POWERTEC 71354 magnetic switch ($75$) is selected as our emergency stop
button to meet those requirements. This emergency stop button can be used in a
single-phase 120V power line, matching how we supply the linear motor power.
By checking the specification of the linear motor, we find out the peak
current of the linear motor is around $12.7A_{rms}$, which is lower than the
rated current of the On/Off switch ($16A_{rms}$) and emergency switch
($18A_{rms}$) installed inside the emergency stop button module. Thus, this
emergency stop module is selected to control the power supply of the linear
motor. The emergency stop button module should be installed somewhere that is
easy to reach for the operator. This location may change based on the
operator’s preferred standing position. In our application, we decided to
install the emergency button at the side of the system frame. Please check its
user manual for details on the position holes of the module.

The next vital component is the circuit breaker (MCCB, $76$). The circuit
breaker has the following functionalities: 1) Circuit breaker can cut off the
power supply to the linear motor when there’s a shortage in the electrical
system. 2) It can stop the power supply to the linear motor when it is
overloaded, which avoids damage to the linear motor. 3) It can simply serve as
an On/Off switch that controls the power supply to the linear motor. The first
and third functions of the circuit breaker are easy to understand, and we will
illustrate the second functionality more. The overloaded situation might
happen when the control algorithm requires the linear motor to perform
unrealistic acceleration or de-acceleration. For example, during the
feedforward swing-up control of the double or triple pendulum, a feedback
force is usually needed to compensate for noise and model uncertainty. It has
been shown [63, 97] that sometimes the LQR gain calculated to stabilize the
feedforward trajectory is near singular. This indicates a considerable control
input needs to be applied to the system to compensate for a slight deviation.
Suppose the feedback control force is not thresholded. In that case, the
controller may require the linear motor to apply unrealistic force to the
pendulum arm, causing a massive amount of currents supplied to the linear
motor resulting in overload. Another case where overload might happen,
although unlikely in our case, is that the linear motor gets stuck
mechanically. In this situation, the motor drive will try to apply more
current to the linear motor to make it move, eventually causing over current.
Thus, having a circuit breaker is crucial in controlling the linear motor for
safety reasons. The Eaton miniature circuit breaker FAZ-B3-2-NA ($76$) is used
in our application. According to the user’s manual, its rated current is $3A$,
with the maximum allowed AC voltage being $277V$. The tripping current is 3 to
5 times the rated current, with stripping time around 0.005 to 2 seconds. The
resulting tripping current ranges from $9$ to $15A$ and covers the peak
current of the linear motor, which is $12.7A$. Thus, using this circuit
breaker can help us avoid linear motor damage when the current supplied to the
linear motor is larger than the allowed peak current. Moreover, the selected
circuit breaker uses a trip-free design and can not be defeated by manually
holding the handles at the "On" position. Another plus is that the user can
easily install it on the DIN rail. For more specifications on the circuit
breaker, please check its user manual.

Figure 24: This figure illustrates the overall electrical components needed to
provide power supply to the linear motor. An electrical box is used to put all
the components together.

The magnetic contactor ($77$) is needed to start and turn off the linear
motor. The magnetic contactor is a middle path between the power source and
the linear motor. It helps avoid the direct connection of the power source to
the linear motor, which helps prevent the sudden change of state of the linear
motor. Combined with a circuit breaker, they can be thought of as a motor
starter. The WEG Electric CWC016-00-22V18 ($77$) is used as a magnetic
contactor in our design, allowing easy installation on the DIN rail. This
contactor has two normally open and two normally closed contacts rated $16A$
current input under $60Hz$ $120VAC$. This specification fits our needs since
the power output in the US is $120VAC$ at $60Hz$, and the maximum current
needed by the linear motor is below the rated current of the contactor. By
checking the user manual of this contactor, a "locking" mechanism of the
magnetic contactor is achieved by using a momentary switch. The LCLICTOP AC
660V Red and Green Momentary Switch ($86$) is used to accomplish this. It can
operate up to 660 VAC, and the current rating is 10 A. Fig. 24 shows the
overall wiring of the magnetic contactor and momentary switch.

It is recommended to install a line reactor on the motor drive’s input side to
protect it from voltage spikes, surges, and transients. The LR-11P0-1PH ($79$)
is used to achieve this. This line reactor has a rated current of $16A$ at
$120VAC$. Thus, it satisfies our usage scenario in a single-phase case.

The linear motor drive ($80$) controls the movement of the linear motor by
providing a high-frequency signal with sharp pulse edges. Those sharp edges of
the signal can introduce unwanted ground current to the entire electrical
system. The ground current can even cause interference between the different
electrical components. This kind of interference is not wanted, especially
when an accurate reading of the pendulum arm rotational angle is needed. The
interference between the linear motor and encoder can cause additional
unwanted pulse width signals to appear in the encoder’s A, B, and Index
channels, which might result in the wrong sensor reading. This is why the
differential driver is used to transfer the single-ended encoder signal into
the differential encoder signal to reduce the effect of electrical noise.
Except for electrical interference, EMI can also cause electrical overstress
(EOS) to sensitive components [98].

A multi-stage AC/DC EMI filter SCHAFFNER FN-2090-10-06 ($78$) is used
according to the D1 drive’s user manual to reduce the ground current in the
electrical system and protect all other appliances that share the same ground,
such as the host and target computers and monitors. The HIWIN MF-40-S edge
filter ($81$) is used to eliminate the noise effect further. The edge filter
helps reduce the EMI noise on the output end of the motor drive. Two D1-EMC1
EMI cores ($87$) can also suppress the EMI noise. One EMI core is installed on
the linear motor’s power input cable near the motor drive end, while the other
is installed on the motor cable near the linear motor’s stage end. Besides
using the approaches mentioned above to reduce the EMI interference, another
easy way to reduce EMI interference is proper cable management. For example,
make the power cable of the linear motor stay far away from the sensor cable.

Table 2: This table shows the pin out of IO-191 module and its detailed
connection with HIWIN D1 drive’s control signal channel (CN2).

Pin | Functionality | Direction | Connects To | Pin | Functionality | Direction | Connects To
---|---|---|---|---|---|---|---
1a | Analog Input 01 | In |  | 1b | Digital I/O 01 | Out | HIWIN D1-CN2-3
2a | Analog Input 02 | In |  | 2b | Digital I/O 02 | Out | HIWIN D1-CN2-4
3a | Analog Input 03 | In |  | 3b | Digital I/O 03 | Out | HIWIN D1-CN2-5
4a | Analog Input 04 | In |  | 4b | Digital I/O 04 | Out | HIWIN D1-CN2-6
5a | Analog Input 05 | In |  | 5b | Digital I/O 05 | Out | HIWIN D1-CN2-7
6a | Analog Input 06 | In |  | 6b | Digital I/O 06 | Out | HIWIN D1-CN2-12
7a | Analog Input 07 | In |  | 7b | Digital I/O 07 | Out |
8a | Analog Input 08 | In |  | 8b | Digital I/O 08 | Out |
9a | Analog Output 01 | Out | HIWIN D1-CN2-24 | 9b | Digital I/O 09 | In | HIWIN D1-CN2-13
10a | Analog Output 02 | Out |  | 10b | Digital I/O 10 | In | HIWIN D1-CN2-14
11a | Analog Output 03 | Out |  | 11b | Digital I/O 11 | In | HIWIN D1-CN2-15
12a | Analog Output 04 | Out |  | 12b | Digital I/O 12 | In |
13a | Analog Ground | In | HIWIN D1-CN2-25 | 13b | Digital I/O 13 | In | NC
14a | Analog Ground | In |  | 14b | Digital I/O 14 | In |
15a | 0 V | NONE |  | 15b | Digital I/O 15 | In |
16a | 5 V | Out |  | 16b | Digital I/O 16 | In |
17a | Analog Ground | In |  | 17b | Digital Ground | In |  | HIWIN D1-CN2-1
---
HIWIN D1-CN2-2

Table 3: This table shows the pinout of the limit switch cable and its connection. The HIWIN D1 drive’s CN2 channel is used to provide DC current to the limit switch. The limit switch’s signal is then sent to the motor drive for the out of range protection. D-Sub 9-Pin (Female) | Color | Function | Connects To
---|---|---|---
1 | Brown | V+ | HIWIN D1-CN2-22
2 | Green | L-1 | NC
3 | Yellow | Out-1 | HIWIN D1-CN2-11
4 | Violet | L2 | NC
5 | Gray | Out-2 | HIWIN D1-CN2-10
9 | Blue | V- | HIWIN D1-CN2-23

A regenerative resistor is usually needed to avoid the regenerative energy of
the linear motor becoming too large and causing overvoltage to the motor
drive. The motion profile of the linear motor and the weight of moving mass
need to be known to pick a regenerative resistor. Then the designer can use
the calculation shown in the HIWIN D1 drive’s user manual (see Section 8.2 of
the user manual [99]) to guide the selection of the regenerative resistor. The
moving mass of the linear motor is around $5kg$, and the weight of the
pendulum arm and cart plate is around $0.5kg$ in our design, resulting in a
total moving mass of $M_{t}=5.5kg$. Then, assume the linear motor is moving at
$V_{1}=4m/s$ and needs to deaccelerate to $V_{2}=0m/s$ with $a=40m/s^{2}$.
Using the above information and following the calculation shown in the user
manual, we find there’s no need to use a regenerative resistor since the
energy return to the motor drive is smaller than the D1 drive amplifier’s
absorption capacity. However, we still decided to pick two 500W 30$\Omega$
regenerative resistors ($82$) and connect them in serial in case the returned
energy is larger than the energy storage capacity.

The proper operation of the linear drive requires the supply of $24V$ DC
voltage. Thus, the MDR-60-24 AC to DC industrial DIN rail power supply ($83$)
is used to output $24V$ DC at $2.5A$. A toggle switch ($85$) is used to
control the On/Off state of the DC power supply to the linear motor drive. The
Hammond CSKO242410 enclosure ($84$) is used to install electrical components.
A Hammond CSFC2424 flush cover ($88$) is cut down to be used as an electrical
panel that mounts some of the components mentioned above. Two DIN rails ($89$)
are installed inside the electrical enclosure to facilitate the installation
of different electrical components. This completes the selection process of
all the electrical components related to the linear motor. Fig. 24 shows their
wiring details.

As Fig. 24 shows, the emergency stop button is first connected to the single-
phase power supply. Two 14 AWG power cord ($90$) is used as the emergency stop
button’s power input/output cable. Next, the output of the emergency stop
button is connected with the circuit breaker, which serves as over-current
protection. Then, the noise filter is connected to the circuit breaker. The
connection wire used for the hot and neutral line is 12 AWG wire ($91$), while
the connection wire for the ground is 10 AWG wire ($92$). The output of the
noise filter connects to the magnetic contactor. The magnetic contactor is
wired to self-lock when the normally open momentary switch is pressed. The
output of the magnetic contactor is wired to the DIN rail terminal block
($93,94$) to facilitate cable management better. Then, the DC supply and line
reactor input is connected to the DIN rail terminal block. The output of the
DC supply is $24V$ DC, and it is used to provide power to the motor drive. A
toggle switch is used to make the supply of DC voltage controllable. Then, the
output of the DC supply is connected to the Wago 721-103/026-000 connector
($95$). The output of the line reactor is connected to the AC power port of
the motor drive using a single-phase connection formulation. The connector
used is Wago 721-204/026-000 ($96$). The U, V, W, and GND channel is connected
to the corresponding channel on the edge filter using a shielded cable to
reduce the EMI noise. The connector used on the motor drive is Wago
721-104/026-000 ($97$). The connector used in the edge filter’s input port is
Phoenix Contact 1718517 ($98$). The output of the edge filter then connects to
the linear motor’s power cable, which is a shielded cable as well. The output
connector of the edge filter is Phoenix Contact 1718504 ($99$). Two EMI cores
($87$) are installed to reduce the EMI noise further. One is near the motor
connection end on the motor drive and the other near the motor stage end of
the linear motor. Finally, two regenerative resistors are connected to the
regenerative resistor port of the motor drive in serial. The connector used
for the regenerative resistor port of the motor drive is Wago 723-603 ($100$).
The reader can choose to install two fuses as well for over-current
protection. This completes the power supply to the linear motor. A D1-DNT07A
USB232 to RJ11 adapter cable ($101$) is used to set up the motor drive
parameters. The linear motor’s feedback cable is connected to the CN3 of the
motor drive to let the motor drive read the encoder and hall sensor signal
from the linear motor. The encoder signal of the linear motor, along with
other I/O signals of the motor drive, is connected to the Speedgoat’s terminal
block. This is achieved by making a custom cable using hook-up wires. This
custom cable consists of 24 AWG hook up wires ($102$), cable shielding sleeve
($103$), cable sleeve ($104$), 3M 10126-3000 connector ($105$) and its cover
3M 10326-52F0-008 ($106$). Table. 1 and Table. 2 show the connections between
the CN2 of the motor drive and the Speedgoat real-time system. Section 3 of
the motor drive’s user manual contains the connection details of the motor
drive and its pinout of control signals (CN2). The interested reader should
reference the user manual if future system modifications are needed. The final
piece to mention is the limit switches we used in the linear motor for out-of-
range protection. A HIWIN 3-meter limit switch extension cable is used ($107$)
to connect the limit switch and motor drive. Table. 3 shows the pinout of the
limit switch cable and its corresponding connection to the motor drive. Zip
tie and wire clips are used to make proper cable management by securing the
position of all the cables/wires we used.

##  Appendix F Software Setup Details

###  F.1 Software Setup of Motor Drive Details

Figure 25: This figure illustrates the overall look of the Lighting software.

The HIWIN D1 drive’s corresponding setup software is Lightning, and the reader
can find a detailed introduction in sections 4 and 5 of the HIWIN D1 drive’s
user manual [99]. The version of the software we are using is V-0.1999, while
the latest version is V-0.20 at the time of writing this paper. First, we need
to download the Lightning software to the host computer to set it up. Next,
the CN1 port of the D1 drive is connected to the USB port of the host computer
using a communication cable ($101$). Once finished, the D1 drive is powered
up, and the Lightning software is executed. Then, in the software’s menu,
select "Tools->Communication setup," then configure the "BPS" drop-down list
to $115200$ and select the USB port that is used to connect the communication
cable in the drop-down list. Finally, hit the "Apply" button, and the host
computer and motor drive connection are complete. The above steps are needed
to set up the necessary parameters of the motor drive. Fig. 25 shows the
overall look of the Lighting software after connecting to the host computer.

Figure 26: This figure illustrates the configuration of the motor parameters.

To select the correct linear motor type, motor sensor, and operating mode, we