Monday, March 30, 2020

Will COVID-19 change the balance of power?

Yet another article about the impact on China from COVID-19.

PacNet #16 – Covid-19: As China Recovers, Will Its Economy Follow?

I don't think there is any doubt that China has suffered and is suffering due to COVID-19. The bigger question in my mind is the impact on the U.S. due to Trump's leadership (or lack thereof) and the effect on the global balance of power arising from that impact. China has a population more than three times that of the U.S., yet the U.S. has, by a miracle of mismanagement, managed to surpass China in terms of number of infected persons.

The article gives hard evidence in terms of figures about exports and manufacturing. But these are short-term figures, and you really don't need experts to tell you that COVID-19 has an impact on economies around the world. Highlighting China's figures serves to bring attention to China, yes, but without comparisons with figures from other countries like the U.S., the significance of those figures cannot be fully grasped.

Another worrying sign is that Trump keeps calling this a war. And we have all seen what Republican presidents have done in the past. The war on terror resulted in invasions into other sovereign states. Trump's rhetoric of calling the novel coronavirus the "Chinese virus" may have more sinister intentions beyond trying to blame China. The fear that the U.S. will use COVID-19 as an excuse for trying to maintain its current hegemony through force, whether economic or kinetic, is worrying.

At the end of the day, I think it again boils down to facts over feelings. We all have our own opinions about authoritarian regimes, human rights, and ideals about freedom. But we need to remember that these are our own opinions; they are about how we feel about things. But we need to based our decisions on facts, not our feelings. We are all entitled to our own opinions, our own feelings, but there is only one set of facts. Basing decisions on facts is what separates good decisions from poor ones.

Saturday, March 28, 2020

Cheap IR sensors do not make good endstops






I had such high hopes.

These IR sensors are really cheap, and I was thinking of using them as a cheap auto bed leveling sensor or just as a contactless Z endstop. As you can see from the photo, I even printed mounts for them. One is mounted on a fan cover and would have gone on the Titan Aero's heat sink fan. The other is supposed to mount on the FLSun Cube as a contactless Z endstop.

Then I found out why no one is using these sensors. They are just inconsistent, easily affected by ambient light, and even minor differences in surfaces. So repeatability will be a super problem.

Oh well... at least the mount for the FLSun Cube can fit a mechanical switch too.

Friday, March 27, 2020

The danger of feelings over facts


Today, we see the danger of making decisions based on feelings rather than facts.

There was little evidence to suggest that jobs were being lost en masse to immigrants, legal or illegal, yet people allowed someone to use racist feelings to come into power.

This is little evidence that a physical wall will stop illegal immigration; the Great Wall of China never really did stop nomads from raiding and even conquering China. Yet people allowed rhetoric to sway their feelings and demand for resources to be poured into building a wall when there are more pressing needs for those resources.

There is no evidence that tariffs are being paid by China; on the contrary, tariffs are paid by Americans importing goods from overseas. Yet again, they allowed their feelings to be swayed to support tariffs which make it more costly for their daily lives.

Feelings can be swayed; facts cannot be changed.

The people who voted for Trump and kept him in power trusted their feelings over the facts. Their feelings were exploited for Trump's ego, and today, the U.S. has surpassed all other countries in the number of detected COVID-19 cases. And the U.S. is on the way toward surpassing China in the number of COVID-19 deaths. One can only hope that the actions of governors and local leaders can prevent the U.S. from surpassing Italy's figures. There is no need to be number one in everything.

The leader that is incompetent yet decisive is the one who gets everyone killed.

Friday, March 20, 2020

My Linux journey, updated

Long ago, when I first started on my Linux journey, there were two main options: Debian or Red Hat. I went with Debian. This was 1999, a time when installing any distribution of Linux was not as straightforward as it is today. And adding to that complexity was that I had a laptop; getting anything to run was a challenge as Linux back then tended to be slower in rolling out device drivers for the latest technologies. This was followed by language support (I needed Japanese input and fonts) so I eventually switched to Turbolinux, a Japanese distribution based on Red Hat.

