Search This Blog

Thursday, July 4, 2024

I Just Cannot Trash Bin a 3d Printer

My Anycubic i3 Mega 3d printer cost nothing.  One of my son's friends was about to throw it in the trash, but my son suspected that I'd want the unit.  Maybe I could revive it, or at least scavenge parts from it.

Anycubic 3d printer

After rummaging through the parts collection that I was given, I finally had a nearly functioning Anycubic 3d printer.  It needed stepper drivers as they were missing for some reason.  Looking back, I really wish that I'd bought TMC2130 drivers instead of A4988 drivers.  The TMC drivers in my Creality Ender 3 Pro are much quieter than the A4988 drivers in my Anycubic.

At last, a fully functioning 3d printer brought back from the dead!  However, the print quality was terrible.  Layer lines were inconsistent.  There were droops when doing short bridges,  Then again, the issues seemed to be connected to cooling and the Z axis.

I adjusted the belts and replaced the linear bearings, a bit of a try-it-all approach.  X and Y improved with layer lines stacked straight on top of each other as they should have been.  The inconsistent layer lines thickness issue persisted.  The differences were tiny, but noticable.

I had not replaced the Z axis linear bearings because they were more expensive than typical linear bearings.  That's when I noticed that the ends of the X axis were tweaked inward as if the belt was drawing the two outer boxes together at an angle.


After completely disassembling the X axis and replacing the linear bearings, I reassembled it without the belt and lined the outer boxes up perfectly and added the belt and adjusted it.  Everything seemed fine but Z axis resistance seemed inconsistent.  I moved the Z axis by hand through full range and found that the Z axis lead screws wobbled which seemed to vary movement resistance.

I created a pair of Z axis lead screw bearing holders and installed them.  First, The Z axis coupling was fully loosened to let each rod go to its natural position.  The Z axis was moved through full range to detect any binding.  There was no binding; so, I tightened the couplings and verified again, by hand, that there was no binding.  Perfect!

At last the old Anycubic that was headed for the trash was functioning correctly.  Now, what to do with it?


First, I had to support the drooping cables with a retracting key fob.  Uncle Jesse mentioned using these in one of his videos long ago.  After adding a strong magnet to the retractor, I attached it to the cable and it worked well.


Next, the spool holder had to be addressed.


I found a design for a side mount spool holder on Thingiverse and printed it added it to the unit.

I had a Creality Ender 3 Pro that I really liked and the print quality was good; actually it was a bit better than the Anycubic.  I've always wanted to try Klipper, so why not put Klipper on Anycubic?

Installing the Klipper firmware onto my Anycubic i3 Mega was quite easy.  Just follow the instructions in the Klipper GitHub and connect a Raspberry Pi to the Anycubic and add a Anycubic config file to the Raspberry Pi and that's all there is to it!

I had an old Raspberry Pi 3A and a 5 inch LCD to use for running Klipper.  After creating an enclosure for the Raspberry Pi and LCD, I connected the Raspberry Pi to the Anycubic 3d printer and started it all up.


Klipper gets a lot of attention for speed printing like speed Benchy contests, etc ..., but that's not why I wanted Klipper.  I wanted Klipper because the settings are kept in a simple text file.  Edit a setting without recompiling and reinstalling firmware and you'll never want to go back to the old way of doing things.  

Opening VSCode and using PlatformIO and editing a C header file, compiling, placing the bin file on an SD card, rebooting and waiting to see if everything worked is a pain compared to just editing a config file.  Besides, if you make a mistake in your config file and save it, Klipper will let you know where you goofed; so, just go back to the config file and undo the changes.  The Klipper GitHub even has an Anycubic config file, so you can just use that if you make a huge mistake in editing.




I'm not entirely sold on Klipper.  I like the editing convenience, which is why I installed Klipper.  I like that it makes experimentation easy.  Do you want input shaping?  Slowing down when approaching corners?  More precise acceleration control?  Easy, just add a line in the config file.  No need for lengthy recompiling and anxiously waiting to see how things worked out.


The only thing that I don't like about Klipper is that it is a separate control part of the 3d printer.  However, it is nice to be able to directly send prints to the Anycubic using WiFi.  I may even add a camera for remote monitoring prints in progress.  Maybe I should tie in my Raspberry Pi power to the Anycubic so that one switch turns everything on.  It'd feel more cohesive.  Maybe I'll try printing a speed Benchy.  That's what I like most about Klipper, maybe do this or maybe do that is easy compared to using Marlin.



Saturday, June 15, 2024

Easy DIY Tempest Spinner



Tempest Arcade Machine

Tempest is one of my favorite arcade games but I have a problem with Tempest.  If you've ever played the original Tempest arcade machine, you'll remember the weighted spinner.  That spinner allowed for incredible speed and agility, limited only by the player's skills.

I don't have the cash for an original Tempest machine nor the available space. Arcade 1 Up machines are nice but why buy one when I can play Tempest on Retropie?  All I need is a spinner. 

Arcade Spinner


Unfortunately, weighted spinner controllers are rare or expensive these days. Not a joystick nor buttons compare to spinner control.  There are spinners available, such as from Arcade 1 Up.  

Rotary Encoder

Some folks have used such spinners, interfaced to an Arduino or Raspberry Pi, which requires a bit of electronics skill.  I tried it years ago but the spin was stiff and not free like an original Tempest spinner.  This is why some simply resort to using a computer mouse as a compromise.

What if you could disassemble a cheap optical computer mouse and turn it into weighted  arcade spinner control?  I did just that. A cheap optical mouse and a 3d printed enclosure are all that you will need to create your own weighted spinner!

Cheap Mouse

