new logo

 | March 6, 2012 8:27 am

I’ve been wanting a nice logo for a while. I’m not a designer, so I tried my hand at something simple that can be used in multiple ways. 

The key parts that I like about this logo

  • Combines my interests in Mechanical and Electrical Engineering.
  • The gear has 42teeth
  • The resistor could also be a waveform
  • It’s easy to add to a circuit board as a silkscreen

I also used the gear and resistor in the logo for makerbits.net, which will be more interesting when it finally comes off the back burner.

PID explained

 | February 28, 2012 10:20 am

The topic of PID often comes up when I talk with FIRST teams. This post is how I explain it to students. I was recently explaining it in a post on Chief Delphi, so I decided to turn it into a blog post while I was at it.

The basic idea for PID is that it corrects for errors. if you make a PID loop based on position, it will move your motors such that the position is what you want. you can replace the word position with the words velocity, angle, and even acceleration or motor current. you can also loop multiple parts of your motion. (i.e. Loop position and velocity), but for FIRST, you usually only need to put a loop around one thing.

Let’s use position for discussion, which is easiest to visualize. First, you need a way to measure your position (an encoder can be used for position or velocity, the gyro or an accelerometer can measure angular data.). The difference between the position you are in, and the position you want to be in, is your error. PID acts on this error to try and make it 0.

In a typical machine tool (like a CNC machine (Hey look, FIRST applies to the real world :) )), you want to position an axis. Say the axis is currently at zero, and you want to move it a meter. Your commanded position is 1m, and your actual is 0m, making your error +1m. (The sign is important!). Proportional Gain is a number we multiply by the error to get a motor command. Sometimes this is a speed (engineering unis such as m/s), or in our case, it is a motor command in the range of -1 to +1. Let’s say our proportional gain is 0.5. 0.5(gain)*1m(error) = 0.5(command), which moves our motor towards where it is supposed to go.

For the sake of discussion, let’s say our motor is geared such that a command of 1 means the mechanism in question is moving at 1m/s. That is also the top speed of the motion, since the command cannot be greater than 1.

PID loops execute repeatedly in your Periodic tasks, so they occur with a fixed time base. To demonstrate, I’ve put this together as an excel worksheet, and posted it to here -> PID worksheet. The sheet lets you play with some different PID settings, and lets you look at how the mechanism will move based on the commanded velocity. It’s not taking friction or even acceleration into account, but it gives the basic idea of how PID works.

The D (derivative) gain is applied to the difference between the error last cycle, and this cycle. It can be used to slow down the movement if it is approaching the target to quickly.

Integral Gain (I) is applied to the total sum of all errors. It is common to not accumulate errors if the error is too large, or to limit the accumulation to a certain value, or to clear out the accumulator when you are in position. The job of I is to take care of small position errors that occur when the P gain alone is not enough to overcome friction or some other limiting mechanical feature.

The sum of the P I and D values are added together to create the motor command. The gains have to be tuned to get the response you want. If P I or D are too large, the system will oscillate. If the signs are wrong, the system will run away. If I is not controlled a bit, it can overshoot significantly. Most FIRST mechanisms work just fine using P, PI, or PD modes. P mode means that I and D gains are 0. PD means I is 0, and PI means that D is 0.

PID does not always need to be reactive. In general terms, there is a further thing you can add called FeedForward, which you can apply to either velocity or acceleration, as the case may be. The basic idea with Feedforward is that you know you’ll be moving in a certain direction anyway, so give a little boost to your velocity or acceleration, then let the rest of PID react once you get going. You can see this on the second sheet of the workbook.

If you have any questions, please post a comment!

Updated Shot simulation (Still no Drag or Magnus effect)

 | February 17, 2012 11:12 am

I got a request to add the second angle option to the macro calculated angle section. In theory, there are two launch angles that hit the same target. I biased towards the highest one, because the margin of error for making the basket is wider.

I also noticed that the macro section assumed the ball launched from 36″ off the floor (set on the third sheet), so I changed it to take the h_0 setting from the top of the first page, so all charts assume the same launch height.

Here’s the updated spreadsheet:shot simulation (macro)

The biggest thing to keep in mind is that there is still no Drag (Air resistance) or Magnus effect (increased range due to backspin). I’m hoping the two effects somewhat cancel each other out, but they will both be significant in the real world.

DIY CNC milling machine

 | January 29, 2012 9:58 pm

