<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Posts on Ben Bokser&#39;s Blog</title>
    <link>https://bbokser.github.io/posts/</link>
    <description>Recent content in Posts on Ben Bokser&#39;s Blog</description>
    <generator>Hugo -- 0.152.2</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 04 May 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://bbokser.github.io/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A Less Forgiving Alarm Clock</title>
      <link>https://bbokser.github.io/posts/2025-05-04/</link>
      <pubDate>Sun, 04 May 2025 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2025-05-04/</guid>
      <description>&lt;p&gt;So I made my own alarm clock.&lt;/p&gt;
&lt;p&gt;It has no snooze button and no off button. It also has a backup battery in case it gets unplugged, and there&amp;rsquo;s no way to remove the battery without a hex key.&lt;/p&gt;
&lt;p&gt;Actually deactivating the alarm requires hitting a remote key fob. The idea is to hide the key fob as far away from your bed as possible. Obviously this is more effective the larger your home is.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Intro to Robot Simulation, Part 3: Friction</title>
      <link>https://bbokser.github.io/posts/2025-01-20/</link>
      <pubDate>Mon, 20 Jan 2025 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2025-01-20/</guid>
      <description>&lt;p&gt;In this post, we will add 1-dimensional coulomb friction to our simulation.&lt;/p&gt;
&lt;p&gt;First off, we&amp;rsquo;re going to need to allow movement in the horizontal direction.
Our new state-space system will be a 2-dimensional system subject to both horizontal and vertical forces.&lt;/p&gt;
 
$$
\begin{equation}
\underbrace{\begin{bmatrix} \dot{x} \\ \dot{z} \\ \ddot{x} \\ \ddot{z} \end{bmatrix}}_{\dot{X}} = 
\underbrace{\begin{bmatrix}
	0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 \\
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\
\end{bmatrix}}_A
\underbrace{\begin{bmatrix}
    x \\
    z \\
    \dot{x} \\ 
    \dot{z} 
\end{bmatrix}}_X 
&amp;#43; \underbrace{\begin{bmatrix} 
    0 &amp;amp; 0 \\
    0 &amp;amp; 0 \\ 
    \frac{1}{m} &amp;amp; 0 \\
    0 &amp;amp; \frac{1}{m}
\end{bmatrix}}_B 
\underbrace{\begin{bmatrix}
    f_x \\
    f_z
\end{bmatrix}}_F 
&amp;#43; \underbrace{\begin{bmatrix} 
    0 \\
    0 \\
    0 \\
    -9.81 
\end{bmatrix}}_G
\end{equation}
$$
&lt;h2 id=&#34;modeling-friction&#34;&gt;Modeling Friction&lt;/h2&gt;
&lt;p&gt;For 1-dimensional Coulomb friction, our friction force, $f_x$, is related to our vertical force $f_z$ by the following equation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Intro to Robot Simulation, Part 2: Contact</title>
      <link>https://bbokser.github.io/posts/2024-12-31/</link>
      <pubDate>Tue, 31 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2024-12-31/</guid>
      <description>&lt;p&gt;Okay, so we can simulate a floating point mass subject to arbitrary forces.
Let&amp;rsquo;s now think about what happens when our point mass hits the ground.&lt;/p&gt;
&lt;p&gt;Assuming 100% stiff, inelastic impact, we would get the following position, velocity, and acceleration trajectories:&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2024-12-31/impact.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;Notably, the acceleration at impact approaches infinity, which would be very difficult to simulate&amp;ndash;it would require infinitesimal timesteps.
Of course, in reality there is no such thing as a perfectly stiff and inelastic collision,
but in the field of robotics we are often concerned with relatively stiff collisions which cause decelerations on the order of microseconds.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reviving an MP3 Player from 2007</title>
      <link>https://bbokser.github.io/posts/2024-06-12/</link>
      <pubDate>Wed, 12 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2024-06-12/</guid>
      <description>&lt;p&gt;I love little semi-retro gadgets, maybe because I grew up playing a GameBoy? Anyway, a few months ago, &lt;a href=&#34;https://youtu.be/Qw-VvGsYpSU?feature=shared&#34;&gt;this video about Rockbox&lt;/a&gt; really sold me on getting a first-generation Sandisk Sansa Clip, and I ended up ordering an unopened one off Ebay.&lt;/p&gt;