As Linux development sped up, issues with device drivers and language support started to become better in the mainstream distributions, and I switched to Fedora Core. Fedora is also based on Red Hat, which explained the choice since I was just switching from one Red Hat-based distro to another Red Hat-based distro. Fedora came with the GNOME desktop, which worked well for me until GNOME 3 came along. GNOME 3's GNOME Shell just didn't feel right for me, so I started searching for an alternative.

In my search, I came upon Linux Mint. It offered the "traditional" desktop feel of GNOME 2 and Windows (yes, I was and still am a Windows user; dual booting was something I did and still do, even though the computers I use now are either Linux or Windows machines without dual boot). I didn't hesitate; I made the switch. Linux Mint is ultimately based on Debian, which brought me back to the world of apt after a long hiatus.

In my single board computers, I am using Ubuntu, Raspbian, and Armbian. These are all distros based on Debian. I am fine with the desktops offered by Raspbian and Armbian; Ubuntu, with its GNOME desktop, is still something that I struggle with. Good thing I use them headless, with almost everything done via the command line on SSH, with the occasional X11 forwarding if I do need something with a GUI.

I am still using Linux Mint today on my main "desktop" (it is a mini PC), and have my older laptop on a Windows/Linux Mint dual boot. I am likely to continue to use Linux Mint on new builds (I am hoping to get the time and resources to build a cheap DL rig with AMD + GTX 1660 Super), although Ubuntu MATE looks "attractive" too. I continue to dream of the day when I can fully ditch Windows, but since my current work requires me to use Microsoft Office, that is unlikely to happen for a while...

Thursday, March 19, 2020

More thoughts about the economic impact of the coronavirus

Recently, I wrote about my thoughts on how the novel coronavirus and COVID-19 will affect economies. As the coronavirus spreads across the world, and more and more people are diagnosed with COVID-19, things are changing again.

Those who speculated that supply chains will leave China for other countries, especially those in Southeast Asia, are probably relooking at their opinions now as those countries are also closing off their borders, making it harder for goods to be moved between countries. Conversely, China has done everything it can to get back to normalcy as soon as it can. We see the drop in COVID-19 cases in China, and its factories are reopening. It is even sending medical staff overseas to help other countries deal with COVID-19.

Meanwhile, other countries are banning foreign travelers or imposing quarantine/isolation on people entering their borders. Italy has seen its medical system overwhelmed, and someone in the U.S. even mentioned that the coronavirus could infect 40% to 60% of the U.S. population. That's like 150 million people, and even a fatality rate of 1% would mean more than a million deaths.

We have seen the stock market tanking in the U.S., bringing with it the other stock markets in the world. Economic outlook is bleak with people saying that the U.S. is probably already in a recession, if not an economic depression. Yet there are also countries who had somehow managed to keep afloat. Singapore continues to serve as an example of how to deal with the novel coronavirus by always trying to stay ahead of the curve. South Korea, with the rapid decision to expand testing, has managed to limit the spread of COVID-19 too. Hong Kong is linked to mainland China by land, yet managed to effectively keep itself isolated. Taiwan, with strong economic ties to mainland China, has also managed to contain the spread of the novel coronavirus.

These countries share one similarity: the ability of their governments to take swift and decisive action. Their governments made use of the time that China bought (with its quarantine of Wuhan and other major cities) to put in place measures for detecting and limiting the spread of the virus. While the rest of the world was watching how things would develop in China, and some even trying to find blame with the Chinese government, these countries were making the best use of that time to make sure their people are and will be safe.

