Monthly Archives: February 2018

Workshop finishing update

I’ve done a fair bit of work to update the workshop, but have been terrible at taking pictures. So, here’s the current state:

IMG_9073

IMG_9074

There’s a pretty new window in the bottom picture to bring some natural light into the space. The walls are all insulated with Roxul rock wool, which was a significant pain in the ass because the long wall has studs 12” on center and it doesn’t come in those widths, so I had to take 23” batts and split them. Ick. There are three new boxes for outlets, but the circuits aren’t hooked up yet. The wall is 1/2” CDX plywood, chosen because I want to have a wall I can hang things on.

IMG_9075

Here is a pretty picture with the wall painted white to make the whole room lighter.

Up next will be doing the electrical, moving the cabinets back, and working on the rest of the room.



WPC driver board issues

My WCS 1994 is having some issues; the DMD display is showing static and now the game is behaving strangely.

I’ve been using the guide here, but I’d like to share some other data I’ve gathered since I didn’t find it elsewhere.


Test point Working DC Working AC Problem DC Problem AC Description
TP1 14.7 0.63 13.5 0.08 +12V filtered but not regulated
TP2 4.93 0.01 4.97 0.001 +5V regulated Digital supply
TP3 11.92 0.008 0.758 0.122 +12V regulated digital supply
TP4 0.37 0.63 3.62 0.06 +50V filtered
TP5 0.03 Board ground
TP6 73.2 0.2 – 0.8 75.1 0.01 +50V for solenoids, flippers
TP7 21.7 0.09 21.6 0.04 +20v flash lamps
TP8 15-17 0.2 (ish) 11-14 0.8 (ish) +18 to lamp columns

“Working” values come from my Twilight Zone (working), while “Problem” ones come from my WCS (not working).

What can we tell from this?

Well, a few things. The obvious issue is TP3; it is less than 1 volt when it should be around 12 volts, and it’s letting a lot of AC through at all.

Time to pull out the schematics.

image

Sorry, that was the best image I could pull from a PDF; the paper version isn’t much better.

Basically, we have power coming in from the left side, which should be a nice healthy 18volts (measured at TP8). It goes through two series diodes that will drop the input by a little over a volt, and then it goes to an absolutely-standard 78xx linear regulator circuit; a capacitor on the input, a 7812 (for 12volts) and a capacitor at the output. 78xx regulators are pretty robust, so let’s see if we’re using it correctly…

Like most linear regulators, the 78xx series has some limitations around input voltage; it requires about 2 volts of headroom to be able to give us the output voltage, so we should be looking for 14 volts coming in. We have 11-14 volts – it fluctuates because the lights are flashing in attract mode. That 11-14 volts isn’t enough to consistently give us enough voltage for the 7812 to give us a nice 12 volts.

So, we don’t have enough power coming in, so that is the problem, right? Well, not so fast. Based on what I know about the 78xx regulators, one would expect that if the voltage drops enough so that you don’t have a full 2 volts, you will see the output voltage slowly drop down.

I pulled out a 7809 and hooked it up to my variable power supply, and found that this was mostly true; the dropout voltage was about 1.2 volts (two diode drops). That means I would expect that the 7812 would put out less voltage but something close to 12V.

So, that suggests that we have two issues going on; we don’t have enough voltage coming in for the regulator to work and the regulator looks fried. That is supported by some data I had before this where the game was acting very weird and the voltage at TP3 was fluctuating all over the place. So, a new 7812, and it would be a good idea to replace the 1n4004 diodes and the electrolytic capacitors in this section at the same time, since this board is nearly 25 years old.

Looking at the input voltages at T8, note that there is a decent AC component in the DC voltage – about 0.8 volts. Back to the schematics:

image

This is also really simple; we have AC from the transformer coming in, going through a full-wave rectifier, and then there are two honking big 15,000 uF electrolytic capacitors. As these capacitors age, they are going to lose some capacity and have an increased internal resistance; both of those make them worse at filtering, so it’s time to replace those as well. It’s possible that the AC that they are putting out ended up hastening the end of the 7812.

It’s typical to replace both the capacitors and the bridges when the board is reworked, just to make sure, so I will probably do that.

I am a little concerned by some of the values I see on my TZ board; there are some indications that the caps there need replacement as well. I’ll do the WCS and then compare it to the TZ one.



The biochemistry of weight and nutrition–Part #1: Carbohydrates

Back in May of 2017, I started a journey to learn more about how the biochemistry of weight works; how our bodies metabolism carbohydrates, protein, and fats, and how that influences our weight.

When I started, I had a pretty simplistic view of how our bodies work.  I’m still only starting to have a functional understanding of the underlying biochemistry, but what I’ve found is that our bodies are very complex and fascinating systems shaped by the environment in which we evolved, and that if you understand the underlying biochemistry, things make more sense.