I used a wired mouse for simplicity but you can use a wireless mouse if you wish as long as you don't mind finding a place for the mouse batteries.

For this mouse conversion to work, we need the mouse to sense left and right direction for and infinite distance.  Normally when using a mouse, the mouse reaches the end of the mouse pad or desk surface and that is the end of movement in that direction.  For our mouse to work as a spinner, this limitation must be eliminated.

Instead of using the mouse on a flat surface, we're going to use it on an infinite surface, well infinite in one axis: we'll use a cylinder.  We can roll a cylinder under the mouse sensor for any distance desired simply by rotating the drum surface any number of times desired!

Test Version of DIY Weighted Spinner

My prototype of this idea was a drum attached to a knob for control with a mouse placed over the drum.  I spun the knob, and drum, left and the mouse moved left.  I spun right and the mouse moved right.  It was time to try it out with Retropie running Tempest.

The spinner worked perfectly in Tempest.  I could spin in circles as many times as I wanted and as fast as desired.  However, it looked clunky having a mouse sticking out near my spinner knob.

Cutting mouse PCB

Since I used a wired mouse, which was simple compared to a wireless mouse, the PCB was etched only on one side.  I could cut the mouse PCB down to fit inside a spinner enclosure and just move the wire and switch connections by tracing the PCB traces. The LED sensor lens would be needed too, so I used double-sided tape to secure it to the PCB.

Cut mouse PCB with secured mouse sensor lens

After documenting all of the connections to the mouse IC, I cut the mouse PCB to about half it's original height and moved the connections for the mouse buttons and the mouse thumb wheel.  

Mouse wiring schematic

Note that the mouse thumb wheel needs to be connected properly to the IC or the mouse will not function at all.  I simply connected the thumb wheel, being careful to maintain original polarity, and just let the thumb wheel dangle.  Someday I'll hit glue it down.

I ran out of black PLA 3d printing filament; so I 3d printed the new, smaller enclosure, using white PLA.  I also 3d printed the new drum using white PLA.  The spinner no longer worked!

Cut and rewired mouse PCB

I tested the cut up and rewired mouse with a mouse pad and it worked fine.  Must be the drum.  I painted the drum black and now my spinner works great!  Don't 3d print the drum using white filament.

Adafruit PiGrrl board

I wanted buttons on my spinner control since it would be awkward to spin with one hand while trying to push a fire button on a game controller with the other hand.  I wire the left and right mouse buttons to a PiGRRL button board that I had bought from Adafruit a long time ago.  The buttons did not work.  The mouse stopped working at all!

I soon figured out that the mouse buttons did not share a ground connection.  They were not grounded.  However, the PiGRRL board grounded all buttons to a ground plane.  I cut a rectangle around the grounded pins of each pushbutton to break them loose from connecting to the PCB ground plane.  After doing this, I move the button wires to the newly isolated button connections.  

Completed DIY Tempest Weighted Spinner



I put the spinner enclosure together with the newly painted drum and isolated buttons together and plugged it into my Raspberry Pi and started up Tempest.  For the first time in years, I played Tempest with a spinner control and loved it!  My score was nowhere near what my high score was in Tempest as a youth, but now that I have a spinner controller, that may soon change.

I've uploaded the 3d printable files for this project to Printables and created an easy to follow Instructable for this project if you'd like to create your own.




Friday, November 25, 2022

3D Scan it and 3D Print

 The availability of 3d printing to hobbyists has provided an existing and interesting pastime to hobbyists.  For instance, electronics enthusiasts used to buy electronics enclosures for projects, but the enclosure was always a compromise. There was rarely ever an enclosure available that fit a project perfectly.  It was possible to create such a design, but it required electronics hobbyists to be amateur product designers, and then electronics designers if they wanted a good looking result.


With 3d printing, an electronics hobbyist may design their PCB and then create the enclosure exactly as needed.  However, this requires 3d design skills that are difficult for some to learn.




So, many new 3d printer owners resort to downloading designs from 3d printing repositories but this is a compromise.  It's really no different from buying an electronics enclosure that "kinda" works other than the fact that the download may be edited if you have the skills.  What if there isn't an enclosure available for download that is, "close enough?"

This is where 3d scanning can help, but until lately it has been expensive and unapproachable.  Usually some type of LIDAR based handheld gadget costing thousands of dollars is needed.  There are DIY possibilities, such as using a Microsoft Kinnect to do the scanning, but getting good scanning results can be challenging.

Latest versions of the Apple iPhone make 3d scanning easy as they use in-built LIDAR sensors to effectively replicate a multi-thousand dollar handheld 3d scanner.  Not everyone can afford the latest iPhone and not everyone wants an iPhone but what other  options do you have for an affordable 3d scanner?

Photogrammetry is a 3d scanning technique that uses a collection of photographs to create a 3d representation.  Unlike the traditional portrayal of a 3d scanner, wherein there's a laser line reflecting from an object on a rotatating table, photogrammetry needs no line - no LIDAR, no laser.  

There are photogrammetry based 3d scanning apps available on Android phones.  The better your phone camera resolution, the better your results will be.  However, for best results, you will need to take A LOT of photos.  More photos helps the photogrammetry algorithm create a better representation of your object.

My first 3d scanning attempt was with an Android app called Kiri.  Kiri is free and your scans can be exported individually.  This is an important point since some apps require a monthly subscription to be able to export your scans.  With Kiri, you can export the object that you just scanned in and pay only for that object. 

I also tried an app for Android phones called WIDAR.  The app is nice and unlike Kiri, Widar provides an editing environment on your phone that is impressive. Kiri provides basic transforms like rotation. Widar provides much more - you may not even need to edit your exported scan in another program.