If Japan had made use of the Chinese New Year period, when China was effectively isolated, to also ask its people to limit travel and work from home, Abe would not have to deal with allegations that he is deliberately making it hard to test people (by setting really high criteria to qualify for testing) so that it would not affect the Olympics. But Japan carried on with life as usual, the packed trained and densely populated cities became breeding grounds, and there are more and more cases each day. And those cases are only those who had cleared that high criteria for testing; based on statistics, there are probably many many more with COVID-19 that are either asymptomatic or with mild symptoms.

If the rest of the world had used the Chinese New Year period to limit travel and close schools and work from home, we may not be where we are today. No one knows for sure, but that possibility is there.

But their governments, their leaders, did not take that chance, did not make that tough decision. And so here we are today. Where people cannot feel safe and secure, medically, socially, economically. A world of racism and conspiracy theories as people try to find others to blame for their own poor judgment.

I just hope we can all get through this, come out better, and come out wiser.

Previous posts:
My thoughts about the economic impact of the coronavirus
Some thoughts about the political and economic impact of COVID-19 on China

Wednesday, March 18, 2020

Connecting MRR ESPA to Labists Mini 3D printer (aka Easythreed X1)

After taking a look at the X1's control board, I managed to find some time to hook it up to a MRR ESPA.

I used a marker to make a mark on each connector as I disconnected them so that I would not mess them up. It was then just a case of transferring each connector to the right one on the MRR ESPA. One note, though: the endstop connectors were oriented differently, so I had to do a bit of pin swapping for each endstop.





My 25x25x7mm fan has yet to arrive, so I could not connect the part cooling fan (the set does not come with a part cooling fan, but you can buy your own and print the fan shroud).
I connected the original board to my computer, and ran M503 to get the following:
Marlin 1.1.0-RC3
Last Updated: 2015-12-01 12:00 | Author: (none, default config)
Compiled: Jan 12 2020
Free Memory: 12015  PlannerBufferBytes: 1232
Hardcoded Default Settings Loaded
Steps per unit:
 M92 X467.00 Y467.00 Z1160.00 E1040.00
Maximum feedrates (mm/s):
 M203 X40.00 Y40.00 Z10.00 E80.00
Maximum Acceleration (mm/s2):
 M201 X1000 Y1000 Z200 E1000
Accelerations: P=printing, R=retract and T=travel
 M204 P300.00 R300.00 T300.00
Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)
 M205 S0.00 T0.00 B20000 X2.00 Z0.40 E1.00
Home offset (mm):
 M206 X0.00 Y0.00 Z0.00
PID settings:
 M301 P22.20 I1.08 D114.00 C100.00 L20
Filament settings: Disabled
 M200 D3.00
 M200 D0


Using these settings, I edited Configuration.h, then compiled Marlin 2.0, and uploaded the firmware to the MRR ESPA. Then, I tested the endstops to check their logic. Turned out I needed to invert the logic.

#define X_MIN_ENDSTOP_INVERTING true
#define Y_MIN_ENDSTOP_INVERTING true
#define Z_MIN_ENDSTOP_INVERTING true

The stepper logic works if set as:
#define INVERT_X_DIR true
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false
#define INVERT_E0_DIR true


I also lowered the homing speed, since it requires a lot of steps per mm, and I was having trouble with homing at 50mm/s.
#define HOMING_FEEDRATE_XY (25*60)
#define HOMING_FEEDRATE_Z  (4*60)


Loading filament was quite easy, just push in filament into the PTFE tube as far as it will go, then use the extruder to load the filament. As I am using the ESP3D webUI, I just had to click on the "Extrude" button on the webUI.

I used a multimeter to check the Vref used on the original board, but I was getting readings of 1.4V to 1.5V. On the Chinese A4988 stepper driver boards I am using, that would be a crazy amount of current, so I set Vref on my A4988 stepper drivers to 0.5V instead. This worked without any problems. (Update March 22, 2020: The original board uses 0.2 ohm resistors for Rsense, which explains the higher Vref. My Chinese A4988 stepper driver boards use 0.1 ohm for Rsense, so I switched to using 0.7V for Vref on my stepper drivers.)

