Thursday, April 25, 2019

A year since Inuka's passing

It has been a year since Inuka, the first polar bear to be born in the tropics, passed away (or rather, was put to sleep). And with his passing, the Singapore zoo will no longer have a polar bear.

His passing brought up a lot of emotions in me. Not because I am a polar bear lover. But because of the significance of the polar bear enclosure to me.

You see, my father was involved in building the polar bear enclosure at the Singapore zoo. Specifically, the landscaping part. Going to the zoo with him (via the side entrance) when I was young was part of my school holiday routine. He went as part of work; I went under the reason of "helping him". Of course, I wasn't of much help, but it allowed me to roam the zoo for free.

More importantly, it allowed me to spend time with my father, seeing him at work, learning important life and leadership lessons from him.

Those times with him, those lessons from him, they are all the more precious because he passed away when I was 20.

And so, every time I pass by the polar bear enclosure (and the komodo dragon one too), I would remember the times with him, driving around Singapore as he visited various work sites to check on the progress of work, buy and bring lunch to his workers, and took over their work while they ate. He never gave any formal lectures on leadership to me, never talked about his work much, but I learnt from observing him. The importance of being present, seeing things with one's eyes, caring for the people in the team, and persevering through hard work. As a preteen and teenager, I was attending excellent leadership lessons for free.

Those lessons have served me well over the years, especially when I was in key leadership positions.

My son saw tears welling up in my eyes last year, when we walked through the empty polar bear enclosure at the zoo. I tried to explain to him the reason for those tears, but he might have been a bit too young to understand.

I only hope he will grow up learning as much from me as I had from my father.

Sunday, April 21, 2019

Learning from AI


Paper: Visualizing memorization in RNNs

It is interesting to see how AI learns. What is especially interesting to me from this video and paper is the possibility of humans learning from machines. For example, in this example, the different AI implementations are trying to understand a piece of text, and we can see its "attention span" as it tries to understand a letter (and word). My thought: can this eventually be used to help us learn better in our own physical, human world? Can an AI technique be used to teach humans how to better read a sentence to grasp a better understanding of that sentence and its context? If so, it is an interesting example of how AI can help us to improve human skills, thereby contributing toward bettering human intelligence.

Thursday, April 18, 2019

Update 4 on ESP32-based 3D printer control board

Good and bad news.

Good news: I got v1.0 of MRR ESPA (the basic 3D printer control board based on the ESP32) all soldered up. Motors with A4988 drivers working. Endstops working. Hotend was able to heat up to 240 degC and maintain it without any significant rise in the temperature of the MOSFET.

Bad news: The heat bed MOSFET smoked (almost started a fire) when I was testing it. Tried room temperature to 40 degC, and saw smoke when it started to heat up to 35 degC. Temperature on the heatsink attached to the MOSFET was reaching 120 degC. Shut off, then I tried gradual heating. Slowly went from room temperature to 35, then step up in steps of 2 to 3 degC. Eventually reached 50 degC. When going to 52 degC, there was a bit of smoke which soon stopped when temperature reached target. Then I tried 55 degC. That was when it started to smoke real bad. Like, things were melting, there was sizzling sound, and lots of smoke. Quickly shut off the mains.


You can see the black stuff that came from the MOSFET. Smoke was coming out, and when the smoke cleared, I saw that this black stuff had oozed out from the MOSFET.


This is the reverse side. The same blackish stuff was on the reverse side too, I removed it before taking the photo, though you can see some residue.

The heat bed is 180W, running on 12V, so the current draw (theoretically) is 15A. Resistance as measured from terminal + to terminal - for the heat bed was 0.9 ohms, which sounds about right. The MOSFET (IRLS3034) is driven by a voltage divider that drives the gate at 4.8V. Based on specs, the IRLS3034 should have Rds of 2.0 mOhms at 4.5V. So simple calculation says the MOSFET is dissipating 15x15x0.002 which is 0.45W. At temperature rise of 40degC/W, the MOSFET should only be rising like 18degC. I mean, even given other factors, the temperature rise should not be more than 50degC, right? But I was getting a temp rise of 100degC and more. I can't really figure out why.

