Sunday, August 31, 2014

Rigidbot Modifications

After having my 3D printer for a while and doing long prints I got tired of having the printer running in my room. Sure it was nice when it was time to check on my prints, but sleeping with the thing running was not ideal. So the first thing I did was add a raspberry pi running OctoPrint. If you have not heard of OctoPrint it adds a web interface to control your printer. It even allows you to add a webcam so you can easily do time lapses of your prints or see how the print is coming from anywhere with internet. (That is on my list to add) This interface allowed me to move my printer to another room in my house.

Now That I add the raspberry pi I now have to plug my printer into the power brick, plug the raspberry pi into the printer, and the raspberry pi into the wall for power. To me that was a little ridiculous so I decided I wanted to mount everything to the printer so it was one plug and done. This was going to be a project for farther down the road except one day the printer would not start. It turned out that the plug from the power brick to the printer was not the best connection in the world. I was not a fan of that plug to begin with but figured don't fix what ain't broken. Well once the plug stopped working I figured it was time to replace it and mount everything to the printer. I also wanted to make a stand so the printer would be at table height. That part is not done yet but the important part is the printer is printing again.

Now I decided that the raspberry pi, power supply and control board would all mount to the dame tray. That way if I needed to work on something I could take it all out in one piece. I measured the distance between the bars and how long the power supply was and made the tray below.
Due to my need for precision after taking a metal working class at my undergrad (this has gotten me into trouble before) The metal tray was a hair tight. Should have made it a 1/16th smaller but it still fits and that is what is important in my book.
Now I had a general idea of how the electronics where going to get layed out before I built the tray but here was the plan once the tray was made.
Now it was time to start attaching things to the tray. I decided to use the orignal box for the controller so that it would be protected and I would know what plug was what. I needed to insulate the raspberry pi from the tray as well as the dc-dc voltage converted (this way I would not need to have a second plug for the raspberry pi). The power supply would be held in with a metal strap. 
I thought about 3D printing a raspberry pi case and something for the power converter but whey spend the hours printing that when in under 10 minutes I can draw up a 2D spacer and laser cut it out. Now in the above picture you can see the electrical work already done. Originally I was going to have to have 2 sets of wires connecting the power supply to the control board. You can see the second plug in this picture. After I had wired the wires to the power supply I thought about it and did a quick Google and determined that the 10 gauge wire I was using and the power connectors would be able to hand the current with just one plug so I only soldered 1 to the control board. I will remove the other plug later when I move the 120 vac plug from the back of the power supply to the printer itself. Now we all know how big of a pain it is to wire things together when space is tight. So to make my life easier my tray just pivots on 2 of the screws holding it in so it is easy to plug everything in and work on anything if needed. 

After I got everything all wired in all I had to do was rotate the panel back into the bottom of the printer and put the other 2 screws in. 

That's it for stage 1. It will probably be a bit before stage 2. Which will include moving the 120 vac plug, painting everything, replacing the USB cord with a 6 inch one so I don't have a cable coiled, and finishing the stand. Currently it is a little wobbly.

Wednesday, August 20, 2014

Raspberry Pi Picture Frame Post 12 Image Resizing

As I said in my last update I said that I wanted to resize images to save space on the pi. To do this I am going to use imagemagick. You can install it using the code below.
sudo apt-get update
sudo apt-get install imagemagick
If I remember correctly I mentioned earlier that capitalization is extremely important with Linux. This includes file extensions. If you use my scripts the slide show will only show .JPG files not .jpg. So to fix that we need to make sure all of the pictures have .JPG as there extension. This is done with one simple line of code.
rename 's/\.jpg$/\.JPG/' *.jpg
Now if you want an explanation of what everything in the code means go here. I tried to explain it but in the end that's where I got the help from and that website does a much better job. So I gave up on explaining. Now all of our files have the same .JPG extension. Next we will resize the pictures. If you want to just do one the command is convert input.JPG-resize 1280x1024 output.JPG. Now in that case we can change the file name output and the extension. However when we do a batch process it does not work nicely. Below is the batch convert code. 
for file in *.JPG; do convert $file -resize 1280x1024\> $file; done;
Now lets break that down. for file in *.JPG; What this means is for each file found with the .JPG extension we will do the following. The $file allows the command to use the file name from the for section. The done at the end says that we are done looping commands, go to next file. Just search batch convert imagemagick if you want more information. The \> says to only re size bigger images. This way we don't reprocess each image every night. Now I am going to add this to the script. What I want it to do is check for changes (aka new pictures) and download if there are, then convert the files, then sync the new files to the web. 

