Friday, May 5, 2023

Dimensioning a capstan gear for a Peg Solitaire-playing delta-robot

This is a somewhat different blog post from what you usually see on World of Card Games. It's part of a hobby project I've been working on for a while. I'm very interested in card games and programming, which is why I created the solitaire site Online Solitaire and now run World of Card Games. Besides programming and card games, I'm very interested in robotics, so I thought, why not try to create a robot and get it to play Peg Solitaire? 

It proved to be somewhat of a challenge for a novice like me, but in the end, I managed to design, create, and program a delta-robot from scratch. So without further ado, let me introduce Peggy, the Peg-solitaire playing delta-robot: 


A lot of creativity, calculations, dimensioning, prototyping and programming has gone into creating this robot. This blog post is part of a series of blog posts where we'll dive into different aspects of the robot. I've previously gone through how to do the kinematic calculations for a delta-robot, and in this post, we'll go through how to do the dimensioning, along with the calculations, for the capstan gear that is used in the robot.


When to use a capstan gear

There are many different types of gears, each with their own advantages and disadvantages. A well-known gear within the world of robotics is the pulley and belt system. This type of system works very well and is used in many different types of robotic design. The drawback of this type of system is that it usually has a certain amount of backlash. In a delta robot, where speed and precision are important factors, it is important that there is as little backlash as possible. That's why I decided to use a capstan gear. This type of gear is currently not very popular in the world of robotics but is finding its way into various projects like this robot dog.

As seen in image 1 below, the capstan gear works by having a motor move the capstan, which in turn moves the wheel it's connected to via a wire. The ratio between the capstan and the wheel determines the gear ratio.

Figure 1: An example of a capstan gearing


Dimensioning the capstan gear

In image 2 below, an illustration of a capstan gear with its associated dimensions is shown. The upper part is the capstan, in which the input shaft is mounted, the lower part is called the wheel, in which the output shaft is mounted, and both are connected by a wire that transfers the rotational forces from one wheel to the other. 

To make the gear work correctly, the capstan and the wheel have to be dimensioned correctly. The calculations for the capstan gear used in this project have been deduced from a lecture from Stanford University and a graduation project from DTU (Technological University of Denmark). Below we'll go through these calculations to give you an idea of what's required if you want to create a capstan gear for your own project.

Figure 2: Illustration of the capstan gearing seen from the front and the side.

We have the following definitions:

  • \(\lambda =\) Angle of the wire. Also called the helix angle.
  • \(S =\) Pitch of the wire.
  • \(D_{C} =\) Diameter of the capstan.
  • \(D_{O} =\) Diameter of the wheel.
  • \(L_{G} =\) Distance between capstan and wheel.
  • \(S_{O} =\) Pitch of the steel wire on the output shaft.
  • \(D_{W} =\) Diameter of the wire.

Doing these calculations, we're really looking to deduce three main numbers: how thick the wire should be to withstand the motor's torque, how many times it should be wound around the capstan so that there is enough friction to prevent slippage, and how large the pitch of the wire should be to prevent too much pressure on the capstan or wheel when the wire travels. Based on these numbers, the minimum width of the capstan and wheel is found.

An important factor in these calculations is the helix angle, \(\lambda\), as it must be kept constant across the capstan and wheel to prevent stresses in the gear. Thus, the following relationship is given:

\begin{align}\dfrac{S_{O}}{S} &= \dfrac{D_{O} + D_{W}}{D_{C} + D_{W}}\end{align}


Distance between capstan and wheel

The distance \(L_{G}\) should be as small as possible to avoid unnecessary tensile forces on the capstan and wheel. In an ideal world, the distance would be no greater than the wire diameter, i.e., \(L_{G}=D_{W}\), but to ensure that the wire doesn't get squeezed between the capstan and the wheel, the distance is set to \(L_{G}=1.5 \cdot D_{W}\). This would result in very few tensile forces in the vertical plane on the capstan and wheel.


Diameter of the wire, the capstan, and the wheel