If anyone has any idea, I would be open to hearing them.

Note: Issue fixed. Pre-launch version now available here. Some information on this has been updated here.

Sunday, April 14, 2019

What "The Rise of Skywalker" may mean...

Star Wars: The Rise of Skywalker


Wow.

But what does it mean? There has been a lot of speculation.

So here, I add my own take.

The Star Wars movies made by George Lucas has been about Anakin Skywalker. Anakin Skywalker as Darth Vader in the original movies, then Anakin's story about how he came to be Darth Vader in the prequels.

And in the new movies, Episodes 7 and 8, Anakin's legacy through his children (Luke and Leia) in shaping the galaxy after the destruction of Death Star II and the collapse of the Empire.

The way I see it, the entire series, from Episode 1 till 9, is about Anakin Skywalker.

Who is Anakin Skywalker? Anakin Skywalker is the Chosen One. The one who will bring balance to the force.

And Kylo Ren has said that he will finish what Anakin has started. Which implies that Kylo will bring balance to the force. Or, he could be the one to put an end to Palpatine, a final end that Anakin started but did not accomplish (if Palpatine returns).

With the amount of things that George Lucas borrowed from Frank Herbert's Dune in the original movies, it would not be surprising that Episode 9 will continue to borrow some concepts from Dune. When Luke's voice said, "A thousand generations live within you," it reminded me about the Other Memory of the Bene Gesserit.

If that is so, there is nothing stopping Episode 9 from borrowing other concepts from Dune. Such as the warning against a central body (in the figure of Paul Atreides, and then the God Emperor Leto II) governing over all of humanity.

Could this mean that Anakin Skywalker, and the Skywalker line, is the force that seeks to prevent any one side, whether good or bad, from controlling the galaxy?

The rise of Skywalker, the balancing force. Could this be the meaning behind the movie title?

Saturday, April 13, 2019

夜深难入眠

夜里独唱琵琶行
歌声未出泪先流
感慨万分不能停
泣梦九泉再重逢
转眼三年光阴逝
枯松独立泰山峰

--------------------------------------------
夜深星空难入眠
辗转反复心不静
意生字出句自成
只恨知音已无人

--------------------------------------------
穿山越岭孰不言
穿山越岭又曾见
赴汤蹈火入耳熟
赴汤蹈火又几人

--------------------------------------------
杜康不酿酒
羲之不提笔
太白不吟诗
孔明不谋计
志高技深无知音
青竹无名枉一生
玄德不顾孔明芦
卧龙再能无用处
 
--------------------------------------------
(Update 15 October 2022: A modification of the above)
杜康酿酒羲之书
太白吟诗孔明计
志高技深无知音
青竹无名枉一生
玄德不顾孔明芦
卧龙再能无用处

Tuesday, April 09, 2019

Determining what AI will replace

Real or artificial? Tech titans declare AI ethics concerns

I think we really need to sit down for a proper conversation on what we want to develop AI for. What is it that we want to replace with machines, and what is it that human beings will continue to do?

History has shown that if something is possible, human endeavor will eventually make it happen. Human beings can now fly, dive underwater, and go faster on land than any other land animal. We are now able to communicate across vast distances in real time. We can interact with people without having to be physically at the same location.

Still, human have been the ones at the center of these actions. Humans decide where to fly to, where to go diving, and where to travel on land. We decide on who we want to interact to, and what we want to talk about. But AI is slowly changing that. And if we do not come to a decision soon, AI will only make more and more decisions for us.

And the danger of that? If we make less and less decisions, our brains will grow stupid from lack of use.

Of course, this is not a danger if we can reuse that freed up brain power for something else. So the question is twofold.

1. What aspects of our lives are we willing to replace with machines, such that it frees us up from things that we do not (or cannot) do for us to focus on things that we should be really focusing on?
2. What are the things that we should be focusing on?