Widar charges $4.99 a month if you want to do exports. There's an option to access your export for free through a generated link, but I was unable to figure out how to get the export from the link.  From what I see  Widar is $4.99 a month if you want to export your scans.  If you plan on doing a lot of scanning and exporting, $4.99 a month may not be a bad deal.

With Kiri, you pay for what you export, well not quite.  Kiri also provides free exports, so, you get so many exports per week for free.  If you need to do an export and you're out of free ones, you can either buy an export, which is very affordable, or earn a free one by referring someone to Kiri.

My first attempt with Kiri was terrible.  I tried scanning in a Hot Wheels Dodge Challenger.  I took 27 photos from all sorts of angles.  Kiri processed the results on their servers, not my phone, and then notified me that my results were ready.  I had scanned a flat multi-colored blob.  The car color was recognizable, but not the shape.

I tried again but this time with 16 inch tall Christmas tree.  It worked!  Fifty photos and I had an exact duplicate of the tree.  However, it's not that simple.

There's a lot of artifacting created by the photogrammetry process; so, you will need to edited your exported 3d scan.  This is intimidating and foreign at first but easy once the process is understood.

You'll need something to edit the STL/OBJ file.  Tinkercad is an obvious choice since it imports STL files and makes editing them easy.  Unfortunately, it is limited to 20000 triangles; so, a large complex scanand provides tools fr editing  will be rejected by Tinkercad.

Meshmixer is often mentioned as an option for editing STL files.  I'm not a fan of it.  It's a bit like using Blender or a sculpting program to do edits.  

Fusion360 will import STL/obj files and provides tools for editing STL files but it takes a bit of getting used to.  Product Design Online is an excellent Youtube channel that can help with learning how to edit STL files.

After your scan has been cleaned up and looks great, you can 3d print it!  Your object can be scaled or changed as you wish and then created on your 3d printer.  Even if you are not adept with 3d editing, you can now scan in an object, change it to your needs, and then 3d print it. 



Monday, January 17, 2022

What's Wrong with Octoprint?


 I started a 3d print running from Octoprint, as I often do, and after 30 minutes of printing, the printer halted.

Octoprint had tried to send messages a number of times and they went unacknowledged.  I didn't have the serial.log enabled, so that was all the information that I got.  I enabled the serial.log and tried 3d printing again.  Thirty minutes later, the Creality Ender 3 Pro halted and there was a notification on Octoprint of too many communications timeouts.

At least this time I had a log file. I scanned the log file and found six failed attempts to communicate.  No other helpful information was in the file.  Now what?

I came across an odd recommendation suggesting that it could be the Ender 3 LCD cable position causing communications issues.   I moved the cable and tried 3d printing again.  A 2 hour print ran successfully!  Problem solved!  Not quite.

My next 3d print, 3.5 hours long, failed after 2.5 hours.  Same issue, too many failed communications attempts.  

I tried a new USB cable. I tried using a different microUSB card.  I tried using a different USB port on the Raspberry Pi 4 running Octoprint.  I tried uninstalling and reinstalling the serial port driver.  I tried a whole new install of Octoprint.

It must be the Raspberry Pi 4, it does run a bit warm.  Nope, it wasn't the Raspberry Pi 4.  That left only the Creality Ender 3 Pro as the culprit.

I checked wire connections and especially ground connections on my Ender 3 Pro.  I even considered making my own noise shielding with aluminum foil wrapped around the LCD cable and grounded but fortunately, I tried something on a whim first.

I removed the 3d printed plastic cover for the back of the LCD that I'd 3d printed 2.5 years ago.  

As I began to remove the screws that held the cover to the back of the LCD, I noticed that one screw was very loose and the other three srews were not much better.  Oh well, cover removed and LCD screws tightened down, I ran a 7 hour 3d print.  Because I was tired of wasting filament, I ran the Ender 3 Pro dry.  No filament.  I used the same settings as always but I wasn't wasting any more plastic.

It worked!

I examined the back of the LCD a little more closely and realized that the LCD ground connection to the frame was dependent on those 4 mounting screws. Loose screws could jiggle and create a ground make/break cycle that could worsen with vibration. 

I got rid of that LCD back cover.  I may find or make another one that doesn't use the LCD PCB screws for mounting.  Then again, maybe not.

If you're having communications trouble with Octoprint to your 3d printer, always check every single ground connection and path.  It never occurred to me that grounding to the LCD could affect serial communications, but only because I haven't looked at that area of the printer for over 2 years.



Saturday, October 9, 2021

My First Magnetic Tensegrity Table

Google defines tensegrity as:

"the characteristic property of a stable three-dimensional structure consisting of members under tension that are contiguous and members under compression that are not."

Sometimes it's just easier to see it than read about it so here is a photo of a popular tensegrity toy. 

A tensegrity table uses the same principles to hold two flat surfaces locked at a fixed distance from each other using only strings or some other flexible strand such as ball chain.  Some tensegrity designs are fascinating to look at as the top surface looks like it's floating in mid-air. 

I wanted something a little different.  I wanted a table surface to magnetically levitate using tensegrity principles.  How hard could it be?  Replace the strings with supermagnets and that's it right?

I started by printing a few simple surfaces to retain the flat disc neodymium magnnets that I had purchased and decided to use the attractive force but use it along the outside edges with a tensioned string in the center to tension the structure.  The attractive distance of the magnets was not as great as I expected.  The two surfaces could be no more than an inch (2.54cm) or so apart for this to work.  That would leave almost no room for the tension structure needed in the center.


So I used magnetic attraction for the center string and three fishing lines around the outside edge. It finally worked!  
I created the design to be very sturdy but to look almost wireframe. The wireframe look appeals to me as it's similar to looking at a bridge structure. 

