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.

Saturday, February 16, 2019

Palpatine and Trump, declaring emergencies

I really think Trump is a Star Wars fan.

Palpatine created a crisis by forming the separatists, then used this crisis made by him to gain emergency powers. Which eventually led to him usurping power for himself, and declaring himself emperor.

Trump created the rhetoric of a crisis at the border, and has now used this "crisis" created by him to declare an emergency to give him emergency powers. If we follow the movie script, this is going to end with him declaring himself emperor... 😅

Thursday, January 10, 2019

Update 1 on ESP32 3D printer control board

An update on the ESP32-based 3D printer control board I have been working on.

After getting everything soldered, I gave it a try. Connected it to a 12V power supply, with stepper drivers in place, a hotend and thermistor too.

And nearly started a fire.

Due to my own stupid oversight, the inductor on the board is too small. The rated current was not high enough to handle what the LM2596 needs. This resulted in the LM2596 not functioning as it should, giving an output voltage that is way too high. The 74HCT02 was also not functioning as planned, resulting in the MOSFET gates always on, and you can imagine the amount of current flowing into the hotend... I think this has to do with my understanding of how the 74HCT02 works. I am going to replace it with a 74HC126, which is more straightforward.

Will be changing the design to use a bigger inductor, and then check if it works, and changing to use a 74HC126. If this combination still does not work, then it may be time to use a proper MOSFET driver like the TPS2812.

Comments can be given here, or on GitHub.
GitHub repo.

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

Tuesday, January 08, 2019

SMD reflow soldering with a frying pan

So I mentioned I was working on a 3D printer control board based on the ESP32.

I managed to solder this today. Using a frying pan for the SMD parts.

This is the same board, with through-hole parts hand-soldered.

But this post is more about the frying pan reflow method.

It was quite simple, actually.
1. Put solder paste onto the pads (I had a stencil).
2. Spend a few hours placing the SMD components onto the board.
3. Put the board on a frying pan.
4. Put pan on the stove.
5. Fire up the stove.
6. Use an infrared thermometer (like this one or this one) to check the temperature of the board. Once the board reaches about 200+ degrees Celsius, the solder paste should start to turn silvery. When that happens, turn down the heat a bit, to the minimum needed to maintain temperature.
7. Keep at this temperature (around 240 degrees Celsius) for about 30 seconds. That should be enough to ensure all parts are properly soldered.
8. Turn off the stove.

The important thing is to check the results. I had a bit of cross connection on the USB connector, where the TX and RX pins were joined by solder. So I used a hot gun to do a bit of rework, and now it works perfectly.

The next step is to test the board with an actual printer!

For those interested, this board is v0.6 of the MRR ESP 3DP board.

Friday, January 04, 2019

A.I. Thinker's ESP32-CAM module

I have always been interested in small wireless devices capable of streaming video, and had been trying to get the ESP32 to work with a camera module (OV7670) for quite a while with little luck. Then came the M5Stack camera module, which is an ESP32 module with an OV2640, and it works quite well. Except the ESP32 is a WROOM32, so it does not have PSRAM, and video processing is thus a bit slow. Code to get it working is here.

Then A.I. Thinker came up with a module that packs an ESP32, OV2640, and PSRAM. And guess what, it works! There is even an example in the official Espressif ESP32 Arduino core that supports this module.
To flash this module, you will need a USB to serial adapter, something like this. Connect 3.3V to 3.3V, GND to GND, TX on the adapter to RX (IO3) on the module, and RX on the adapter to TX (IO1) on the module. Then connect IO0 and IO2 to GND, and you are in flash mode. Use Arduino to flash the example (select baud rate as 115200; I had issues trying to flash at higher speeds), then remove IO0 from GND, press the RST button on the module, and you should be running the camera web server. If you open a terminal before pressing the RST button, you should see the ESP32 boot messages, plus a line that tells you what is the IP address of the camera. Oh, do remember to edit the sketch first with your SSID and password.

Resolution-wise, 400x225 works great, 640x480 was still okay. Anything larger was a bit laggy, but I have tried 1600x1200 and it was still working.

Specifications in English
Specifications in Chinese (A.I. Thinker website)

BTW, M5Stack has also came up with a PSRAM version of their camera module. It is called M5Camera. From what I gather, it uses a WROVER (which comes with PSRAM inside) instead of an external PSRAM chip.M5Stack's official code for it is here. The official Espressif example also supports the M5Camera.

Espressif's camera library/example.