Looking at these two questions, I think we can say that machine vision is a good case for AI. It can help those who cannot see. It enhances our ability to see minute details so that we do not miss out on them. But at the same time, there is the downside: current machine vision is pre-trained before deployment, which means it will recognize a finite set of objects. Which means any reliance on such technology will "narrow" our perspective to that finite set, i.e. our attention gets drawn to things that the computer knows, making us more likely to miss other details that we might have otherwise caught if we did not rely on machine vision.

Let's look at machine transcription (aka speech-to-text synthesis). This definitely helps those who cannot hear. And for others, it frees up people from a mundane task so that we can use those people (resources) for other tasks. But is there a downside? So far, I can't think of any, but who knows?

Autonomous driving is another use case which has been undergoing heavy development. And a lot of attention in terms of ethics. Its controversy is: who is responsible should a self-driving car kill or injure someone? There is debate on this, and I hope people will take up this debate more actively, because with the current rate of development, self-driving cars are on the horizon. Let's sort the ethical questions before we are forced to face the reality of it.

And finally, my biggest fear: uncurbed, we will one day develop machines that are so intelligent, they no longer need human beings for their further development. They can develop themselves into even better and better versions able to do more and more things. Will we then find ourselves as second-class citizens of our own societies?

Tuesday, April 02, 2019

Do fifth-generation fighters require exceptional maneuverability?

The F-35's New OODA Loop

It is quite interesting that this article brought up COL John Boyd, the father of the OODA loop. It is interesting because COL Boyd was involved in designing the F-15 and F-16, and maneuverability was one of the main issues that he addressed. At a time when decision-makers were saying that missiles will end the era of dogfighting with guns, COL Boyd showed that fighters will still need be have high maneuverability in order to achieve their missions.

The question, then, is whether this still holds true?

"If superior performance is not required to win the next war, what is? What characteristics will allow a fifth-generation fighter pilot to execute the OODA loop at a faster tempo than his enemy in a combat scenario he is likely to encounter? The answer, in a word, is information."

Yes, the OODA loop places heavy emphasis on information, because information is crucial for the orientation process of the loop. But the entire process is not sequential; everything is interacting with each other, and a fighter's maneuverability affects the orientation, decision-making, and action processes too.

"While maneuverability allowed a fourth-generation fighter pilot to operate the OODA loop at a faster tempo than his enemy in a dogfight, this is not the primary conflict a fifth-generation fighter is designed around. Today’s designers optimized the F-35 to execute a coordinated OODA loop between a flight of F-35s performing an air-to-air or air-to-ground engagement with today’s weapons and tactics, not a 1970s one-on-one dogfight."

So while today's fighters may not need to be as maneuverable because maneuverability is being designed into missiles instead, we need to ask the question: can the enemy outmaneuver our missiles? Because if the enemy can do so, it can close the distance to our fighters, and we will still end up in a dogfight. And we will end up in a dogfight against an enemy that is designed for dogfights using a fighter that is not. Who will win?

That same question came up in COL Boyd's mind back in the 60s and 70s, when MiGs came up against F-4s, designed to fight with missiles, in the Vietnam War.

COL Boyd's emphasis on maneuverability is about winning under all circumstances. The execution of the OODA loop must be faster than the enemy's under all circumstances. That was why he came up with the E-M charts to show the performance of various aircraft, to illustrate where their advantages and disadvantages are. That was why he sought to emphasize the design of maneuverability into fighter design.

While information is key to winning battles, maneuverability is an equally important aspect that must not be neglected. As long as human beings are the ones fighting wars, we need to be able to gather information faster than our enemies, orient ourselves faster, decide faster, and be able to act faster.

Under all circumstances.

Should we hedge our bets and emphasize superior information, superior decision-making, and superior maneuverability all at once? Or do we place a gamble that superior information is all we need?

Friday, March 29, 2019

Should we ban information?

I wrote about the shooting in Christchurch. The New Zealand government has more or less banned the possession of the shooting video as well as the manifesto written by the shooter.

Is that the way to go?