One of my friends from seattle wrote to ask about my CNC milling machine, so I finally have taken some pictures of it to share. Click the thumbnails for a larger view. To the right of the X axis, you can see the E-Stop switch, which is wired in to the computer. There is a small tray (part of an old printer) behind the X axis, which can be used for holding tools or bits.

DSC_3204.JPG DSC_3210.JPG

The machine itself is built on a plywood frame. The X axis carries the Z axis, which has the dremel attached to it. The dremel mount itself is not particularly exciting, except that the main wood part of it was milled on this machine. It was a bit of a chicken/egg problem. Each axis has a wooden block to act as a spacer, with a small metal plate to aid in alignment. The X and Y axes both have damping weights on the back shaft of the motor.

DSC_3205.JPG DSC_3211.JPG

The motors themselves are NEMA 17 sized bipolar stepper motors with the shaft going all the way through. They are attached via a servo coupler to the lead screw, which has a 1 mm pitch. Overall, the travel of all axes is about 95mm.

DSC_3206.JPG

The Y Axis is mounted under the table. All three axes have limit switches that are used for homing.

DSC_3207.JPG DSC_3208.JPG

The main control board uses an old printer connector (from the same printer that donated the tray) to go back to the parallel port on the PC. The PC itself is an old P4 1.8GHz that I got for $40 from the UW Madison Swap Surplus Store. It runs the EMC on top of Ubuntu Linux. The machine has a separate PC power supply to power the stepper drivers. I modified it to include a small relay and a power outlet (to the left of the control board). This lets me have a logic switchable power outlet for the dremel. All the 120VAC wiring is done inside the case of the power supply, so risk of shock is reduced. Each stepper is driven from a very handy Pololu A4988 Stepper driver. I have little heat sinks that I have not yet installed to let me push a little more current through the drivers.

DSC_3209.JPG

One of the other nice features I added are four storage boxes above the power supply. These were originally microscope slide boxes. A cup hook keeps each one from falling out. turning the hook a quarter turn releases them.

All told, this project cost me about $100 in parts that I didn’t already have. The linear axes from THK were all free surplus from a friend of mine. I’ve used it to mill plastic boxes for prototype circuits, and some 3D profile milling with a 1/16″ end mill.

FIRST 2012 Ball Trajectory Spreadsheet

 | January 9, 2012 11:07 pm

It’s the time of year for FIRST again, and this year’s game (Rebound Rumble) is looking like it’s going to be pretty exciting. This year, I’m helping Team 2151, the Monty Pythons.

I made a spreadsheet to help with planning a shooting mechanism, and to help with testing or writing code.

The spreadsheet is broken up into different sections. The first section has the basic parameters to calculate what velocity is needed for a given set of shot parameters. Set the cells that are green to your values, and the first orange boxes will show the velocity needed for each of the three hoop levels. If the angle of the ball entering the hoop is too shallow, the box will turn red. The h0 (robot shooter height) parameter is used for all the sections, so make sure you set this accurately before going down to the other sections.

The next section calculates a the velocity needed for a variety of shooting angles for a given range. This does not check to see if the shot is too shallow. The first section can be used to look at any individual shot to see if it passes the shallowness test. There is an inverted chart off to the right that swaps the X and Y axes, which gives a different view of the data. The left chart can be used to find a desired velocity for a given range and angle, where the right chart can help you choose an angle to go with your known velocity.

The next section is useful for robots with a fixed shooting angle. It calculates the velocity needed to make baskets at a variety of ranges. There is an inverted chart off to the right that swaps the X and Y axes, which gives a different view of the data. The left chart can be used to find a desired velocity, while the right chart can be used to see what range you’d get out of your current velocity.

The last section is only in the macro version of the spreadsheet. It is designed for robots with a fixed firing velocity (such as a pneumatic launcher). It calculates (using an iteration macro) the needed angle of launch for a fixed velocity and a variety of ranges.

The most useful part of this is for estimating a formula to use in the robot code. The math itself is non-trivial to rearrange.

Hopefully this spreadsheet is useful to other teams, so I am posting them here. shot simulation (macro)

shot simulation (no macro)

Please let me know what you think below

UPDATE (10AM): I added some trendlines to the last graph in the macro version. Now you can specify what range to look at and it will give you a cubic formula for a trendline for each hoop. The trendline will get messed up if you don’t have enough velocity to make the range (blank results in the orange boxes). if you ever get an error message (if the macro fails to find a result), you may have to go to sheet 3 and change cells in the B10 to D22 range to 89 to get it working again. Basically, if the GoalSeek Function can’t find a result, it can make an error pop up. I try to prevent the most common errors, but asking for longer ranges is more likely to have issues.