Monday, August 18, 2014

Raspberry Pi Picture Frame Post 11 Progress Update

Now that I am finally back in Indiana I have got the picture frame setup and it is working like a charm. That is once I got it connected to the internet again. Today I gave out the information so that my siblings could start uploading pictures to the frame so that I can give it a good test. just over 4 months till Christmas when I need this thing working perfectly.

Things I have changed since my last post.

  • Added picture re sizing. I was putting the files as the came off my camera directly onto the picture frame. These files were about 3mb. I setup the picture frame to resize the images down to the make resolution of the screen. That way the files are smaller and more will fit on the memory card. They are about 1/5th the size they were originally. (will write up how I did this later once I figure out how I did it.
  • Moved picture locations. Instead of having the pictures in the main google drive folder. I moved them to a folder called pictures. This allowed me to share that folder with edit capabilities with other family members so that they to could add pictures without me having to give them my username and password. 
Things to be done
  • Build the nice wooden frame. Luckily I have access to a nice wood shop out here which will make my life much easier.
  • Add a external light so you can tell when the screen power is on and off. Now you may be wondering why I want to do that since the screen will be showing pictures when it is on. Simple. When you use the remote to turn the screen on you don't know if its powering on unless you wait since there is about a 5 second delay for power on
  • Add a gpio input for screen power. This way we can schedule events to turn the screen on and off. Without this if the screen is already off and the off event comes it will just turn the on which is the opposite of what we want. 
  • Change weather screen 2. I said this in a previous post but I plan on changing the second weather screen to show the weather in 4 different locations.

Sign for Mark

At the end of last semester there was a student who wanted to make something for the Metal Lab Professor. The Professor who gave me the name Betz Mobile Engineering. You could say I am a sucker for helping students. Especially when I know what the extra curricular project is for. For some people this may sound weird buy I am here for the students. I do not have any needs to move up the food chain, well at least currently and I do not think I will want to in the future. I enjoy teaching and working with students. So when a student told me he wanted to make something for this professor I was all about it. After all sometimes us teachers do not get enough recognition. So I asked him what he wanted to do. The problem was he had no idea. I suggested that we do something with the laser engraver. Now being the Unmanned Systems professor so of you may be thinking, Why do you have any idea how to use the laser engraver? The answer is simple I wanted to build a helicopter and I designed it to be laser cut out of 1/8 in plywood so the laser engraver could cut it out. Since then I have done a few more projects. See my website to see the projects.

So back to the project for the other professor. I told the student to go look for images that he would like to etch. Ideally a raster image so we could scale it without any issues. The next day he told me he could not find one he liked. This surprised me a little bit with how many images are on the internet. First thought was he did not try very hard so I did my own google search and guess what. I had the same problem. I found one I liked on but I did not like how things don't line up properly. Yes I know that was done on purpose but I still do not like it. Pl
So what do I do. I use that image as a inspiration to create my own. Now up to this point I have used some of Adobe's programs for photo editing and document layout but I have not used Illustrator to do that much. Sure creating boxes and lines is easy to do. However recreating the above image had some difficulties to it. I learned how to cut the shapes into different sections and combine them to make one shape. Did I do this the most efficient and proper way, I guarantee you I did not however I got the job done was extremely happy with the finished product. I focused mainly on the lathe. The guy in the background I did not want to do without. Plus I already have a line art guy. He is kinda my symbol. A guy plugging things in. So when I was down doing the lathe I add the guy that I drew before in the background and get what you see below. 
Now you are probably thinking. You did all this for a student? The answer is YES!!!! Without the students I would not have a job and without students caring about the professors and what they are learning my job would be really boring. Students who are excited and want to learn is why I am a teacher. So if a student wants to show there respect for another professor by making them a little thank you gift you better believe that I am going to do everything I can to help them. 

Now that we had the image we wanted to use it was time to prep the wood and etch. I showed the student how to safely use the tools necessary, some where new to him like the laser engraver and some where just refreshers like the table saw. He got the wood planed down to proper thickness and cut down to size. All we had to do was the etch the image and guess how is walking by and decides to stop in and see what and how we are doing.  You guessed it the metal lab professor, luckily we did not have the image up and the student quickly said he was making something for his mother. After the other professor left we engraved it and gave it a light sanding. I am very happy with the final product.