One of the problems with working with neodymium magnets is that they are powerful.  My first attempt at this circular table used  a single arm of less than 10mm width to support each magnet.  The support arms were bent by the magnets!  Too close, and the magnets snapped together.  Too far, and there was no tension.

I like the overhead view of the structure because it reminds me of a dart board or maybe a "pop" filer that would be used on a microphone in the 1940's.
Unfortunately, I did not align the two solid magnet supports so that there was a straight on view without one of the structures overlapping. 
As a result, when someone first looks at it they assume the center is how the table is supported.  It isn't until they look more closely that they see that the bottom and top half are connected only by strings. Finally they realize that the neomagnets are keeping the table together and then they begin testing the table.

First, they always push down on it to see how strong it is and they're usually a bit surprised. After collapsing the table, they pick it up and the neomagnets snap the table back into shape.The last thing people often do is try to spin the top to see how far it'll turn.  They're sometimes a little surprised that it won't turn very far but mesmerized by the jiggling of the table as it snaps back to original position.

I think the tensegrity table looks much better after changing the hole alignments and printing a table section with better alignment.
I will be continuing to investigate other ways to use magnets in tensegrity structures.  Download the STL and 3d print your own at Printables.com. 


Tuesday, September 14, 2021

HDTV Antenna Hack

 

Mohu Leaf antennas are popular for their small size, reception, and ease of mounting, but what do you do about TV stations that are too far away?

Typically, that means that a bigger antenna is needed.  Sometimes a TV channel has great reception and yet other times, you try shifting the antenna a little bit or even moving the coax cable.  Maybe a new antenna would give better reception, but that can be a gamble since not all antennas provide the same performance.

You may remember the days when "rabbit ears" were on top of TVs or seen old photos of TVs with rabbit ear antennas.  Sometimes folks would put a little aluminum foil on the antenna to improve reception.

Well, you can do something similar with a Mohu Leaf antenna to improve reception but instead of attaching aluminum foil to the antenna, you make a reflector.

I scrounged around and found a piece of compressed cardboard that was just a little larger than my antenna. Corrugated plastic, or presentation board would also work since it just needs to be stiff.

I had a metal template for spreading solder paste that was no longer needed that was  just the right size.  My metal sheet was four inches wider than the antenna and close to the same height.  I centered the antenna on the metal and bent each side of the metal to a 45 degree angle or so.  

If you don't happen to have an unused metal soldering template laying around then you can use any thin metal, even heavy duty aluminum foil will work. If you use window screen material, make sure that it is actually metal. Do not use chicken wire since the large spaces offer less reflection area.  

After bending the metal, I used double-stick tape to secure the metal to the cardboard.  Next, I punched two screw holes through the metal and cardboard that aligned with the two holes on the antenna.  I guessed on the location of the third and fourth hole and just made sure that the would be under the opposite edge of the antenna.

The most important part of this antenna modification is the distance from the reflector to the antenna.  Two inches provided the best results for me.  Depending on the channels that are weakest in your area, you may want to adjust the distance slightly.  More distance will improve reception for lower frequencies while shorter distance will improve reception for higher frequencies.

I 3d printed two inch standoffs but you could just as easily use wooden dowel or other non-metal materials. For the area of the antenna with no screw holes, I created a standoff with a lip to hold the edge of the antenna.  Although it may be tempting, do not pierce the antenna!

This is the final result.  I put a sawtooth picture hanger through the cardboard to make it easy to hang the unit.  My final cost was zero since I used scraps that I already had.

So the real question is performance. Even if the mod was free, it's useless if there's no increase in performance.

I used a TiVo OTA unit to check the difference in antenna performance.  It's not scientific or even in decibels, but it will display antenna signal percentage, which we can compare. 

The weakest channel that I could receive measured 35% before the reflector and 60% after the reflector.  I can now reliably receive that channel without screen garbling randomly.

Every other channel showed an increase of at least 15% with the stronger channels increasing by 25%.  I used to loose some channels at night as their signal was weaker at night, but that is no longer an issue.

Even if you have to buy everything, it should be possible to make this reflector and improve your reception for only a few dollars.


Wednesday, September 1, 2021

Play the MacGyver theme when your 3d print ends


If you have owned a 3d printer for a while then you've probably already added code to beep the 3d printers speaker to notify you that your print has completed.  Otherwise, your stuck occasionally checking the print progress, which can become tiresome.

Why not play a favorite tune when your 3d print has completed?  Maybe a fanfare? Celebration?  "Flight of the Valkyries?"

With the tool at the following link, you can convert a midi file directly to GCODE that will output tones on your 3d printers speaker:  Midi to M300

The M300 GCODE command is used by 3d printers running Marlin firmware to generate sounds, tones.  Many 3d printers use the Marlin codebase so if your 3d printer has a speaker then you should be able to generate music.

The music will not sound like music from your smartphone might sound.  It actually sounds more like a Commodore VIC-20 could be playing the music but it is recognizable and guaranteed to arose curiosity from those not expecting it.

You can of course generate your own midi files like Lazy Game Reviewer (LGR) might, but there are also numerous midi songs available on the Internet.

Since I'm no musician but still am a fan of the original MacGyver show, I found the theme song in midi form and ran it through Midi to M300 and tried it on my printer.

It sounded terrible!

So I went back to Midi to M300 and unchecked boxes for some instruments and channels and tried again.  I had to repeat this several times before I got something that sounded good to my ears.  However, it was too lengthy.  I didn't need to hear the entire MacGyver theme at the end of a print, just enough to be recognizable and get my attention.

So I started trimming M300 lines from the generated code.  The final result has been shorted to around 30 seconds of time and contains the most recognizable parts of the tune.