&lt;p&gt;There was one problem, though. Turns out if you leave a LiPo pack on the shelf for ~15-17 years it stops working. And the Sansa Clip was never designed to be repairable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Intro to Robot Simulation, Part 1: Point Masses</title>
      <link>https://bbokser.github.io/posts/2024-02-18/</link>
      <pubDate>Sun, 18 Feb 2024 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2024-02-18/</guid>
      <description>&lt;p&gt;So, you want to write your own dynamic robot simulation from scratch.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start with one of the simplest possible dynamical systems: a vertically constrained point mass.
Think of it as a rocket locked to a linear rail.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2024-02-18/rocket.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;The rocket cannot rotate or translate laterally; it can only move up or down,
and can it only control this by either exerting an upward force or letting gravity take its course.&lt;/p&gt;</description>
    </item>
    <item>
      <title>On the Optimal Design of Cantilever Beams</title>
      <link>https://bbokser.github.io/posts/2023-04-17/</link>
      <pubDate>Mon, 17 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2023-04-17/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The Problem&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s say we need to design a structural section of a robot arm, as shown.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2023-04-17/arm-diagram.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ve been given a few requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mass of the component must be minimized at all costs.&lt;/li&gt;
&lt;li&gt;The length of the link must be 300 mm.&lt;/li&gt;
&lt;li&gt;The maximum allowed deflection (caused by the component) is 1 mm.&lt;/li&gt;
&lt;li&gt;The combined mass of the maximum payload and end-effector is 30 kg.&lt;/li&gt;
&lt;li&gt;The combined center of mass of the payload and end-effector is 50 mm from the joint.&lt;/li&gt;
&lt;li&gt;Both the base and end-effector joints can rotate in any axis.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We are allowed to assume that the arm does not move dynamically, so that our analysis can be static-only.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Parts Are In!</title>
      <link>https://bbokser.github.io/posts/2023-04-08/</link>
      <pubDate>Sat, 08 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2023-04-08/</guid>
      <description>&lt;p&gt;The new REx Hopper leg parts (which I hinted at in an earlier post) are finally in, and they look great.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2023-04-08/machined_1.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;I was worried they&amp;rsquo;d be expensive, but the total cost for all three components shown here (including shipping from China) was only $312.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2023-04-08/machined_2.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;As for the other components, they&amp;rsquo;ve been 3D-printed using &lt;a href=&#34;https://www.windform.com/top-line/windform-xt-2-0/&#34;&gt;Windform XT 2.0&lt;/a&gt;, which is supposed to have excellent mechanical properties.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2023-04-08/3dp.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;Anyway, I&amp;rsquo;ve started my new job in Boston, whereas work on the REx Hopper is supposed to continue in Pittsburgh. As such, I&amp;rsquo;ll be directing my design modifications from afar. The project is gradually being transferred into the hands of my former labmates at the REx Lab, who will be running control experiments on the robot.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deriving the Manipulator Equations from the Euler-Lagrange Equation</title>
      <link>https://bbokser.github.io/posts/2023-03-06/</link>
      <pubDate>Mon, 06 Mar 2023 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2023-03-06/</guid>
      <description>&lt;p&gt;The equations of motion for a robot manipulator and their relationship to the Euler-Lagrange equation are well known in the field of robotics, and yet I was unable to find a single source that provides the derivation. I suppose it&amp;rsquo;s one of those &amp;ldquo;the solution is trivial and is left as an exercise to the reader&amp;rdquo; situations. As such, I&amp;rsquo;m providing one here for dummies like me who need it spelled out step-by-step.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Lesson in Mechanical Resonance</title>
      <link>https://bbokser.github.io/posts/2023-02-17/</link>
      <pubDate>Fri, 17 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2023-02-17/</guid>
      <description>&lt;p&gt;The REx Hopper is now capable of balancing! However, it suffers from extreme oscillation at a relatively low frequency (about 8 Hz).&lt;/p&gt;
