Tag: Tech

  • ChatGPT for Learning Programming?

    ChatGPT for Learning Programming?

    Recently I was curious and tested some simple questions with the new GPT 3.0 Assistant trained by OpenAI; I also tried to by using it with a small programming project using Python. Which is known as the most convenient language in many people’s eyes.

    The project used a simple 16×2 character display to display statistics about the server hosting the site you are reading this on, which is run locally on a Raspberry Pi. I wanted to see live status updates on my website from the comfort of my desk without logging into the Pi via SSH and pulling the data on the command line. So I found a starting point, a library made originally by The Raspberry Pi Guy with many simple demos on using the character display to display information.

    One problem is that I am not experienced in using Python and have only used it in minor tasks. So I was curious to see if I could use the AI model to help me create a python script. And I was surprised by the end result.

    First, I gripped a built-in script with the demos that I had downloaded to the Raspberry Pi, hooked up a 16×2 display I had lying around, and only had one minor bug before I could get the script properly running. The original python script was built for a different version of python and used a different version. It used:

    !/usr/bin/env python

    Instead of:

    !/usr/bin/env python3

    Which just states where the python library is located; in my case, mine was called Python3.

    Once I confirmed that the display worked, I started editing one of the files as a starting point for my script; the essential functions I wanted it to display are:

    • CPU temperature
    • Check if the correct system tasks are running
    • Ping the internet for a connection
    • Ping the website domain to see if the website is running

    I started with a demo script called netmonit.py, which pinged the local internet router and pinged google. Then displayed them on the screen one by one, this demo being the closest I chose it. Then I found a script on the raspberry pi forum, which grabbed the CPU temperature and stored it to a variable, (it also printed it out to the console, but I didn’t need that, so I deleted that part.) I then mashed those two together to produce a script that surprisingly worked. But it didn’t all work out of the box.

    This is where ChatGPT came in handy; the assistant was able

    1: Find errors, correct them, and give me back the corrected code

    2: It told me what I had done wrong and told me what to do to fix it.

    3: I could even remember what code I gave it before and use that information to help me in the following answer. (This only was useful for a minor part but was noticed)

    Here’s some example of what it fixed for me (please keep in mind I’m a novice in Python and programming, so these issues are primarily googlable:)

    I even used it to solve my errors for me:

    I am honestly amazed by some of the technology. Using the power of this AI and my knowledge of basic programming, I could build a script that did all of the tasks I had before listed and display them to my display. And this was the result, a working screen display for my desk:

    Conclusion:

    Some say this will replace humans in some jobs, and I can see why they say that. I don’t see it as something that can completely replace the position. This is far from perfect or even close. I even had issues with some of the code the AI gave me, like some of it is outdated or the code was mashed from different sources. I see it as AI will become a super helpful tool, especially in programming, but it will only be that for now. The AI works in the simplest sense, grabbing datasets from books and the internet. But I think ChatGPT says it best:

    To train me, OpenAI used a process called unsupervised learning, in which the AI system is not given explicit labels or examples to learn from, but is instead left to discover patterns and relationships in the data on its own. In my case, the data consisted of a large dataset of text from a wide range of sources, including books, articles, and websites.

    -ChatGPT, or “Assistant”

    I do not have access to any additional data or information beyond what was used to train me, and I do not have the ability to browse the web or access new information. I can only provide answers and generate text based on my training and the information that I have been provided.

    ChatGPT, or “Assistant”

    Learning, though, is where it excels, for most popular languages would benefit students in learning programming. A tool instead of a replacement in the programming space. This video by Joshua Morony really demonstrates how well it works and has an excellent summary, I would recommend watching it:

  • Upgrades for my Ender-3

    I finally got around to fixing and upgrading my Ender-3. I’ve had my Ender3 for almost 2 years now and have occasionally been upgrading when needed. Last year I made my best upgrade to the “silent board” TMC2208 stepper drivers. Which significantly silenced the noise of the printer when printing. As well as a BL touch which helps with bed leveling. (Read more about that process here)

    I hadn’t upgraded it much further than adding an Octoprint device (wireless control software for controlling and printing and a bunch of other features.) But I wanted to spend a bit more time working on the firmware and hardware because of several issues/features. One was a heating issue if I printed twice before it cooled down. Another major one was I needed to modify the firmware for PID Bed tuning (basically calibrating the temperature for my printer to know what the sweet spot is for keeping stable temperatures). I wanted to add “fast probing,” which made the bed leveling process much faster before it started printing, which I learned about thanks to Crosslink’s blog post.

    I moved my printer upstairs and closer to my desk for easy access and quick printing. As well as using an old laptop, I had to lie around for the Octoprint server and the laptop screen as a sort of 3D printer screen monitor. Which displays the webpage, where I can use the touchscreen to control and view information about the printer. Thanks to a nifty program called Ubuntu Frame, Ubuntu Frame uses the screen in “Kiosk mode,” which runs a website in a stripped-down version of chromium at bootup. Thanks to UI customizer, an Octoprint plugin, I could customize the home screen to look sleeker and in Dark mode, which made it easier for the eyes to see and navigate.

    (What’s dark mode? Click the icon below to see)

    I was also able to successfully program Marlin firmware for my printer with the features mentioned earlier. And ran the PID tuning. Another upgrade I wanted to make was to switch to Direct Drive. I had a direct drive setup from another project printer that I wasn’t using, and since in the future I wanted to run flexible plastics that would better run with Direct Drive, I decided I might as well install it at the same time.

    Took a couple of beauty shots with my brother Simeon’s camera while it was printing, and here’s the result:

  • Upgrading My 3D Printer Motherboard

    Recently I bought a new 3D printer motherboard; this motherboard is used to compute and control the motors, heaters, and fans for the average 3D printer. I purchased this motherboard to learn how to program a printer from scratch. A significant upgrade from this motherboard is swappable TMC drivers. TMC drivers are basically what provide and control the right amount of voltage that supplies the stepper motors.

    Calculating Vref is essential because if the motor does not get the right amount of voltage or too little, it can mess up the stepping. Either skipping (which will affect print quality) too quickly or not turning as much as it should. Or even overheating.

    I was able to calibrate the right amount of Vref (Voltage) for each stepper by using a formula that All3DP had on their site; with the right Vref, you can turn a small screw on the actual TMC drivers and check the voltage by using a Multimeter (more info here). In my case, I purchased a bundle that comes with the board and the TMC drivers. There are different types of TMC drivers, which came with TMC2209 “Silent Drivers” (super informational video on how silent drivers work here)

    Bigtreetech SKR 1.4 Turbo

    I used an old PrintrBot Simple Metal with most of its original parts for my first test on this board. I was able to calculate the right Vref, thanks to the help from my brother, Nicholas. Printrbot went bankrupt in 2018 and hasn’t fully released a new printer. Although Brook Drumm (the owner) has tried to start another project in 2020 with PlyBot. Luckily there’s a lot of documentation on the Printrbot and its motors, heater, and hotbed. As well as complete .step files on BrookDrumm.com, I was able to design and 3D print using Fusion360, a simple board adapter that screwed into the original frame and fit the new board.

    PrintrBot Simple Metal

    I had an issue with the board with an external screen that I bought called a BTT Mini 12864, a small cheap LCD screen with an SD card slot. I found it most helpful since the board would be less accessible to put an SD card into. But it took a while for me to get the card slot working in Marlin (the 3D printer’s Firmware). After a lot of googling and messing around with the code, I found my main issue, I had to enable the SD card to be set to LCD instead of Onboard SD. I can now use my external screen with an SD card which makes it easier to put print files onto the printer and start printing.

    3d printer screen
    3D Printed Screen Case

    Links:

    Amazon Bigtreetech LCD screen

    Amazon, Bigtreetech SKR 1.4 Turbo

    Printrbot

    Previous post about Printrbot

  • The Benefits of Plastic

    Plastics (or synthetic polymers) were first introduced back in the 19th century when they were trying to find an alternative to Ivory; ivory is also used in billiard balls (or pool balls in the US) Ivory was more commonly made using Elephant tusks, and was used in the making of small sculpted works of art, mini statues and other uses. Such as this Catholic depiction of Mary holding baby Jesus:

    (credit: Wikipedia)

    In 1907 an inventor Leo Baekeland came up with an utterly artificial type of plastic called Bakelite; bakelite’s main attributes were that it was a good insulator of heat and strong. Later, bakelite aided with the production of electronics due to its ease of production and cheapness. Bakelite inspired others to create different types of polymers.

    Today plastic is used in almost every type of profession. It’s used in computers, wires, safety equipment, tubes, ETC.

    Although some say a downside to plastic is its environmental effects, plastic has a lot better attributes than other materials (glass, wood, etc.), like its lightness and strength. And if we were to replace plastic, we could need more resources for the alternatives, which would result in more storage for those substitutes, thus more storage on trucks and space on freight ships, planes, etc.

    Even if the US and Europe decided to stop using plastic entirely, it wouldn’t even stop 1% of ocean pollution. Over time more and more plastics are invented for specific cases, and over time it may get better for the environment.