So… This is my attempt to present a simplified view of the underlying biochemistry. If you want to learn more, I recommend starting with a copy of “Mark’s Basic Medical Biochemistry”, but I’ll caution you that the section on carbohydrate metabolism alone is around 84 pages, so it’s pretty dense. If you want a slightly lighter approach, you can try “Mark’s Essentials of Medical Biochemistry”, which is a bit shorter. In either case, read them and then find some YouTube videos that talk about the subject, and iterate on this process a few times.

A few basic principles:

Our bodies are adaptive systems

If you’ve ever trained for an athletic event, you know that when you start training it’s really hard, but it gets easier over time as your body adapts, by making physical changes to your body. Our bodies also have an adaptive response to the kinds of foods that we eat, and that response can take time.

Our bodies try to be energy efficient

We evolved in an environment where food was not always plentiful, and our bodies generally attempt to be efficient and not waste any food calories.

Reactions to diets vary significantly between individuals

Genetics, age, sex, medical history, and activity level are all significant when considering how a specific person reacts to a specific diet. Or, to put it another way, one person may be able to remain healthy on a diet that would make somebody else very sick.


Carbs

I’m starting with carbs because their role is central to how your body reacts to the food that you eat. I’m going to talk about the different kinds of carbohydrates, how they are digested/absorbed, and how they are metabolized (used) by our bodies.

The nomenclature around carbs is a bit confusing, but they break into four broad classes:

Simple Sugars (aka “monosaccharides”)

The simple sugars are the ones that aren’t broken down by our digestive systems to something simpler. Most people are familiar with fructose and glucose, and there is also galactose, which I’ll discuss more in a bit. There are also some rarer sugars and sugar alcohols that I’m ignoring for now.

Compound Sugars (aka “Disaccharides”)