Be sure to check results back up in the first section to make sure the angles are still valid. The first section can also be used for checking the human player parameters needed to make a shot. set the range to 54 or 56 feet, set the angle high enough to clear the 8 foot alliance wall, and then see what sorts of velocities are needed to make the shot.

UPDATE (10:10AM): I fixed a bug with the entry angle lookup code.
UPDATE (10:40AM): I added the height of the apex of the curve to section 1.

Working on the Workshop88 makerbot calibration

 | November 28, 2011 9:28 pm

image

Last week at Workshop88, I was working on the makerbot calibration, and the DC extruder motor managed to die. I had two spare DC motors at home, so I brought one over to the hackerspace tonight to repair the bot. We just need it to work long enough to print itself a stepper upgrade kit.

After the replacement, I calibrated a bit more, and printed a pair of small gears. I still need to work on the first few layers, and now I’m printing a Mr. Alligator

Alligator clip
This thing brought to you by Thingiverse.com

Stepper upgrade kit:

Now with COLOSO-Gears!(tm). An improved version of my prior design. The Adapter Plate was just revised (to v1.2) the gearing was completely redesigned (which involved drawing the involute curves the hard way, which gave far better results). Gears are 51 and 7 tooth respectively. Giving a ratio of 7.2857:1. The gears are also oversized (COLOSO-Gears!(tm)). I will be uploading a slimmed down version in the near future, I just wanted to be sure I had a large enough meshing area. Note that the new adapter plate is very wide, 90mm+ and will only just fit on the cupcake platform. I recomend printing a z-rider to get a larger build area! Also, the 51 tooth gear is kinda massive. You might have issues printing it from ABS. As always, I recomend PLA. The 7 tooth gear is TINY. Sorry. It will be a pain to get to print right. I broke mine trying to remove it from the build platform. Had to epoxy it back together. UPDATE: Added 14 tooth pinions sized for nema17 and 23 (5mm and 1/4" shafts). Added an 8 tooth pinion (obsolete files gone, but 7 tooth gear left up for the brave). I recomend that you print the small gears with 0 extra shells (infill of 0.1 or higher will result in solid teeth). 9 Tooth gear is off for now unless someone really really needs it Here is a video of it running (and reversing thanks to SF35!)flickr.com/photos/45928876@N02/5405071895/
This thing brought to you by Thingiverse.com

BuRbot Initial Assembly

 | September 21, 2011 10:44 am

I managed to convince my boss to let me try an experiment with a second makerbot, based on the industrial CNC control software and industrial control hardware made by my company. This gives me the excuse to play ability to learn more about how our hardware and software work, and I get to make a pretty Makerbot, to boot.

This past weekend, I did the paint job (except for two end caps I forgot to paint), and did the initial assembly of the hardware, including the new control system to replace the Gen3 electronics (which are in my spares bin for the first makerbot). I really like how the paint came out, and the company colors look really good on the bot.

Initial Assembly - Front right

Initial Assembly - Back right

Initial Assembly - Top inside

I still have to finish assembling the extruder (need to order thermocouples), but I put the MK6 in place anyway. I’ll end up using a HBP instead of the stock platform, most likely.

Initial Assembly - Back Inside

Initial Assembly - front inside

The plan now is to still use Skeinforge for slicing models (Using SFACT, which was the suggestion of Sacha at Pumping Station:One), but to replace most of the rest of it with the new control system. Certain items (parametric open scad scripts) will be able to be compiled on the fly, sliced, and then printed, all on board the bot. The main issue will be the time to slice files, since that can take a few minutes, and possibly longer on this computer. I will at least have some precompiled gcode for demonstrations. I need to look into a nice STL viewer (particularly one that can be run in a web browser).

The user interface is going to be this nice looking touchscreen computer that we make. I still need to work out how I’m going to mount it.

Initial Assembly - Touchscreen

Things mentioned in this post:

I have modified Skeinforge to be more practical and easier to tune. features include: -Will not mess up your old Skeinforge settings as it will use its own sfact_profiles directory inside its own folder. -Deleted unused plugins and unused settings. (IMHO) -Namings of variables changed to be more understandable. -Important settings moved to top of Plugin Tab. -Default values give good prints rightaway. -Internally used Gcode files use extension .gmc now. -Most Feedrates are now entered as values (mm/s) and their respective flowrates are 1 so you dont have to enter everything twice. (exception bridge feed and flow is relative to main feed) -First Layer Travel Feedrate can be specified in mm/s so it doesnt tear off your print.CARVE: -Extrusion width is now entered in mm instead of a ratio to layer height.CHAMBER: -Moved Turn Extruder off at shutdown to Chamber. -Added Turn PrintBed off at shutdown.CLIP: Clip over Perimeter width is now calculated automatically. The default is 1 and can be tuned from there.DIMENSION: -Added feature for calibration. -Retract can be set conditionally depending on extrusion amount before retract and the travel move in retracted state (SF Beanshell). Also retract can be forced to happen if moving over loops.EXPORT: Replaced Export plugin with Gary Hodgson's plugin. -Option to export settings as Zip file or a single CSV file for sharing. -Option to individually name the exported gcode files with description, timestamp and profile used.FILL: -Infill width over layerthickness setting is replaced by Extrusion Lines Extra spacing. -Extrusion Lines Extra spacing is calculated automatically and defaults to 1 for tuning. -Infill Overlap over Perimeter is also calculated internally and defaults to 1 so it can be easily tweaked.INSET: The ınset value is now Overlap Removal and is also calculated internally with default 1 for tweaking.PREFACE: -Added the option to send Extruder reset (G92 E0) command before print so that the extruder does not spool back after priming. (Even without start.gmc file)RAFT: -Ordering, grouping and namings changed to reflect the use of interface settings for the support structures. -Support feedrate and support flowrate can be set seperately. -Support extension(s) are now more understandable. -First Layer feedrates are given in mm/s instead of a ratio to the main feedrate.SPEED: -Feedrates are entered as values with respective flowrates as 1, instead of entering sam value again. (except for Bridge Feedrate). -Nozzle Lift setting has been changed to Extra nozzle Lift over object and defaults to 0. -Wipe is on by default and is around the 0 pointKnown Bugs: -Only Line infill works reliably The latest release is : See Below..Please Comment about your experience, positive or negative.SOON TO COME -Skin plugin with better working calculation, -Leadin Plugin to get rid off the "SEAM" that is created during Layer change.. -First Layer Travel moves are all now limited to "acceptable" speeds -Retraction control is more sophisticated. -Extrusion calculation is even better. -and a lot of small things... -more to it later on reprapfordummies.net keep tuned..
This thing brought to you by Thingiverse.com

 

Makerbot Upgrades

 | September 3, 2011 8:35 pm

I finally got my heated build platform put together. I had tried some thin steel (from my ABP attempt), but it was too fliexible. I went to Menards and got some 0.025″ aluminum, which is a hair too thin, but I was able to cut it with tin snips, and get it installed.

DSC_3474.JPG

I still need to do something to level it properly, and find better screws, but the plate is too thin to properly countersink them anyway.

DSC_3475.JPG

Another easy modification was precipitated by the drive gear stripping off the M6 bolt in my stepper extruder. While I had it apart, I drilled an access hole to reach the set screw on the filament drive. If it ever loosens up again, I can get in here with a hex wrench and tighten everything up again.

DSC_3476.JPG

Hackerspace Tours – Freeside Atlanta, Atlanta, GA

 | August 25, 2011 8:35 pm

This month, I also got to tour Freeside Atlanta. I was a member here from July to November 2010, but it was good to go see how things have been going at the space since I left.

If you are ever in the Atlanta area, go check them out!

3D Printing Filament

 | August 18, 2011 8:18 am

I’ve been wanting to know what filament costs, so I decide to make a google doc that works out prices in a nice comparable way. The RepRap wiki page for suppliers is a great resource, but it quickly becomes obvious that there are infinite ways to sell plastic, making price comparisons difficult. So I made a Google Spreadsheet. This sheet converts all the prices into USD using current exchange rates. This should allow for a more direct comparison, though shipping is not included.

If you want to view the raw data (so far), go to the spreadsheet.

If you want the csv file for doing your own comparisons, look here.

Or try the Interactive Filterable List. I just wish it had sorting.

If you want to help add data, send me an email (engunneer @ this domain) with the subject [printing supplier data], and I’ll add you to the sheet. I’m not quite ready to throw it out to the public for editing yet.

If you see an error in the data, let me know. There are a few known inaccuracies, for example really special colors, and I’m approximating the volume and length based on published density information.

If you know of a supplier that isn’t on the wiki, please add them!

Update: I created a form. Let’s see how this goes, shall we?