My thoughts on artificial intelligence development in 2019

AI is all the hype now, and will probably continue to remain in the spotlight for years to come. 2019 is no exception. So what are the issues we need to be thinking about?

Well, imitation learning is making headway, with computers now able to learn how to move by looking at videos of humans making the same movements. Deep learning has always been good at imitation; AI is very much about computers trying to imitate humans in the first place. The next step in imitation learning is likely to be the inculcation of human values. Computers learn from data, and data is value-neutral; there is no "right" and "wrong", no "good" or "bad". But if AI is to be useful in the real world, it must be able to understand human values, and learn what we humans perceive as good and bad, right and wrong. Then, it must be able to apply these values in the same way that humans would.

A classic problem, and a very practical one, is how a car, autonomously driven, should react when it is in a situation where there is danger to human life. When it has to choose between endangering its occupants versus endangering the lives of those around it. When a human driver is faced with the same situation, he or she will make a split second decision based on values, experience, and past training. AI would have past training, and probably experience, but values are something that is still being pondered over. Coupled with the varying values that human beings have, what are those universal values, if they even exist, that should be incorporated into AI? How do we get computers to reflect these values in their actions? Should we allow users to customize values to suit the users, or are these values set by the companies who develop these products? And who is ultimately responsible for the actions of AI, and why?

Another interesting idea I have is about machine translation. As a translator with an interest in AI, development in machine translation is a double-edged sword. I want to see AI develop to a stage where it can do proper translations, but that would mean a drop in my own income. Still, I think the current challenges for machine translation are:
1. Machine learning of languages. Maybe we should split this learning up, into how we humans learn. We learn vocabulary, so maybe AI should have a portion set aside for machine learning using bilingual dictionaries. We then move on to sentences, and then entire paragraphs for context. So maybe, machine learning for machine translation should have a three-stage algo: vocabulary, sentence formation, context.
2. Bilingual texts. We know the Bible is widely used for machine learning in machine translation, because it is one of the few texts which is available in various languages. Still, the Bible is not the full scope of human experiences, and its context and vocabulary may be somewhat dated. The challenge, then, is how to take existing books that we have which are available in more than one language, and convert these into usable training texts, in an automated way. This requires natural language processing with text/sentence matching. This is not actually machine translation, but is part of the development essential for machine translation.

Lastly, I would like to see the current trend in applying AI to social good continue. We know that AI is not the magic cure, but still, its scope of application is getting wider by the day. What are the types of social issues which AI can be most effective in solving? How do we adapt AI to solve those issues? It may be time to take stock of this. While this is not a technical development, but findings in this area will help to shape the focus of technical development in AI.

Looking forward to a wonderful year of AI development in 2019!

Friday, December 28, 2018

Japan shared video of P-1 supposedly lit up by South Korean warship's fire control radar

Regarding the incident of an ROK naval vessel directing its fire-control radar at an MSDF patrol aircraft

Something new... I believe this is Japan's first use of social media to try and influence international opinion to be on its side.

BTW, 971 might not have replied on 121.5 MHz because she might not have been guarding on that frequency as she was not operating aircraft. And while the P-1 was well clear of 971... flying so near a warship is still poor manners. Observing minimum safety distances doesn't necessarily mean it is diplomatically sound.

And when the next Chinese aircraft flies this close to a JMSDF ship next time... very hard for Japan to complain with this video plain out in the open for everyone to see.

Thursday, December 27, 2018

Fast PCB prototyping

I am currently working on a 3D printer control board based on the ESP32.

Github: MRR_ESP_3DP

So I sent v0.6 of the board to JLCPCB, a PCB manufacturer in China, to take advantage of their special offer: USD2.00 for 10 pieces of PCB, as long as the PCB measures 100mm by 100mm or less. Really cheap, considering that most other Chinese manufacturers would charge at least USD5.00 for something similar.

I placed the order on 19 December, and received the product on 26 December! Wow! One week! And I choose the cheapest delivery option (S.F. Express).

The board was  designed using EasyEDA, which allows you to choose parts from LCSC (a Chinese components seller). And LCSC allows you to combine shipping with JLCPCB, which means that when I order those components from LCSC, they were also delivered together with the PCBs.

Now, the only thing left is to wait... because while most of the components are here, I am still waiting for my MOSFETs, bought on Aliexpress, to arrive. And those are taking the slow route here.

Anyway, for those who are interested, you can leave me your comments about the board here or in the comments section for this post.