If you'd like to just try this out on your 3d printer then install a copy of Pronterface and connect to your 3d printers USB port.  Some Creality printers now use the CH340 serial USB driver so you may need to install it to get Pronterface working with your printer - it does not autoinstall on Win10.

Copy the GCODE for the MacGyver theme below and save it using Notepad as a text file.  Change the extension of the file to MacGyver.GCODE.  After Pronterface is connected to your printer, Load the MacGyver.GCODE file in Pronterface.

Now press the Print button in Pronterface and your 3d printer should play the MacGyver theme.  If it is unsuccessful, and your certain that Printer face is connected, double check the MacGyver.GCODE file that you saved and make sure that it only contains the M300 GCODE lines shown below and nothing else.

To play the MacGyver theme at the end of a print, open up your printer configuration in Cura slicer and go to the "End G-code" under the Machine Settings for your printer and paste the following GCODE:

M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P104 S523
M300 P104 S0
M300 P208 S494
M300 P208 S392
M300 P208 S196
M300 P208 S392
M300 P208 S370
M300 P208 S440
M300 P208 S196
M300 P208 S392
M300 P208 S392
M300 P208 S392
M300 P208 S196
M300 P208 S392
M300 P208 S523
M300 P208 S523
M300 P208 S196
M300 P208 S494
M300 P208 S196
M300 P208 S523
M300 P208 S494
M300 P208 S440
M300 P208 S392
M300 P208 S330
M300 P208 S659
M300 P208 S330
M300 P208 S440
M300 P208 S262
M300 P208 S131
M300 P208 S262
M300 P208 S523
M300 P208 S523
M300 P208 S147
M300 P208 S494
M300 P208 S196
M300 P208 S392
M300 P208 S196
M300 P208 S392
M300 P208 S370
M300 P208 S440
M300 P208 S196
M300 P208 S392
M300 P208 S196
M300 P208 S392
M300 P208 S196
M300 P208 S392
M300 P208 S523
M300 P208 S523
M300 P208 S196
M300 P208 S494
M300 P208 S196
M300 P208 S523
M300 P208 S494
M300 P208 S440
M300 P208 S392
M300 P208 S330
M300 P208 S659
M300 P208 S330
M300 P208 S440
M300 P208 S262
M300 P208 S131
M300 P208 S262
M300 P208 S494
M300 P208 S247
M300 P208 S123
M300 P208 S247
M300 P208 S523
M300 P208 S494
M300 P208 S440
M300 P208 S523
M300 P208 S185
M300 P208 S494
M300 P208 S440
M300 P208 S587
M300 P208 S123
M300 P208 S523
M300 P208 S494
M300 P208 S587
M300 P208 S123
M300 P208 S523
M300 P208 S494
M300 P208 S659
M300 P208 S131
M300 P208 S587
M300 P208 S659
M300 P208 S740
M300 P208 S185
M300 P208 S494
M300 P208 S123
M300 P208 S784
M300 P208 S165
M300 P208 S330
M300 P208 S740
M300 P208 S311
M300 P208 S698
M300 P208 S294
M300 P208 S494
M300 P208 S392
M300 P208 S784
M300 P208 S659
M300 P208 S494
M300 P208 S740
M300 P208 S587
M300 P208 S440
M300 P208 S659
M300 P208 S523
M300 P208 S392
M300 P208 S587
M300 P208 S494
M300 P208 S392
M300 P208 S523
M300 P208 S330
M300 P208 S494
M300 P208 S294
M300 P208 S523
M300 P208 S494
M300 P208 S440
M300 P208 S392
M300 P417 S466
M300 P417 S440
M300 P208 S784
M300 P208 S392
M300 P208 S587
M300 P208 S392
M300 P208 S622
M300 P208 S311
M300 P208 S466
M300 P208 S440
M300 P208 S392
M300 P208 S196
M300 P208 S294
M300 P208 S196
M300 P208 S311
M300 P208 S196
M300 P208 S233
M300 P208 S220
M300 P208 S587
M300 P208 S587
M300 P208 S587
M300 P208 S587
M300 P208 S587
M300 P208 S587
M300 P208 S587

Wednesday, August 25, 2021

Make your 3d printer play music - "How It's Made"


 I found a midi file of the intro music from the TV show, "How It's Made" and found an online midi to GCODE converter.  Perfect!  

If you want your 3d printer to start playing the "How It's Made" tune through the printers speaker when starting a print then add this GCODE to the end of your printers start code:

;How its Made tune  