I agree that spreading the video and the manifesto may expose more people to these ideas, which have no place in our society. But at the same time, it brings attention to them. This lends support to those warped ideas, but does not allow access to information which can be refuted to expose the fallacy of those ideas.

And if banning is the way to go, the New Zealand government may have to start banning all news coverage of Trump. Because his words spread hate along similar lines. They expose people to similar ideas.

Not giving an avenue to spread such ideas is one thing. But is banning the way to go?

Or is openness, and with it, the availability of information for people to learn, and criticize, a more balanced approach? Because in this day and age when information moves at the speed of light, unlike a time when people and ideas spreading dangerous ideas can be physically contained, any idea that has been launched into cyberspace can never be retracted back and contained.

Do we shut off people from things that we think may negatively impact them so as to protect them, like a protective parent?

Or do we expose them to the world even as we guide them along, for them to learn on their own with the support of the wisdom of others?

Thursday, March 21, 2019

Update 3 on ESP32 3D printer control board

Another update on the MRR ESPA 3D printer control board based on the ESP32.

The smoke that came from plugging in the board to 12V power was narrowed down to... insufficient trace widths. The trace widths for the heated bed and hotend were too thin. So when they start to draw current, the traces get hot, and melt the PCB, giving off smoke. So that's the problem with the heating side that will need to be fixed.

Otherwise, the motor movements seem to be okay. Tried homing and it works. Connected it to an inductive sensor, and that triggered fine too. Here's a short video of it doing some test moves using gcode that basically makes it draw a square.


I keep having problems trying to get my MKS TFT32 touchscreen controller to work on the AUX1 connector. After troubleshooting, I think the problem could be my MKS TFT32 is... a bit fried. It may have some issues on its TX/RX pins. Because when I use other microcontrollers (a M5Stack, and an Arduino Nano) to send and receive gcode with TX/RX pins, those gcodes went through okay. I think, in my previous rounds of testing, I could have damaged my MKS TFT32. Oh well...

The next update will resolve the trace width issue. The bidirectional level shifter will also be dropped to use a simple voltage divider on the ESP32's RX pin. Hopefully, I can get the next version sent for PCB production and get it by early April.

Note: Issue fixed. Pre-launch version now available here. Some information on this has been updated here.

Friday, March 15, 2019

Shooting in Christchurch

Everyone knows. There was a shooting (or rather, two) in Christchurch today, where gunmen attacked two mosques and shot people there.

I saw a video of one of the shootings. The shooter actually broadcast his entire attack live on Facebook.

It was nothing short of a methodical massacre.

All religions share common teachings: universal love for humankind, and punishments for one's own bad deeds. So the indiscriminate killing of people belonging to a certain affiliation (be it race, religion, work, play, or any other ways we can group people) can never be taken as "punishment". In fact, such deeds only show a person's lack of faith, lack of religion, lack of humanity.

Religions warn of demons, of devils. This is what they are referring to.

Those who claim to act in God's name are acting for themselves, acting in the name of those demons and devils. Because an almighty God does not need mortals to act on His or Her behalf. In a more ignorant age, where information was less readily available, I would find it hard to blame people for believing in lies and becoming terrorists, instigated or self-radicalised. But in an age where information is so readily available, why do people still choose to fall into ignorance?

Why do people still choose to believe in demons and devils, instead of the teachings of their religions?

Why do we continue to discriminate against people who are different from us, instead of accepting the diversity that is humankind?

Why do we continue to be weak and fall to temptation, instead of standing tall in faith?

We pray for the fallen, but more importantly, we should ask ourselves, "What can I do to make sure this does not happen again?"

Wednesday, March 06, 2019

Update 2 on ESP32 3D printer control board

v0.9 of the 3D printer control board I am working on. Named MRR ESPA. ESPA because it is based on the ESP32, and "A" since this is the basic version of the board. If anyone has better suggestions for naming these boards (there will be an advance version of the board featuring the use of I2S, once this version is sorted out), please leave them in the comments. Otherwise, the advanced board is going to be called ESPE. 😅