The wire's main job is to transfer the torque from the capstan to the wheel. This is done exclusively using a tensile force. The torque can be found using the definition for torque:
\begin{align}torque &= force \cdot arm \\M &= F_{W} \cdot \left(\dfrac {D_{C}}{2} + \dfrac {D_{W}}{2}\right)\end{align}

Where \(M\) is the torque from the motor and \(F_{W}\) is the tensile force. By re-structuring the definitions, the tensile force can be determined as:
\begin{align}F_{W} &= \dfrac {M}{\dfrac {D_{C}}{2} + \dfrac {D_{W}}{2}}\end{align}

Now that the tensile force is known, a safety factor can be found by dividing the force by the breaking force of the selected wire:
\begin{align}SF &= \dfrac {F_{break}}{F_{W}}\end{align}

Before the tensile force can be found, the diameter of the capstan and wheel must first be determined. There are some practical considerations to take into account when dimensioning the gear. A capstan gear physically takes up a relatively large amount of space. The larger the gearing, the larger the robot will have to be. I've decided to have a gear ratio of 1:8, as this seems large enough to achieve the desired precision while the robot can maintain the desired speed.

The second thing you should consider is that the capstan's diameter contributes to how much tension is in the steel wire. For a standard 7x7 wire, it is recommended that the capstan's diameter should be at least 16 times larger than the diameter of the wire. With a gearing of 1:8, the wheel should be 8 times larger than the capstan.

We'll try with a 1mm wire to see what safety factor we'll get:
\begin{align}D_{W} &= 1mm \\D_{C} &= 20mm \\D_{O} &= 160mm \\M &= 1.5Nm \\F_{W} &= \dfrac {M}{\dfrac {D_{C}}{2} + \dfrac {D_{W}}{2}} = 143N \\F_{break} &= 57 \cdot 9.81N = 560N \\SF &= \dfrac {F_{break}}{F_{W}} = 3.9\end{align}

Using the above dimensions, the wire will have a safety factor of almost 4, which is fully acceptable for a robot like this.


Number of wraps around the capstan

For the torque to be transferred from the capstan to the wheel, the wire should be wrapped around the capstan enough times so that it does not slip. The number of times needed is found using the capstan formula which is:
\begin{align}F_{W} &= F_{hold} \cdot e^{\mu_{static} \cdot \phi}\end{align}

Where we have the following definitions:
  • \(F_{hold} =\) The force in Newton required for the wire to be tight enough not to slip.
  • \(\mu_{static} =\) The static friction coefficient between the wire and the capstan.
  • \(\phi =\) Number of wraps around the capstan in radians.

Since the holding force is the interesting variable here, we're going to isolate it:
\begin{align}F_{hold} &= \dfrac {F_{W}}{e^{\mu_{static} \cdot \phi}} \end{align}

The wire force is found to be \(F_{W} = 143N\), and the static friction coefficient is estimated to be \(\mu_{static} = 0.2\)\cite{frictionCoefficient}. The holding force is now found for different number of wraps:
\begin{align}F_{hold} &= \dfrac {F_{W}}{e^{\mu_{static} \cdot 4\pi rad}} = 11.8N \\F_{hold} &= \dfrac {F_{W}}{e^{\mu_{static} \cdot 6\pi rad}} = 3.3N \\F_{hold} &= \dfrac {F_{W}}{e^{\mu_{static} \cdot 8\pi rad}} = 0.9N\end{align}

It's clear that there is a significant difference in how big the holding force should be in relation to the number of wraps around the capstan. To have as large a safety factor as possible regarding whether the wire slips, the last calculation is chosen, i.e., the wire is wrapped around the capstan four times.


The width of the capstan and the wheel

The only thing left to determine is the capstan and wheel width. The previous calculations form the basis for this width. As shown in image 3 below, we're looking to find \(B_{min}\), which is the minimum width for the wheel. It should be noted that, in practice, a little extra width should be added.
Figure 3: Width of the capstan gearing.