M300 P103 S123
M300 P635 S0
M300 P117 S123
M300 P337 S0
M300 P137 S123
M300 P190 S0
M300 P107 S123
M300 P249 S0
M300 P166 S110
M300 P1724 S0
M300 P93 S156
M300 P620 S0
M300 P93 S156
M300 P347 S0
M300 P156 S156
M300 P200 S0
M300 P117 S156
M300 P234 S0
M300 P107 S165
M300 P1299 S0
M300 P464 S185
M300 P5 S311
M300 P103 S123
M300 P371 S0
M300 P210 S311
M300 P34 S0
M300 P20 S370
M300 P117 S123
M300 P293 S0
M300 P44 S277
M300 P137 S123
M300 P190 S0
M300 P127 S123
M300 P200 S311
M300 P29 S0
M300 P166 S110
M300 P68 S0
M300 P132 S311
M300 P337 S0
M300 P117 S311
M300 P117 S0
M300 P117 S370
M300 P352 S0
M300 P176 S277
M300 P288 S0
M300 P20 S311
M300 P93 S156
M300 P366 S0
M300 P210 S311
M300 P34 S0
M300 P10 S370
M300 P93 S156
M300 P327 S0
M300 P20 S277
M300 P156 S156
M300 P200 S0
M300 P122 S156
M300 P200 S311
M300 P29 S0
M300 P107 S165
M300 P127 S0
M300 P132 S311
M300 P337 S0
M300 P117 S311
M300 P117 S0
M300 P117 S370
M300 P352 S0
M300 P176 S440
M300 P59 S0
M300 P176 S494
M300 P54 S0
M300 P5 S622
M300 P103 S123
M300 P371 S0
M300 P210 S622
M300 P34 S0
M300 P20 S740
M300 P117 S123
M300 P293 S0
M300 P44 S554
M300 P137 S123
M300 P190 S0
M300 P127 S123
M300 P200 S622
M300 P29 S0
M300 P166 S110
M300 P68 S0
M300 P132 S622
M300 P337 S0
M300 P117 S622
M300 P117 S0
M300 P117 S740
M300 P352 S0
M300 P176 S554
M300 P288 S0
M300 P20 S622
M300 P93 S156
M300 P366 S0
M300 P210 S622
M300 P34 S0
M300 P10 S740
M300 P93 S156
M300 P327 S0
M300 P20 S554
M300 P156 S156
M300 P200 S0
M300 P122 S156
M300 P200 S622
M300 P29 S0
M300 P107 S165
M300 P127 S0
M300 P132 S622
M300 P337 S0
M300 P117 S622
M300 P117 S0
M300 P117 S740
M300 P352 S0
M300 P176 S880
M300 P59 S0
M300 P176 S988

Monday, November 18, 2019

Setting up a new Creality Ender 3 Pro 3d Printer

     I have caught the 3d printing bug.  However, I did not want to spend a lot of money on something right away.  Besides, as my wife says, "I am thrifty."
      I bought the Creality Ender 3 Pro because I had read about the few improvements included in the pro version that were not in the standard version.  First is the magnetic bed, I'm not sure if it justifies the $40 price premium, but the 1 year warranty and support and the improved extruder does justify the price premium for me.
       The first bit of advice that I could offer in setting up the Creality Ender 3 Pro is to first use the foldout manual to identify everything and lay it out and then put the foldout manual away.  It can be followed by a person determined to interpret the images, as I was, or a person ignorant of the build video that comes with the unit on the micro SD card.  Plug in the micro SD card adapter and watch the build video.  It is much easier to follow than the multifold manual.
      After finishing the build I was unable to level the bed. the left side was lower than the right by almost 1/3 of an inch!  I took the bed off to see if the bed frame below was that far off from level.  It was!  Argh!
     So I examined the bed frame closely and concluded that it had to be the X-axis bar carrying the printer head that was not level.  I was correct.
     In my mind, if you have rollers riding a frame and the holes are aligned then the parts must have been created to be square to each other.  This is not true.  BTW, I'm an electronics and IT guy not a mechanical engineer as should be evidenced by that last statement.
     I watched a few setup videos, there's nothing about this issue from Creality BTW, and I learned about the concentric nuts.  Concentric nuts on the Creality Ender 3 printers are used to move specific rollers a range of about +- 1/8 of an inch.  They function similarly to a cam on a camshaft.
     I moved the X-axis to the top and measured each side to check for square.  It was off by 1/3 of an inch.
     I tried adjusting the concentric nuts on each side of the X-axis.  I had to loosen the lock-down nuts a little of course, which I almost forgot to do.  I never did get the X-axis square.  Every adjustment resulted in either the X-axis being loose or much too snug to move. I finally compromised with being 4 mm from square with the assumption that the bed could be levelled to that.
     As I began levelling the bed, I noticed that one corner of the bed was higher than the rest, even completely cranked down.  I examined the bed mounting again and noticed that the spring with the bed connector mount was compressed more than the others.  That bed connector mount compressed the that corner spring about 1/8 of an inch.  No wonder the one corner was higher than the rest and the other 3 corners felt weak and wobbly.
     I added spacers to each of the other 3 bed corners to match the corner with the bed connector mount.  Now I could finally align the bed!  I adjusted each corner to be just 1/2 millimeter from the bed and at last I was ready to print!
     The print for the cat model ran for 5 hours and 43 minutes. The top of his head was cut off just below the ears.  The filament that came with the printer, which is not on a spool, had tangled and had not fed through the printer for the last 10% of the print.
     To make the best of it, I sanded the hole in the top of the cats head and used the resultant container as a toothpick holder.
     I retried the cat model print out after untangling the filament and stringing it out like a telegraph wire - I really did not want to hand my wife another cat with the top of his head cut off.  The print went well and the quality is actually impressive.
     I must admit that I thought that 3d printing was finally ready for the average person because it is so affordable now.  The pre-built models offer less frustration certainly but if anything needs to be replaced or becomes misaligned then it could become frustrating for the non-hobbyist.
     Some day 3d printing will be as easy as using a toaster and as cheap as an inkjet printer and as maintenance free.  It's too bad that we still have years before we reach that point.

Sunday, October 22, 2017

Atari 2600 Pacman on my RetroPi Project

Photo of my latest side project - a RaspberryPi running RetroPie enclosed in an old Atari 2600 Pacman cartridge. 

I modified the cartridge to fit the RaspberryPi and printed a 2600 cartridge label using http://www.labelmaker2600.com.  After laser color printing the label to some Avery label paper, I used packaging tape to laminate the labels - I got the idea from one of "the 8 bit guy" videos.

After cutting and attaching the labels, I turned on the RetroPie and tried out Atari 2600 Pacman - it is worse than I remembered.



I tried out Vice, which is the Commodore emulator, and ran the Vic20 emulator.  I wasn't able to get any cartridges to run, but it was nice to see what felt like my old Vic20 of 37 years ago.