When I tested it with a small 12V PSU (6A), connected with a heatblock to simulate the heat bed, it kind of worked. The E0 heating worked too.

And then I connected it to my test printer (a FLSun Cube frame modified into CoreXY mechanics), flipped on the switch, and saw a thin line of smoke rising up from the IRLR3034 MOSFET for the heat bed. Wow! Somehow, it seems the heat bed MOSFET has failed in the open mode, and was basically trying to heat up the heat bed at max power. So I disconnected the heat bed (as you can see from the picture) to carry on testing.

The hotend heated up fine. For once. One time. I set 60degC, it went to 60degC, and maintained it. Then I tried to set 120degC. Nothing happened. The LED indicating power going to the hotend went off. Nothing. Rebooted, nope. Powered down and up, still couldn't get the hotend to heat. But the fan, which uses the exact same setup as the hotend, continued to work. No issues.

I went through the schematic and PCB layout, and it doesn't seem to be an issue with these. My gut feel is an issue with the bed MOSFET and the voltage shifter for the hotend. The MOSFET was reused from a previous version of the board, and could have been faulty in the first place (which, thinking back to when I connected a hotend to it, seems to be so). The issue with the voltage shifter could be bad soldering. I guess I should get better quality solder paste, instead of dried up one which I tried to revive using flux.

Next step: solder a new board based on the current schematic, using new parts. If the problems persist, then it is an issue with the design and I will need to rethink everything. If not, and it works, then hurray! On to the next stage of testing.

Note: Issue fixed. Pre-launch version now available here. Some information on this has been updated here.

Tuesday, March 05, 2019

Protecting Trump, a catch-22

For those thinking of perjury in order to protect Trump, I guess the dilemma is this.

Conduct perjury, get caught, and be found guilty. Then hope to get a presidential pardon to avoid going to prison.

But, when caught for perjury, Trump's presidency may be endangered, and if he loses his office, he can no longer grant that presidential pardon. But Cohen's case has shown that coming clean doesn't mean "stay out of jail."

Take a gamble that Trump remains in power, and continue to protect Trump? Or swing the other way, and possibly still get thrown into prison?

Truly in between a rock and a hard place. 😅

Wednesday, February 27, 2019

Override or not?

Washington intrigue.

As Democrats move to block Trump's emergency declaration over the wall, Republicans are faced with a dilemma.

If the Mueller report comes out with damning evidence that Republicans cannot deny, it is not a zero chance that Pelosi becomes acting President until January 2021. After all, Pence is so tied up in Trump's campaign and administration, there may just be enough to push for his impeachment too.

And if so... then setting a precedence for executive overreach is not going to work out for the Republicans. In that one year while she is in power, she may use that precedence against the Republicans, and the Republicans will have no one else to blame.

So Republicans are faced with a choice:
1. Pray that Mueller has nothing. Stick with Trump's emergency declaration, and do not override his veto when it happens. Given the number of indictments to date on this case, hindsight may make them look like ostriches sticking their heads in the sand. But who knows? It is a political gamble, and some may be willing to take it.
2. Override Trump's veto when it happens. Break from Trump before the bad news from Mueller breaks, so that Trump doesn't end up dragging the entire GOP with him when he goes down. This may even be used to strike a deal with the Democrats (behind closed doors) to keep Pence. But of course, this will bring the Twitter wrath of Trump, so it is a political gamble that the GOP will be able to survive without Trump.

So it all boils down to Mueller. If Mueller remains tight-lipped, the GOP will need to take a gamble. But if Mueller lets slip some info to the GOP on where his report is going, the GOP will then be able to make a better assessment of the situation in choosing between Option 1 or 2 (probably 2, given all the indications to date).

And there is an Option 3: Trump declares war somewhere in the world (Iran, or most likely, Venezuela), and basically forces everyone to keep him in power so as not to risk the US losing a war through presidential impeachment. Dirty trick that ends up with people getting killed, but nothing is beyond or below Trump.