I was able to home the axes, and move around using the webUI. So far so good. I tried heating up the hotend too, no issues with that. I was at first quite worried about the hotend wiring, which were really thin. But using a clamp meter, the current draw when heating seemed to be around 0.5A. Not a lot, and definitely not going to burn the wires.

Next would be to level the bed and test print something.

Get the MRR ESPA board here.

MRR ESPA and MRR ESPE related social media:
Facebook page
Facebook group for users

Affiliate link to Labists mini 3D printer on Amazon.com

Handling COVID-19: China versus U.S.

It is thought-provoking to see how the various countries are handling COVID-19. For easy comparison, let's look at China and the U.S.

China basically quarantined entire cities and even a whole province. But it did not stop at that. There was active effort to temporarily ramp up medical capabilities at Wuhan, where the most cases were, and it included bringing in resources from outside Wuhan. Medical teams were dispatched, and temporary hospitals were built. The quarantine was only part of the equation; without the pooling of resources from other parts of China, we would likely have seen more deaths in Wuhan.

And China is using technology to help curtail the spread of COVID-19. People detection technology is being used to track crowd size so that no place becomes too crowded. Yes, this may be a feature of the police state, but it is being used for the good of the people now, and people will remember this event, and in the future, more likely to continue to accept such monitoring since it actually helped save lives.

Meanwhile, the U.S. continues to avoid quarantines even though the number of cases are rising. The underlying issue with healthcare in the U.S. means that it is near to impossible to actually grasp the actual state of things. There were probably many people who had not been tested because they lacked the medical insurance for such healthcare. Couple that with the U.S. medical system being built on a for-profit model, it does not have the buffer for a sudden ramp up like what China did. Which makes U.S. hospitals more prone to being overwhelmed (like in Italy).

The large income gap in the U.S. also means that the impact of any economic shutdown will have greater social impact. With the lack of medical leave, people who are sick will continue to work if they need the money to pay bills. This is just going to aggravate the problem; not having solved this latent problem in the past will now come to haunt the U.S. The lack of a central agency in the U.S. coordinating national-level efforts to bring resources to where they are most needed, and leaving things to the states and municipalities, will only result in slow response and greater chaos. At a time when national leadership is critical, national leadership is lacking.

Countries can and did criticize China about its initial handling of COVID-19, and some countries still continue to do so. But China took the drastic steps necessary to contain COVID-19; those critics of China should ask themselves if their own countries are doing the same for them.

Friday, March 13, 2020

A look at the control board of the Labists Mini 3D Printer (aka Easythreed X1)

I wrote about getting a mini 3D printer as a demo set which I can bring along to maker fairs and such. The Labists Mini 3D Printer (a rebrand of the Easythreed X1) was on sale, so I decided to just get one to see how it goes.

As you can see, it comes in a really compact case. Here is the box beside a box of filament for comparison.

It comes in essentially 3 parts: the base with the Y axis, the X and Z axis arm, and the control box. Assembly is just a matter of placing the XZ arm into the base and fixing it with two long screws, then connecting a few wires to the control box.

I didn't even bother to give it a test print because I am just going to remove the control box and connect the mechanical portion to a MRR ESPA. So I decided to open up the control box to see what is inside.

The mainboard is driven by a ATMEGA1284 microcontroller. (Note: This is an 8-bit microcontroller.)

It seems the ET-4000 V2 is actually an earlier printer from Easythreed. Guess they just use the same board for all their printers.

Stepper drivers are... yup, A4988.

The 12V to 5V step down converter is a MP1584.

I am not really sure what this 74HC4050 level shifter is for, probably for the PCB with the control buttons.

This is the back of the PCB with the control buttons.

