Search This Blog

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...