“Di” meaning “two”, these are sugars that are compounds of two simple sugars.

  • Sucrose (aka “table sugar”) is a compound of one molecule of glucose and one molecule of fructose
  • Lactose (aka “milk sugar”) is a compound of one molecule of glucose and one molecule of galactose
  • Maltose (aka “malt sugar”) is a compound of two molecules of glucose.
  • The much maligned High Fructose Corn Syrup is not a compound sugar, but a mixture of simple sugars. It comes in different fructose/glucose ratios, with the most common one being 55% fructose, so it’s similar to sucrose in its underlying composition and effect on the body.

    Complex carbohydrates (aka “Oligosaccharides” and “Polysaccharides”)

    All of the complex carbohydrates are chains of simple sugars hooked together (“oligo” means “a few”, and “poly” means “a lot”).

    In this class we have ingredients like maltodextrin (a small chain of glucose molecules), or starches (big chains of glucose molecules).

    Cooked starches are easily broken down into their simple sugars by our digestion. Some raw starches – also known as “resistant starches” – are poorly digested in the small intestine, and digested by bacteria in the large intestine and converted to short-chain fatty acids, which are absorbed. I would call them “starches that don’t act like more familiar starches”.

    Undigestible carbohydrates (aka “fiber”)

    Humans don’t have the digestive equipment to extract energy from carbohydrates like cellulose, so they just pass through our systems.

    Carbohydrate absorption

    With the exception of resistant starches and fiber, all of the carbohydrates are broken down to glucose, fructose, or galactose by the digestive system before they enter the bloodstream. The rate at which they enter the bloodstream depends upon a number of factors. A refined sugar is more accessible than one that is bound up within fiber in a food, so it is absorbed faster. A sugar that is by itself is more accessible than one that is mixed in with fat and protein. Different sugars have different transport mechanisms to get them from the digestive system into the blood stream and therefore have different rates of absorption.

    But at the bottom, it’s glucose, fructose, or galactose. The sugars that you get from eating an apple aren’t chemically any different from those you get from a can of Coke. The two foods – if you can call a can of coke “food” – differ in the total amount of carbs, the ratios of different types of carbs, the rate at which the carbs are absorbed, and the non-sugar ingredients, but they both end up as simple sugars in your system.

    Complex carbohydrates also aren’t inherently different than simple sugars; they may not taste sweet, but they end up as simple sugars (typically glucose) when they are absorbed.

    Carbohydrate Metabolism

    Metabolism is all about what happens to the nutrient after it gets into our bloodstream. It turns out that the different simple sugars are processed very differently.

    I’m going to start with glucose metabolism.

    Glucose metabolism

    The amount of glucose in our blood – our blood glucose (or blood sugar) level – is one of the most important values for us as living organisms. Too little (aka “hypoglycemia”), and we get hungry, headachy, sleepy, confused, or worse. Too much (aka “hyperglycemia”), and we have other issues; a lot of our body’s systems do not work well with too little or too much blood glucose.

    Our bodies therefore have a system to keep blood sugar constant, and this is a high priority system; it is fair to say that “keep blood glucose within range” is Job One for our regulatory systems.

    Let’s say we ate a small plain bagel or drank a can of Coke. That’s going to send somewhere around 30 grams of glucose into our system. That is over 7 times the amount of glucose we normally have in our bloodstream, so we need a place to put the excess glucose, and biochemical system to pull the glucose out of the blood and put it in that storage place.

    Storing Glucose

    There are two different methods of storing glucose in our bodies.

    We can store it in our liver or our muscles as glycogen, a compound that is very close to glucose chemically. Glycogen is a little like a starch; it’s just a bunch of glucose molecules surrounding a protein known as glycogenin, and it’s quick and easy to get the glucose back out. The storage for glycogen is fairly limited; the muscles can store about 400 grams, and the liver can store about 100 grams, or 500 grams / 2000 calories total. If you have ever “hit the wall” or “bonked” during extended exercise, you’ve experienced what happens when you run out of liver glycogen.

    If your liver and muscle glycogen stores are already full, the excess glucose out of the blood needs to go somewhere else.

    There is only one other place for storing the excess energy that the glucose represents, and that is our fat stores. We tend to think of sugars and fats to be very different things – one is white and crystalline, and the other is oily or greasy – but they are both molecules made from carbon, oxygen, and hydrogen. The liver and fat cells can take in the excess glucose and convert it to fat, which is stored in our fat cells.

    The biochemistry to do this is built on a hormone that we have all heard of, insulin. When blood sugar is high, the pancreas releases insulin, which has 3 main effects our system:

    1. The muscles and liver increase their absorption of glucose to store as glycogen (assuming there is room to store it).
    2. The body turns off fat burning, so that current energy use will help use up glucose.
    3. The fat cells increase their absorption of glucose to store as fat.

    The speed at which glucose can be stored depends on where it is being stored; storing it as glycogen is quick, while storing it as fat is slow. Here’s an interesting chart from a study:

    Image result for insulin resistance glucose levels

    The subjects in this study had slept overnight, which had burned some of the glycogen in their stores. They then gave them one of three breakfasts:

    • A can of Coke
    • A service of instant oatmeal
    • 2 poached eggs.

    Both the Coke and the oatmeal have a lot of carbs, and the eggs have almost none.

    Then, they fed them a *second* breakfast of oatmeal – a lot of carbs – and measured their blood sugar over time.

    What they found was that if the first breakfast was eggs, the second breakfast had little effect on their blood glucose, because all of those carbs went straight back into filling up the glycogen stores. If the first breakfast had carbs, they had mostly refilled the glycogen stores already, and it therefore took quite a while to get the blood sugar back to normal. Which means that much of the second breakfast was stored as fat.

    These charts showed what happened with a healthy person – one that we would call “insulin sensitive”. The blood glucose gets back to normal.

    For some people, that doesn’t happen. There are different theories as to why it doesn’t happen; one is that the glycogen stores just get full, one is that the fat and liver cells can’t do the conversion to fat well, and there are others. Regardless, their glucose-absorbing cells become resistant to the effects of insulin, which we call “insulin resistance”. The first reaction of our bodies is to try harder by using more insulin, but this is an arms race that can eventually lead to problems in insulin production. Many people progress from insulin resistance to type II diabetes and metabolic syndrome.

    I want to stress here that insulin resistance and type II diabetes are about the abilities of our bodies to regulate blood glucose levels, they are not about weight. It is true that people who carry a lot of extra weight are more likely to have blood glucose issues, but there are obese people who have good blood glucose control, and – perhaps more surprisingly – there are thin or normal weight people who have insulin or type II diabetes. They have bodies that are not good at converting excess glucose to fat.

    That is why testing for blood glucose over time is important. Unfortunately, testing for blood glucose every day is intrusive and not something you can use with the general population, so for a long time all that was used was the blood glucose measured at one time, which is not a good predictor.

    Then a weird bit of biochemistry came to the rescue. It turns out that in our red blood cells, the hemoglobin that transports oxygen can become glycated – it can have a glucose molecule attached to it. The chance of that happening depends on the average amount of glucose in the blood; if you have a low average blood glucose, few of your hemoglobin molecules will be glycated, while if you have high average glucose, more will be glycated.

    And, it turns out that when red blood cells die, we can look at the hemoglobin and see how much was glycated, and therefore have a good idea the overall glucose levels, as a weighted average for the past few months. 

    The test to do this generates a value known as HbA1c, or simply A1c, and it’s the prime diagnostic measure for insulin resistance and type II diabetes.

    Low blood glucose

    Thankfully, this is a lot simpler.

    The reaction to low blood glucose is somewhat the opposite to high blood glucose. It is mediated by a hormone released by the pancreas known as glucagon, which has roughly the opposite effects as insulin:

  • The glycogen stored in the liver is converted back into glucose and released into the bloodstream (the glycogen in muscles can only be used locally; it cannot be released back into the bloodstream).
  • The body encourages the release and burning of fatty acids rather than carbohydrates.
  • If that is enough to raise the blood glucose, that everybody is happy. If the low blood glucose continues for longer – say for a few days – the body switches over to an alternate fueling approach known as “ketosis”, which involves the following changes:

  • The liver starts producing what are known as “ketone bodies”, which you can think of a glucose substitute for some of the body tissues; the brain can largely use ketone bodies for fuel, as can some muscles.
  • The muscle switch to burning more fat and less carbohydrate to produce energy. Like any exercise adaptation, this occurs over time.
  • The liver starts producing glucose from whatever it has lying around; it might be glycerol from fat metabolism or excess protein, or both. This is known as “gluconeogenesis”.
  • Together the switch to ketone bodies and the creation of new glucose is enough for the body to function normally without eating carbs. Adapting to this takes a couple of weeks for most individuals, though adapting to burn more fat during exercise takes much longer.

    Ketosis is a response whenever carbs are severely limited, whether it be a fast or a ketogenic diet. Ketosis is not an all-or-nothing response; a person on a relatively low-carb diet might be in ketosis overnight when their carb reserves get low and then switch out of it during the day when carbs are more available.

    And that is the story on glucose.

    Galactose metabolism

    Galactose metabolism is pretty much like glucose metabolism, except a trip to the liver is required to break the galactose molecule apart into two glucose molecules, which are either used by the liver or released into the bloodstream.

    Fructose metabolism

    Our body cannot metabolize fructose directly, so first it has to take a trip to the liver to be converted to something that is more useful.

    It ends up as one of three things:

  • Glucose, which is stored in the liver, converted to fat by the liver, or released into the blood stream.
  • Lactate, which can be used by other tissues
  • Triglycerides (ie fat).
  • There is considerable discussion around what the proportions are between those three products and what controls those proportions.

    Some researchers theorize that in some cases, the triglyceride pathway is especially active and that leads to the accumulation of fat in the liver and a condition known as Non Alcoholic Fatty Liver Disease (NAFLD). My limited understanding says that we don’t have definitive evidence on this, but we do know that alcohol is metabolized into fat in the liver and the accumulation of fat causes alcoholic fatty liver disease, and since fructose can also be metabolized into fat in the liver, it’s an interesting hypothesis.

    Futures

    That’s all for carbohydrates.

    Upcoming, we have fat and protein to talk about, and probably a discussion around energy partitioning, which is how our bodies decide what fuel to burn.


    DLE (Globes of Fire) Part 3

     The new boards arrived from allpcb.com. To recap, this, time I went with standard 0.1” (2.54mm”) header pins between the boards. I ordered some angled headers from the Amazon to use for the connections.

    IMG_9061

    After I populated 11 faces with LEDs, it was time for assembly. Here’s the first approach:

    IMG_9063

    The first concept was to wire the faces together with short pieces of header on the back. This worked poorly; it took a long time to hook them up and the angles were rarely right. The first half was technically done, but I was unhappy.

    For the second half – and keeping in mind that prettiness was not a requirement – I decided to go with another approach. I would use angled headers on the outside, and just solder the pins together where they overlapped.

    But first, I needed a better way to set the angle. The led to the following design in TinkerCAD:

    image

    And then a long session of setup to migrate my 3D printer from an absolutely ancient laptop to one that was merely old. I printed up a whole set of these, and then used them to hold the faces at the right angle for soldering. That resulted in this upper ring:

    IMG_9068

    The alignment clips on the right worked very well; it only took about 30 minutes to do this whole ring. And yes, it’s very ugly.

    Time to hook them together, and then attach on the end face. These are attached with small pieces of header pin on the outside.

    IMG_9069

    Then it’s time to wire up the 5 volts, ground, and data, and take it out for a spin.

    The first attempt was not successful; one ring lit and the other didn’t. A quick check discovered that the ground connection between the two rings was not functioning, so I added an additional connection. Which led to this:

    IMG_9071

    The driver is running some simple rainbow code, so each LED is a slightly different color.

    Finally, adding on the requisite acrylic globe gives us the following:

    Globe of fire from Eric Gunnerson on Vimeo.

    Overall, I’m mostly happy. It would be nice if the header holes were a bit tighter on the pins, and I could clearly get by with 2mm or even 1.27mm pins. The 3d-printed alignment clips could use another iteration to make them easier to use.