And the control board actually has MOSFETs not just for the part cooling fan (which does not come with this kit; you need to get a separate 25mm x 25mm x 7mm 12V fan and print a shroud which can be found on Easythreed's website) and the hotend. It also has a MOSFET and connectors for a heated bed. The MOSFETs for the hotend and part cooling fan are HY1403, but I can't make out what the heated bed uses.

One thing that worries me is the very thin wires used for the hotend. I am really worried how that will hold up with currents above 1A.

Next is to find time to hook it up to a MRR ESPA and try to print something.

Affiliate link to product on Amazon.com

Monday, March 09, 2020

Using git from within VS Code


Okay, I know I am behind the times. But I finally got around to exploring what an IDE can actually do beyond just being a fancy text editor. After all, the "I" in IDE is for integrated, so an IDE actually has a lot of integrated functions to help make life easier for programmers.

I have been using GitHub for a while, and had to try and figure out git during this time. First, most of the stuff was via the command line, which can be quite tedious. Recently, I discovered GitHub Desktop, which helps to make life easier since it is a GUI for all those command line stuff. But now, I realized that VS Code actually has all these functions built into it in the first place. I don't really need GitHub Desktop. Or git-cola.

The source control panel in VS Code really makes life so much easier for me, since most of my actions would be staging, committing, and pushing on my own repositories.

As for compiling Marlin firmware, it makes life easier for me too, since I can easily discard previous changes to the configuration files. Then pull the latest version off GitHub. And with the Meld Diff extension, I can then select to compare the new configuration files with the set that I keep in another directory, and the extension will then call up Meld for me to merge the old and new configuration files.

For pull requests to Marlin, VS Code's source control also allows me to create a new feature branch, add my changes, then push that feature branch to my Marlin fork. I can then go online to send that PR. (The GitHub Pull Requests extension even allows PRs to be submitted from within VS Code.)

Going forward, I will try to use VS Code as much as I can in my new workflow.

Saturday, March 07, 2020

Workflow to compile Marlin on a SBC

I am going to try a new thing. I have a few single board computers on hand, and I am going to use them to compile Marlin. This is a note to self in case I forget the workflow.

So, the workflow is likely to be:
git clone https://github.com/MarlinFirmware/Marlin.git
to get the Marlin repository.

Then,
cd Marlin
git checkout bugfix-2.0.x
to get to the bugfix-2.0.x branch.

Edits to Configuration.h and Configuration_adv.h will be made as necessary, the compiled using PlatformIO on VS Code.

To pull the latest changes:
git checkout -- .
to get rid of all previous changes.

git pull
to get the latest code.
Then make changes.

Monday, March 02, 2020

Some thoughts about the political and economic impact of COVID-19 on China

Xi Jinping's coronavirus crucible

It is true that once supply chains have adjusted away from an existing supplier, they rarely shift back. But the issue is not a simple one. For one, production facilities are capital investments that are expected to run for a certain period of time in order to pay off that initial investment. Shifting away from an existing facility means writing off a previous investment, and even if it is just a portion of that initial investment, still represents an implicit loss. This is just not a move most companies, focused on making profits, will undertake easily.

Couple that with the investment that needs to be made in other countries to create production facilities there, and you will see that this is not a light decision for many. Companies need to fund such an investment, and it is no small sum. Not many companies have that kind of reserves to draw on, nor that kind of credibility for them to borrow from banks. Especially if they are already trying to pay back a previous loan from an existing investment in China.

And then there is the labor force issue. To shift production to another country, that country needs to have sufficient surplus labor for such an increase in production. You are either looking at a country with high unemployment, which may imply poor infrastructure and other conditions not conducive to investments, or you will need to throw in further capital investments to improve workforce productivity. This, again, boils down to more money.

There is also the time factor. It takes time to build a factory, it takes time to build the machinery for that factory, it takes time to recruit people to work in that factory, it takes time to apply for the required permits. You are not looking at something that can be done in a month or two. Unless companies already have plans in the works, trying to start this endeavor anew is going to take time. Lots of time. Time which companies may not be willing to spend, since they have the choice of allocating those same resources to catch up on production after their Chinese factories resume work.

So while there are people who speculate that manufacturing will leave China, it may not be on a scale as large as they expect, and it may even be something that has already been part of the plan before the coronavirus hit. As for the long-term impact on the CCP from this outflow? Well, given that the CCP has been trying to shift its industry focus away from a manufacturing-bias toward production higher up the technology and value chain, speculations about the impact to Xi's regime may be exaggerated. Only time will tell.

But remember, it is not easy to find a replacement for an economy with a workforce of several hundred million people and the infrastructure to support being a global manufacturing hub.

As for the voices of dissent? In a population of more than a billion people, there will be people who feel differently. We need to ask ourselves, are the voices of dissent that we hear the voices of the majority? Or are these people the vocal minority? Do they really represent a general lack of support for Xi and the CCP? Or are we just hearing them, even though they are but a minority, because their voices fit our existing mindsets and are the voices we hope to hear, want to hear?

Are these voices like those of the gun supporters in the U.S.? Where the majority actually wants gun control, but that small vocal minority has hijacked the entire conversation such that the majority gets ignored? Are we listening to the voices of a small minority whose dissent we want to hear, at the expense of ignoring the vast majority who actually have nothing against Xi and the CCP? Are we ignoring facts for feelings?

If we backtrack a bit to 2019, the Hong Kong protests, I think the early protests really had the CCP worried. Because the majority of the Hong Kong people really were against CCP interference in Hong Kong's legal system. But when a small minority hijacked the protests for their own political objective, and turned the protests into increasingly violent riots, and made demands beyond the initial extradition law? Well, people at first continued to stand together since that was the best way to get things done. But eventually, the majority drifted away, since those "extra" political terms were not something they felt strongly about.

Today, if we look at the facts, I don't think Xi and the CCP are as worried about the political impact of the coronavirus as Western writers speculate them to be. Compared to the U.S. and Japan, China has shown that it is willing to move quickly to contain a threat. The epicenter of the disease is in China, but China has shown that it is able to act swiftly and decisively. Contrast that with the slow actions of Japan, where Abe is only recently starting to take firmer actions to contain the spread. Yet it seems that the disease has already spread further in Japan than Abe wants to admit. And the U.S. is showing that same trend, with more and more cases of community infection, but also more and more denial from the Trump administration.

Companies are not stupid. Like the majority of the Hong Kong people, who know when their cause is being hijacked by a minority for other political aims, companies can see the responses of countries, the results, and they will make their production decisions based on what they see. After all, it is through decisions based on facts that we can operate a tighter and faster OODA loop than our competitors. Those who base decisions on feelings end up in an OODA loop that is increasingly removed from reality, until they become obsolete.

Wow. This post has become a very long rambling of thoughts. Guess I am going to stop here before I really go off tangent.

Mini 3D printer for demonstrations

I have been searching for a small 3D printer as a platform for showcasing the MRR ESPx boards at local maker fairs and such. I was going to build one based on an open source design when I find something that I like.

Then, I happened upon this on Amazon.


It seems to be small enough to transport around, and since the control box is a separate part of the build, I can easily just house the MRR ESPx board in my own control box. The only thing is that it lacks a heated bed, but I guess I can live with using stick glue. If need be, I can always slap a small silicon heating pad under the bed, but I will then need to get a better power supply.

EasyThreed X1
http://www.easythreed.com/
(The one I found on Amazon is a local reseller.)

I guess the only way to find out if this is going to work is to actually get one and try. Wish me luck!

Karez water system (video)

Many many years ago (more than 20, actually), I went on a trip along the Silk Road. One of the places visited was Turpan, where we saw the karez water system which supplies water to this city in the middle of a desert.

So when I saw this video, I just thought I would share it for more people to learn about this interesting water system, an ingenious way of dealing with the issue of water in a desert.