&lt;p&gt;&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
      &lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube.com/embed/9MAG_7aluU8?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;
    &lt;/div&gt;

&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://bbokser.github.io/images/2023-02-17/resonance_plot.png&#34;&gt;&lt;/p&gt;
&lt;p&gt;This looks like a controller issue&amp;ndash;perhaps even a simple matter of gain tuning&amp;ndash;until you look closer and slow the footage down. It&amp;rsquo;s a clear case of mechanical resonance&amp;ndash;notice how much the leg flexes back and forth.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Not Fail at Hardware Projects</title>
      <link>https://bbokser.github.io/posts/2023-01-24/</link>
      <pubDate>Tue, 24 Jan 2023 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2023-01-24/</guid>
      <description>&lt;p&gt;Over the years, I&amp;rsquo;ve witnessed countless failed projects (many of them my own) resulting from poor self-management. Here is how I recommend one approach hardware projects with the correct mentality.&lt;/p&gt;
&lt;h2 id=&#34;1--dont-be-optimistic&#34;&gt;1.  Don&amp;rsquo;t be Optimistic&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;“I wonder if that would be an issue… eh, it’ll probably be fine.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;“That could potentially fail, but it probably won’t.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;No, It will never be &amp;ldquo;fine&amp;rdquo;. If a thought like that ever passes through your mind you need to &lt;strong&gt;STOP RIGHT THERE&lt;/strong&gt; and correct whatever critical mistake you’re making. No joke. That is a &lt;strong&gt;GUARANTEED&lt;/strong&gt; mistake.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stable Bipedal Walking in Simulation</title>
      <link>https://bbokser.github.io/posts/2021-07-20/</link>
      <pubDate>Tue, 20 Jul 2021 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2021-07-20/</guid>
      <description>&lt;p&gt;In late 2019, I designed a custom QDD gearbox. Then I designed a bipedal robot with said gearing. By early 2020 I was spending about an hour per day after work coding a controller for the bipedal robot I had designed. In that time I learned a great deal of Python, and my controls proficiency skyrocketed. Then I started grad school and had to put this project on hold for about six months. But now, over a year and a half later, I&amp;rsquo;ve finally achieved stable bipedal walking in simulation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Model Predictive Control for a Legged Robot</title>
      <link>https://bbokser.github.io/posts/2020-10-12/</link>
      <pubDate>Mon, 12 Oct 2020 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2020-10-12/</guid>
      <description>&lt;p&gt;I have recently implemented a model predictive controller (MPC) to calculate the necessary reaction forces for a legged robot. The work presented here is based on &lt;a href=&#34;https://arxiv.org/pdf/1909.06586.pdf&#34;&gt;this&lt;/a&gt; paper by Kim et al. If you don&amp;rsquo;t know what model predictive control is, I recommend &lt;a href=&#34;https://youtu.be/YwodGM2eoy4&#34;&gt;this&lt;/a&gt; excellent explanation by Steve Brunton. I also found &lt;a href=&#34;https://youtu.be/RrnkPrcpyEA&#34;&gt;this&lt;/a&gt; guide to model predictive control with CasADI to be extremely helpful. CasADi is an open source nonlinear optimization tool which I&amp;rsquo;m using for MPC.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solving for the Jacobians of a Robot Leg</title>
      <link>https://bbokser.github.io/posts/2020-05-04/</link>
      <pubDate>Mon, 04 May 2020 00:00:00 +0000</pubDate>
      <guid>https://bbokser.github.io/posts/2020-05-04/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m currently working on the Python &lt;a href=&#34;https://github.com/bbokser/spryped&#34;&gt;code&lt;/a&gt; to control a simulated version of my latest bipedal robot design in PyBullet. My focus over the past few weeks was getting the operational space control to work (many thanks to Travis DeWolf&amp;rsquo;s incredibly helpful &lt;a href=&#34;https://studywolf.wordpress.com/site-index/&#34;&gt;blog&lt;/a&gt;). After finally getting it to work properly, I have decided to share my math in the hopes of providing a useful example for anyone else having trouble with this. There really aren&amp;rsquo;t enough resources on the internet that explain this in a succinct manner.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