I went back to the Atari emulator and ran Asteroids.  What a load of fun to trek down memory lane!  RetroPie offers emulators for PlayStation, Amiga, and so much more.  I will get to them eventually.

It's nice to be able to play my old Amiga games and PlayStation games again.

Sunday, January 29, 2017

My Least Favorite Computer

When William Shattner started doing Commodore Vic20 commercials, I found that I just had to have a Vic20.  It had nothing to do with Captain Kirk of course, but those comparison commercials wherein the Vic20 features were compared to other computers was very convincing to this 14 year old.
I saved every penny from my paper route and got $350 to buy the "Wonder computer of the 80's".  I got the tape deck unit with the Vic20 and a few books and progs.  Without the tape deck, it would have been little better than a gaming console.
Fast forward through the 80's and my intense love of playing and creating games continued.  The Commodore 64 was purchased by my wife and I and we used it to create college reports.  My first good paying job I got an used Amiga1000.  It was a wonderfully frustrating machine as any changes to it were expensive.  Besides, the IBM PC era for the home had finally arrived. 
We sold the Amiga and bought an Amstrad PC-20.  It was affordable, had EGA video and sound and two floppy drives - no hard drive.  It did not run Windows but included GEM which is similar to the black and white Apple Macintosh OS.
Improving on the machine meant opening the flip top and plugging in ISA PC cards.  There were only 2 slots.  Oh yeah, and the lid did not close after a card was plugged in.
It was a strange PC and we didn't have it long before buying a full IBM PC compatible with memory, VGA graphics, Soundblaster, a CD reader and all.  Overall, I've enjoyed every computer that I've ever owned - except the Amstrad PC-20.

Sunday, December 21, 2014

My Android Apps Privacy Policy

Some Android app repositories have changed their submission process to require a privacy policy.  This post is in response to those requests and to address concerns of some users.

I create Android games and other programs as a hobby.  As a result, I have no interest in collecting personal information and using it.  My interest is in game creation and development.  There is a great deal of responsibility involved in managing personal data.  

I use third-party libraries in my games to provide social interaction.  Google Play Services is currently used in most of my games, and Swarm is still used in at least one older game and thus examination of their respective privacy policies may be beneficial.  

Most of my games have location sensing flags set to support targeted advertising - this is a requirement by many advertisers.   To those that enjoy my software creations, thank you, and rest assured that I do not collect personal data and currently have no use for it.

Thursday, September 25, 2014

Bash Shellshock Vulnerability - What's the threat?

Below is a link on github wherein the Bash Shellshock vulnerability is being discussed:

https://gist.github.com/anonymous/929d622f3b36b00c0be1

For the non-technical, what is being shown by posters is that the now termed Shellshock vulnerability is now being used.  Attempts to use the vulnerability are being captured in log files - particularly note the UserAgent notes in the log files as they illustrate the attempt to use the vulnerability.

What is particularly alarming is just how easily this vulnerability can be used and also what appears to be an attempt in the log files to search for vulnerable machines.  The "grep" command on Linux is an advanced and complex search command that can be used to execute very specific searches.  Note the comments in the link where grep is mentioned.  A list of websites with the vulnerability would be valuable indeed.  However, so would a list that contains any type of machine with the vulnerability. 

This vulnerability affects much more than just websites - MythTV boxes and other entertainment boxes running Linux (Boxee?  TiVo?) could also be affected.  It could even affect security cameras or for that matter any device that has an available Bash shell.

This is a particularly scary vulnerability because of its ease of use and power.  Using the Shellshock vulnerability, it is possible to obtain files that were supposed to be limited to root access.  In other words "Got Root?" isn't a question - it's  an assumption.

Oh and by the way, Mac OSX systems are also affected since they also have Bash available.

Imagine a SCADA running Unix at a steel mill and it is connected to the Internet for customer convenience.  Naturally, there is security in place to prevent anyone except customers from accessing the SCADA webpage data.  However, with the latest Bash vulnerability anyone that can type a simple script can access that SCADA.  Who cares you may ask?  Its just production data.  Why would anyone want it?

The problem, in this case isn't that data may be copied, as in credit card numbers theft.  The problem is what could be done if someone on an outside connection can control that machine?

Of course the attacker would need to be running the actual SCADA software to interact with equipment, or would he?  Could he just directly access the database that the SCADA uses to keep track of and issue equipment commands?  Could he access the database and change the product recipe? 

But who cares about a steel mill right?  Well the issue is that Unix and Linux based SCADA are used in a wide range of industries from power generation, oil production, transportation, semiconductor fabs, and  utilities.  All it takes is one machine connected to another machine connected to the Internet and the scenario depicted above can become very real. 

There's no need to panic - yet unless you happen to be in IT and manage systems that run Unix, Linux, or Mac OSX.  On the other hand,  security research Bruce Schneier is calling the flaw "catastrophic."

If important systems, besides just commerce and finance, do not get patched before a Shellshock worm is released, we could have serious problems that would make the finger vulnerability, the Morris worm, Heartbleed, and the Code Red virus, seem almost innocuous in comparison.

Friday, September 12, 2014

2007 Nissan Sentra accelerates by itself!

On August 22, 2012 I posted about our 2007 Nissan Sentra attempting to accelerate out of control in reverse. We had it checked by Nissan mechanics and they found nothing wrong or in their log. Yep your modern car has a log file in it.

I was even shown that slamming the brakes automatically overrides the accelerator even if your foot is on it. That's a good safety and so I figured if the problem ever resurfaced, we would still be safe - just slam the brakes.