I guess this will be a week of backroom deals...
🤔

Thursday, February 21, 2019

Dune, as a movie--my thoughts

I am a fan of Dune by Frank Herbert. No secret to that. And a fan of The Lord of the Rings by J.R.R.Tolkien too. And it got me thinking, "Why can someone pull of a The Lord of the Rings movie, but no one has really succeeded yet at a Dune one?"

There has been The Lord of the Rings movies in the past, not just the one directed by Peter Jackson. But I think we can all agree that the ones by Peter Jackson were somewhat successful at visualizing the story. And there were Dune movies in the past too. But none of those were of similar success. Why?

Here are my thoughts.

For a start, movie length. Each movie in Peter Jackson's depiction was more than 3 hours long; more like 4 hours. That is really pushing the limit for movies; it is not an easy task to keep someone in a seat for 4 hours. But one movie per book, and Peter Jackson managed to do it. I think it is because Tolkien's writing style is very descriptive, which means a significant portion of the books were things that can become part of visual effects and costumes and scenery. Unlike words, movies don't need as much "time" to portray these. Another feature of Tolkien's writing is the effort he puts into world-building. There is quite a significant portion of the books spent on providing backgrounds to everything and everyone in the world. These can selectively be left out of the movie to cut down time without heavily impacting the overall plot.

But Frank Herbert's Dune is different in style and length. For a start, the series spans 6 books (or 8, if you could the two by his son, Brian, who sought to bring closure to the world developed by his father). If each book is going to become at least a 3-hour movie, we are looking at something like 20 hours or more. A daunting task even for someone thinking about making this into a TV series.

Then, there is the actual style. Frank Herbert's style of writing is less descriptive. He gave a lot of effort into building his characters, and developing plots within plots within plots. Which makes it hard for a director to choose what to cut; every part of the book is there to build up a plot within a plot within a plot, which the viewer may fail to comprehend fully if anything is left out. A lot of screen time is going to be devoted toward portraying all those dialogues and subplots. This means each book can easily run beyond 4 hours. Multiply that by 6 (or 8) books, and I think we know why no director is ready to take up the challenge of portraying the Dune series. Unless it is a TV series. But the problem is: some plots run deep and slow; something that happened in episode 3 may only be fully realized in episode 20. It is hard to convince a network to produce a series where a person must watch EVERY episode in order to get an idea of what is happening.

So there you have it, my superficial thoughts on the difficulties of portraying the Dune series on film. While the number of books is one issue, the more significant one, I believe, is the way the books are written. Still, as a Dune fan, I do hope someone will eventually take on the daunting task. After all, with video on-demand, it is easier nowadays for a person to not miss an episode.

Sunday, February 17, 2019

3D printing parts for military aircraft

First metallic 3D printed part installed on F-22

Wow.
Wow!

I had always been trying to push for the idea of adopting 3D printing technology to lower the cost of having to lug around spare parts onboard ships. Spare parts take up space which can be used for other purposes. But the issue with widespread implementation is: certification. Very few companies are willing to certify 3D printed parts as "meeting the required specifications to be used as a replacement" for their parts. After all, this puts them out of the parts business. They won't be able to sell spares anymore. It then falls on the onus of the ship owner to determine if those 3d printed parts are good enough, and given the risks involved, most owners are going to simply say, nada, not worth my time to try and test and certify.

But what we have now is the U.S. military setting an example. If 3D printed parts are good enough to be used as spares on a multi-million state-of-the-art fighter jet, there is no reason why they cannot be good enough for other forms of transportation. Of course, there is still the need for testing to make sure those parts meet the required specifications. But this move does help to lower the mindset hurdle.

Hopefully, more and more people will see the merits of using 3D printing to produce spare parts. The savings in storage space is obvious. But beyond that, it also helps to reduce the number of types of spares that one needs to keep on hand, and the turn-around time; the logistics implication is huge. There is a possibility here, an opportunity waiting to be explored. Let us move beyond the confines of traditional mindsets to see things at a different level.