The minimum width is a function of the minimum distance for the wire on the capstan, \(B_{C}\), and the width of the wire that wraps around the wheel, \(B_{O}\). The minimum width for the capstan can thus be found by:
\begin{align}B_{C} &= N \cdot S\end{align}

The width \(B_{O}\) depends on the anchor point placement on the wheel (the x's in image 3), \(\beta\), which depends on the desired rotation of the wire on the wheel, \(\alpha\):
\begin{align}B_{O} &= \dfrac{S_{O}}{2\pi} \cdot \left(\dfrac{\alpha}{2} + \beta\right)\end{align}

The distance \(L_{G}\), i.e., the distance between the capstan and the wheel, has been determined to be so small that it can be ignored in this calculation. The minimum width for the gearing can thus be found to be
\begin{align}B_{min} &= B_{C} + 2 \cdot B_{O}\end{align}

If we set the distance between the wires to be \(S = 2mm\), and the number of wraps to be \(N = 4\), \(\alpha = 1.2\pi\), and \(\beta = 0.1\pi\), we get:
\begin{align}B_{C} &= N \cdot S = 8mm \\S_{O} &= \dfrac{D_{O} + D_{W}}{D_{C} + D_{W}} \cdot S = 15.3mm \\B_{O} &= \dfrac{S_{O}}{2\pi} \cdot \left(\dfrac{\alpha}{2} + \beta\right) = 5.4mm \\B_{min} &= B_{C} + 2 \cdot B_{O} = 18.8mm\end{align}

The minimum distance for the wheel can therefore be determined to be 18.8mm. In practice, it will be wider, but now we know that this is the minimum distance.


The prototype

Dimensioning something is not much fun if you don't get to create a prototype of it, which is exactly what I've done! 🙂

There are many different ways to design a capstan gear and even more production techniques one can use to create it. I've chosen 3D-printing and laser-cutting as my production techniques. In image 4 below, the prototype of the capstan gear is shown. It has been produced in clear plastic so that all details can be seen. The upper arm is held in place by a shaft that is connected to 2 608RS ball bearings, ensuring as little friction as possible. A spacer has been placed in the middle of where the upper arm sits. This has created more stability between the suspension and the upper arm.
Figure 4: The prototype of the capstan gear.


In image 5, the capstan gear and upper arm are shown. This shaft is clamped to the motor through a flexible coupling. This couple has been chosen because we cannot guarantee that the shaft and motor shaft are perfectly aligned. In addition, the shaft extends through to the encoder on the left, which it, in turn, is connected to.
Image 5: Capstan and wheel.

That's all for now. I expect to write up a few more posts in the future with some of the interesting aspects of the robot. Let me know in the comments if you have any questions.

Monday, April 3, 2023

A New Chapter Begins

Hello, World of Card Games community!

I have some exciting news to share with all of you loyal players and supporters! After many years of dedication and hard work, I've decided to pass the torch on to someone who can bring much needed fresh energy to the site.

I'm pleased to introduce Holger, a designer and developer who's also a big fan of card games. Holger runs the solitaire site OnlineSolitaire.com, so he already has some experience with card games. I feel fortunate that I made his acquaintance; I think he is the perfect fit to run the site.

I am confident that Holger will carry on the legacy of World of Card Games with the same dedication and commitment that I have poured into it. I hope you will all give Holger a warm welcome and continue to be a part of this amazing community.

I want to express my heartfelt gratitude to each and every one of you for your support over the years. World of Card Games has been a labor of love, and it has been a pleasure to see it grow and bring joy to so many card game enthusiasts.
 
Thank you all for making this journey so special. I will miss you... but be assured that I will still be playing cards at the site from time to time :) So perhaps we'll meet again.

I'll be helping Holger with the transition, so you'll still be able to reach me at marya@worldofcardgames.com for a while yet.

Marya