Yesterday, 9/11/14, our 2007 Nissan Sentra accelerated all by itself! It went into runaway mode again but this time in drive!

We were in a McDonalds drive through and had just placed our order. The car was in park. The AC was on but not on Max AC. I put my foot on the brake and shifted to Drive. The car lurched forward but the brake held it. My wife Kelly exclaimed, "what are you doing?" 

This time I was ready except I had no camera or smartphone. Damn!

I said to Kelly, "Look! There it is! Look at my foot, it's not touching the gas at all - just the brake. Look at the tach. It's racing up to 2500 and coming back down. It's in drive." 

Kelly asked, "What do we do?"

I said, "Watch this!" I slammed the brake to the floor as hard as I could. Everything went back to normal. I said, "see that mechanic was right. Just slam it to the floor (the brake)."

"Are we safe," asked Kelly.

I answered, "I guess so. If anything happens we just slam the brakes. Nissan will never find this. It wouldn't do any good to take it in; they couldn't find it the last time."

"You sure we'll be okay", asked Kelly.

"I don't know but I'm putting it online so that it's at least documented somewhere if anything happens. At least we have a brake override to kill it?"

Kelly asked, "do you think Nissan knew about this?"

I answered, I don't know but at least they planned for it. I wonder if they found it in testing and added the override because they couldn't find the bug causing it?"

-- end of story - 

I think it likely has to do with the air conditioning. The engine has to compensate when the air conditioner kicks on or stall. It is likely that the software has an endless loop that occurs when the AC kicks on under just the right circumstances. Or it could be an integrator problem.  When trying to regulate speed electronically, oftentimes a PID loop is used.

PID stands for Proportional Integral Derivative.  To put it simply, an equation would look at the speed command for the engine, see how far off it is which is basically the proportion, and then use integration to consider prior responses and use derivative to offset the integration and proportion.  That is an extremely simplified explanation of PID.  If you understand mathematics pretty well, look up PID equation on Wolfram Alpha to help understand the relationship between the P the I and the D.

The problem that can occur is called integral windup.  What happens is that each new addition to integral becomes progressively larger until derivative is no longer able to offset the integral.  To put it simply, it's like dividing one by zero.  Of course it is undefined but if you instead divide by a number as close to zero as you can possibly get, such as 10 raised to the minus one million, then the result of the equation is enormous.  Just imagine that number being applied to the accelerator of your car!

I used to always include a safety clamp in software for the PID result just in case of integral windup.  Some people frown on such practice and are of the opinion that if the PID loop is setup properly then there's no need for a clamp.  I strongly suspect that the software used in our 2007 Nissan Sentra and in many other cares is the result of such debates and probably lacks and software clamp for the PID loop.

At least Nissan has an override, although scary. I wonder about the other car companies...

Monday, June 2, 2008

Basic Atom Pro Timer Interrupt

While working on obstacle avoidance code for the autonomous mode, it became desirable to have a way to detect the amount of time that has expired. This is especially useful for detecting how long the robot has been stopped and how long it has been walking in a given direction.

Adding a timer interrupt in Basic Atom Pro code is actually quite easy - there is an example in the Basic Atom Pro manual.

The following two commands configure a timer interrupt on the Basic Atom Pro:
ONINTERRUPT TIMERAINT,handle_timerA
TMA= (TMA & 0xF0) 0x4 ;sets timera to increment once every 256 clock cycles

Here is the code that will run each time the interrupt is triggered:
handle_timerA
currenttimerval = currenttimerval + 1
resume

In the code listed above, TIMERAINT is an overflow interrupt and when this interrupt occurs, handle_timerA routine is executed and returned from by the resume command - the routine just counts 256 clock cycle clumps as one interval called currenttimerval.

Here is the code that starts the timer timing:
ENABLE TIMERAINT

Simple stuff. Stopping the timer is just as easy:
DISABLE TIMERAINT

So, we now have an easy to use timer that we just enable to start it ticking and disable to stop it. By the way, there is no explanation in the Basic Atom Pro manual regarding TMA other than a comment in a code listing. For an explanation on TMA, it is necessary to look in the h83664 manual. At first glance, it was a little challenging to understand but as with many things it was just a matter of staring at it long enough until the picture became clear, so to speak. There is also a comprehensive tutorial on the Lynxmotion forums that helped.

It wasn't until I stumbled upon the interrupts tuturial posted by a user in the Lynxmotion forums at http://www.lynxmotion.net/viewtopic.php?t=3496 that I found a caveat about using interrupts on the Basic Atom Pro. It seems that serout commands on the Basic Atom Pro are not always reliable when using interrupts. I confirmed this to be true after watching the Midnight Prowlerbot spasm and twitch in a random fit instead of walking as programmed. At first, I thought that maybe I had done something wrong in my code. After putting DISABLE TIMERAINT before every serout command and ENABLE TIMERAINT after each serout command, I found that everything worked fine. The robot walked as expected. The timer worked.

Unfortunately, enabling and disabling the timer interrupt before each serout command really affects accuracy of the timing. For instance, if the robot is instructed to perform a command that isn't executed each loop, such as an attack sequence, then the amount of time that the timer has been disabled has been changed when compared to just a walking sequence. Although this is not a crucial problem for things such as telling the robot to stop for a few seconds, it could be a problem if more accurate timing was needed.

Since I found the enable/disable interrupts before and after each serout to be an annoyance, I decided that it would be best to simply not use the interrupt. Instead, the Midnight Prowlerbot now counts the number of steps that it has taken when attempting to avoid an obstacle. For instance, this allows the robot to walk left three steps when any forward obstacle is detected instead of attempting to walk left for two seconds. In the future, more complex avoidance sequences than the left turn algorithm will be attempted.