Thank you very much for the introduction, Marya. I am very grateful to have been entrusted with the responsibility of running World of Card Games. I have long admired the site and am excited to work on expanding the repertoire of games and improving the overall gaming experience. My primary goal is to continue to run the site, as Marya has done so successfully. So rest assured, no significant changes will be made to the current games you all know and love.

That said, I am eager to explore the creation of new games and features for the site, making World of Card Games an even more enjoyable destination for people to play card games online. If you have any feedback or suggestions for the site, I'd love to hear from you at holger@worldofcardgames.com.

Stay tuned for updates and new developments, and as always, happy gaming!

Holger



Sunday, February 26, 2023

comments, I get comments

I know that World of Card Games is far from perfect. It has a few bugs (few and rare I believe!). But people notice the bad things and complain about them - those are most of the emails that I get. Despite that, I see plenty of people playing at the site every day, so I think many people play with no problems. I only rarely have problems with the site, and usually it's clear why: I'm in a location with bad wifi.

In any case, it's a rare person who takes the trouble to write a note of praise. However, I have indeed gotten many nice compliments about World of Card Games over the years. Those are the days when it's a joy to run the site!

Here's a recent one:

"Thanks for a great website.  Very well done".

You may be surprised but just a few words like that make such a difference! I've decided to write this blog post and keep it updated with positive comments that I've received, as a reminder that some people enjoy the site, maybe more than I even realize.

Here's another one that I got at the end of January:

It’s a popular site.  I would think you could monetize it more to bring in more revenue and higher a staff. Maybe the next Words with Friends.   You could sell out to a large corporation and buy a house on the French Riviera
This comment had me laughing out loud. The site doesn't make nearly enough money to sell out to a large corporation, but it's nice to hear that someone thinks it's that popular.

These are just a couple of recent examples. I'll keep updating this post when/if I get more

Updated Feb 28: A player at the site wrote me the following lovely comment. Reprinted with permission:

It is a great site and I am sure a little tweaking would improve it, but why change something that is working. You have always answered any questions i have submitted to you. Keep up the great work -- golfer79

Thank you, golfer79!

Updated Mar 23: Another player (Andrew) wrote me a wonderful comment:

Add me to the Great Job chorus.  I'm Team Marya!!

Thanks! It is so nice to hear that.

Saturday, September 17, 2022

How to Change Your Appearance

NOTICE: This post was originally posted on Medium, but has later been moved to the official World Of Card Games blog to consolidate all posts.

Most game sites will let you change the way you look, and it’s the same at World of Card Games. Even so, not everyone realizes it. Today’s post is a short one that explains how to do that.

Just click the “Avatar” link in the upper left corner of the screen. This causes a panel to open that’s filled with all the possible images you can use for your profile picture while playing a game. You can scroll down using the scrollbar at the right hand side of the panel, and when you see the one you want to use, click it. You’ll see a green check mark briefly appear, and the panel will close.

Now you’re all set. You’ll see your new avatar the next time you play a game. And you can change your avatar to something new anytime you want – all free of charge. Enjoy!

You can choose from a wide variety of images for your profile pic!

Saturday, September 10, 2022

Best Spades card game hand ever?

NOTICE: This post was originally posted on Medium, but has later been moved to the official World Of Card Games blog to consolidate all posts.

A player at the site recently sent me a Spades hand history. She’s been playing at the site for many years, and thinks this is the best hand she’s ever seen. Here’s a screenshot taken of the replayer that she downloaded after the hand was finished.

There are at least 6 sure winners in South’s hand, and probably more

She has 7 spades cards, and the 6 highest spades (9 through ace). And she has the ace and king of clubs. What do you think? What would you have bid? I think I would have bid 9, but it would depend on the other players’ bids. Notice that she was also extra lucky in being last to bid, so she’d be able to adjust her bid based on what everyone else already bid.

If you want to see what the bids were, and what happened during the hand, click this link to view the full replay. It is well worth taking a look if you enjoy playing Spades. Just keep clicking the “next” button to see each step during the hand — which was really an eye-opener!

This was a pretty amazing hand! I do think it’s the best hand anyone has ever sent me. But it’s not the best one that’s possible. The very best hand would consist of an entire handful of spades — from 2 to ace. And that’s a valid hand, too — literally just as valid as any other hand. I’d love to see that, one day, myself! I wonder which is more rare: a hand completely full of spades, or picking all the right lottery numbers for the Mega Millions? I’m not going to try to work out the odds… 😃

You have to pay for a lottery ticket, but trying your luck in a game of Spades is entirely free online at World of Card Games. Enjoy!

Saturday, September 3, 2022

Was this Spades bid too high?

A modest bid of 2 still got set!

NOTICE: This post was originally posted on Medium, but has later been moved to the official World Of Card Games blog to consolidate all posts.

Someone sent me a Spades hand history from World of Card Games to ask what I thought: Was their bid too high? The player is “West” in the screenshot above. They were first to bid, so they had no information about anyone else’s bids.

When I’m first to bid, I’ll usually err on the side of caution. So let’s see what we have here. The player bid 2. Do I agree?

At first glance, I’d say it was entirely reasonable. As you can see from the screenshot above, they’ve got the king of spades and one extra trump card. That king of spades is very likely to take a trick, but there’s a small possibility that it might be trumped by the ace, with some bad luck.

Clearly, the player was also counting on their king of clubs taking a trick. I also think this is reasonable. They’ve got three clubs. It’s always possible that someone else is long in clubs, and that might result in their king of clubs getting trumped. But on average, I think it’s usually safe to count that king as taking a trick, with only three of the suit in my hand.

However, this turned out to be one of those cases where the odds were not in favor of West. Late in the hand, when West tried to take a trick by trumping over their right-hand opponent using their king of spades, the left-hand opponent took the opportunity to trump that card with the ace of spades! This was the worst-case scenario that they didn’t really anticipate. If they had held the king and just discarded a hearts card, they might have saved their bid.

Overall, I still think the bid was good, and this team just had a bit of bad luck. What do you think? You can view the hand history here or take a look at the replayer of this Spades hand at YouTube.

Saturday, August 20, 2022

Play Pokémon Go to Improve Your Health

A Zigzagoon from Pokémon Go seen in augmented reality!

NOTICE: This post was originally posted on Medium, but has later been moved to the official World Of Card Games blog to consolidate all posts.

Recently, I’ve started playing Pokémon Go. Okay, I admit it. I’m hopelessly behind — this game has been out since 2016, for 6 years! I’ve always been curious about it, but never had the time to look into it. I used to play video games as a kid. But as I got older, life got complicated, and I became more of a workaholic. By now, I almost never play games anymore, unless I need to for work!

However, Pokémon Go really piqued my curiosity. The stories I’d heard about it reminded me of a scavenger hunt, and that appealed to me. Off and on, I’d hear about this game, and think it sounded like fun. So finally, I caved in and downloaded the app. It’s available for Android and iOS. And it’s free of charge, although you are encouraged to make “in-app purchases”, something that I’ve found easy to avoid so far.

When I started to play, I had no idea what I was doing. I decided to jump right in and not do any research. Research would take the fun out of it! I’m sure there are people who would read all about the rules and look for “cheat codes” and strategies to get ahead as quickly as possible. That was not me. Well, for one, I just don’t have the time 😄. And for another, I think that would spoil the game for me. I wanted to discover the rules and figure out how to get ahead without any outside help.

I just started by downloading the app and creating an account. It was so easy that I felt silly about how long it had taken me to get around to it. You choose a name, an outfit (yes, sunglasses and all), and you’re ready to go.

It was not so clear what I was supposed to do when I started. I soon discovered some Pokémon monsters, and I finally figured out that I was supposed to capture them by throwing “Poké Balls” at them. You do this by swiping your finger up your phone screen in the general direction of the creature. I was pretty bad at it, since my ball tosses tended to swerve to the right. I still don’t do this very well, and I wonder if I’ll get any better, or if there are any tricks to it. I’ve improved a bit, and I can usually capture the monsters that I find. Perhaps 30% of the monsters that I capture manage to escape, unfortunately. True to my nature, I’ve restrained myself from looking for advice about how to improve my odds. Usually, if a monster escapes, I can keep trying, and eventually I’ll get it (using valuable resources along the way, of course). A few of them take a powder before I can capture them for good.

I captured a few Pokémon just sitting at home, but they turned out to be pretty scarce in my vicinity, and the game got boring. I was quite interested in trying the game outdoors, since I’d heard some fuss about how Pokémon Go used some kind of “augmented reality” to interact with the monsters outside.

Eventually, I had the chance to take the app on a walk. This turned out to be entertaining. The app has a built in real-life map of your area. While you walk around, you can see your character walking along a map of your real-life location. Here and there on the map, you see “points of interest”. I didn’t understand how to use these at first. I’d click on one, and see a monster and a photo of the place. For example, the place might be a library building or town hall. I still don’t know how these places were first input into the app, but I’m guessing these were contributed by players. Speaking as a game developer, having to filter out all the user contributions sounds like a real headache. Many of them must have come from trolls or worse. Oy! But I digress.

Eventually, the app itself gave me a tip that I could “spin” the photo of the point of interest and that would generate some little bubbles that I could tap to collect extra valuable potions and so on. Why do you need potions? To heal your critters when they get hurt in fights!

After playing for a while, I was accosted by a kind of bully who challenged me to a fight. He arrived in a hot air balloon, no less! I could have run away, but decided to give it a try, and accepted the challenge.

It turns out that you don’t do any fighting yourself. Instead, the Pokémon you’ve captured fight for you. In each fight, you can pick three Pokémon to represent you. The bully is represented by three Pokémon of his or her own.

I think I’m fighting correctly, but I’m not really sure. Fighting involves swiping or tapping across the screen really fast, like you’re shooting at the opposing Pokémon. The system chooses an ideal Pokémon group for me, and I just kind of hope that I’m using them the correct way. Sometimes I can choose to apply a shield against an attack, and that often works. Sometimes I see a message that tells me my attack is not very effective, but I don’t know how to solve that problem. It seems some types of Pokémon are more effective at attacking other types. I don’t understand those nuances, yet. Sometimes I win the fight, but I’ve probably lost about 50% of them so far.

Honestly, the battles are not overly exciting. And I’m not sure that I’ll become interested enough in this game to dig into the details of how to improve my chances in these battles. I’m going to keep at it for a while because there’s one thing that I really like about the game. It encourages exercise. You get credit for walking while you play the game.

I can see why this is a problem. After all, we don’t want people strolling down the street with their noses glued to their mobile phone screens. That is a recipe for disaster. The way I deal with this is to take the phone along on a walk, and if I see the opportunity for a battle, I’ll just stop, step to a safe spot to one side of the sidewalk, and play. So far, so good. I do like that the app encourages people to get up and move. It just needs to be used sensibly in order to avoid accidents.

In this respect, Pokémon Go is so different from World of Card Games, where the only opportunity for exercise is between games, or perhaps if you use one of those treadmill desks. Card games have been around for much longer than the Internet, and you don’t need an app to play them, so that’s very different as well. All you need is a deck of cards (if playing Solitaire) and maybe some friends if playing a game like Spades or Hearts. I can see the appeal of Pokémon Go as an alternate type of entertainment. It gets you out of your chair and outside. And there’s a huge world of game items and rules to discover.

In contrast, the rules of card games are generally simpler. Once you figure them out, it’s up to you to try to apply different strategies within the constraints of the rules to try to win the game. I feel like a big part of the fun of Pokémon Go will be puzzling out how things work, and I wonder if I won’t get bored once I do. On the other hand, once I figured out the rules of card games like Euchre, Double Deck Pinochle, and Spades, I never got bored of them. I don’t play very often, but I still find it entertaining and relaxing to play once in a while. Perhaps Pokémon Go will turn out that way, too. Time will tell!