Nov 262014
 

Pololu has their P-Star 25K50 microcontroller on black friday sale for $3.95 each, limit 5. That’s a heck of a price.

pololu_bfPStar

Even the normal price of $9.75 is not bad at all.

pololu_PStar

I snagged some of these last night and I’ll be using them as part of the USB on the Microchip PIC microcontrollers series. It looks to be a nice set of features in a nice package, get the Microchip datasheet for the 18F25K50 here.

Here’s a quick screen shot of the basic features:

Microchip_25k50

Nov 262014
 

This is Part II of the USB on the Microchip PIC series of articles.

In order to do anything interesting on the PIC we’ll need to install a development tool chain. Typically a tool chain consists of at least a compiler, assembler, and linker. Any modern tool chain will likely also include a librarian, loader, and a handful of utilities for transforming and viewing the tool chain output.

In addition to the compiler tool chain a full featured development environment is almost a requirement. I know of developers that swear by simple text editors for code and command line terminals for running the tool chain. I take the position that tools have advanced to the point where they add significant value in terms of ease of use and speeding development. Modern development environments include syntax highlighting, code completion, parameter filling, version control integration, tool chain integration, and often debugging views.

For the Microchip line of PIC microcontrollers the goto Integrated Development Environment (IDE) has always been, and from where I sit, will continue to be MPLAB and MPLAB-X. Microchip makes MPLAB and MPLAB-X available for download for free. MPLAB-X is the successor to MPLAB and is being pushed as the recommended IDE moving forward. MPLAB is still available for download for older projects that require it but in this series of articles we will be using the MPLAB-X environment. I’m aware that other vendors tried to sell compilers and IDE’s into the Microchip development space but really did they ever get any traction? Can you name two alternatives to MPLAB? Me neither.

Along with the IDE you will need to download a tool chain. Microchip again provides a free solution. Microchip makes available for free download and use, even for commercial projects, compilers for all of their microcontrollers. Microchip sells upgraded versions of their tool chains. The only differences listed on the Microchip website between the free and purchased versions of the compilers are available optimization levels.

From the Microchip website:

MPLAB® XC Compiler PRO Edition:
* Provides powerful code optimization at better than 50% when compared to the free edition, giving the most efficient memory usage

MPLAB® XC Compiler Standard Edition:
* Provides a lower cost compiler option with a 20-25% code optimization when compared to the free edition

MPLAB® XC Free Edition:
* Supports all the devices and commands of the Standard and PRO Editions
* No time or memory restrictions
* Limited code optimizations
* Unrestricted use—ideal for a low-cost academic or commercial solution

What this means is that the free versions of the compilers are viable for any project, commercial or not, that is not speed or code size limited. And if you need the higher levels of optimization the costs are not outrageous for a commercial project.

In this series of articles I will be using the XC8, XC16, and C18 compilers, all available for free download from Microchip, look in the Downloads and Downloads Archive tabs. At the time of this writing the latest XC8, XC16, and C18 compilers are v1.33, v1.23, and v3.46. The latest available MPLABX IDE is v2.20.

Microchip is recommending all new development use the XC line of compilers but older projects may or may not compile cleanly under the XC compilers. MPLABX can import old MPLAB style projects, sometimes seamlessly, sometimes not. The XC compilers can sometimes compile projects that targeted the CXX line of compilers, sometimes not. Microchip publishes a conversion document to migrate from the CXX compilers to the XC compilers, MPLAB C18 to XC8 C Compiler Migration Guide. You can find a link to this and other Microchip compiler related documentation on the Documentation tab.

In the mean time I am using a mix of CXX and XC compilers as required. I am doing all of my new development targeting the XC compilers and am migrating older CXX projects to XC as appropriate.

In order to follow along you will need to download and install the XC8, XC16, C18 tool chains and the MPLABX IDE. Each of these downloads is 50 to 150 MB. After downloading the tools you will need to install and integrate them. Installation is a typical process. I am using MS Windows and the installation is typical double click and install routine. Something thing to keep in mind that you might want to consider, at multiple times in the installation and use of the tools you will need to point to the locations of the tools and application libraries, it can be more convenient to put the tools and application libraries somewhere closer to the top of the file system hierarchy rather than accepting the default Windows installation location. The IDE and compilers want to install in C:\Program Files (x86). I typically install the tool chain and IDE in a C:\apps\Microchip directory. Under each of the IDE and tool chain directories I usually install each particular version in a subdirectory. The MPLAB-X IDE supports multiple different versions of the tool chains installed at the same time and allow you to pick between them. This is a bit of a requirement as deeply embedded projects, for good or bad, often rely on or take advantage of specific idiosyncrasies of the tool chain.

Microchip_dirs

After you have all of your tool chains downloaded and installed you need to integrate them into MPLAB-X. Load MPLAB-X and go to the Tools->Options menu.

Microchip_toolsoption

Under Tools->Options pick the Embedded tab and Add.. each tool chain.

Microchip_toolchains

Once you have a project loaded

Microchip_projloaded

select the project properties from the File menu

Microchip_projproperties

and select the tool chain for your architecture

Microchip_projtoolselect

If you can get to this point you should be ready to begin building for the PIC family of microprocessors. In the next article we’ll look at Microchip Library for Applications and begin building and looking at the output of some of Microchips demo code.

Nov 092014
 

I am working on a project that needs high speed real time data acquisition, large data storage, and a rich interface to the web. Put these requirements together and one solution is to use an embedded real time system for the data acquisition and a general purpose computer for the data storage and web interface.

Of the many ways to implement a solution like this the solution I chose utilizes a Microchip PIC microcontroller for the high speed data acquisition and and embedded PC style platform running Linux for the data store and web interface. The connection between the PIC microcontroller and the embedded PC is USB.

Over the course of the next few posts I will be showing a how to bring up USB on a PIC microcontroller, both as a bootloader and as an embedded application. I will be relying on Microchip’s Libraries for Applications or MLA to provide the USB and bootloader frameworks. Part of the MLA is a USB framework targeting Microchips 8, 16, and 32 bit processors. The MLS also provides a wealth of example code including a USB bootloader. I will be showing how to target the USB framework for a couple different PIC processors and how to go end to end from a naked chip to a USB application exchanging data with a PC.

I plan to post on the following topics:

  • USB on the PIC – Introduction
  • Installing the MPLAB-X PIC development environment
  • Microchips Libraries for Applications
  • PIC development tools
  • Bootloaders
  • Building the MCHPUSB bootloader for the PIC18
  • Building the HID bootloader for the PIC18
  • Building the HID bootloader for the PIC24
  • Building the HID bootloader for the dsPIC33
  • Writing a USB application
  • USB slave application on the PIC
  • USB host driver and application on the PC


  • You can acquire some of the following tools if you want to follow along:

    A USB Bit Whacker. The UBW is a simple, relatively inexpensive development board sporting the PIC18F2553. The UBW is well supported and ships with a an open source USB bootloader and application. This makes it an excellent starting point for USB development. You can get a SMD UBW or through hole UBW from Sparkfun Electronics.

    [Update] Since I snagged some PIC18F25K50 P-Star development boards on Pololu’s 2014 Black Friday Sale I’ll be updating this series to also work with these micros.

    A Bus Pirate. The Bus Pirate is base on a PIC24 and is an excellent tool to have in your embedded development toolbox. That we can also use it for a development platforms is gravy. You can get a Bus Pirate from Sparkfun, Adafruit, or Seeedstudios.

    You will also want to download the Microchip Libraries for Applications v2014-07-22 and the v2010-08-04 version from the Archives tab.

    I will be building the demo applications in MPLAB-X which you will want to download and install for you flavor of operating system.

    You will need the Microchip XC compiler for the architecture of the chip you will be using, XC8 for the PIC18 chip and XC16 for the PIC24 and dsPIC33.

    If you are serious about Microchip PIC development you will need an ICSP. I use the PICkit2 but the ICD2, PICkit3, ICD3 all should work equally as well.

    Nov 022014
     

    The Innovation First VEX line of robotic components consists of a wide range of structural, sensing, and motion actuating elements. All of these sensing and actuating components are driven by the one and only control component, the Vex Cortex.

    The Vex Cortex is the controller, or the brains, for a VEX robot. The Vex Cortex sports an ARM processor for user programs, 8 12 bit analog inputs, 12 digital input output ports, 2 UART ports, a single I2C port, 8 3 wire RC servo motor compatible outputs, and 2 H-Bridge 2 wire DC motor driver ports.

    CortexPortssml

    Today we’re going to walk through the first part of a tear down of the Cortex controller. The reason we’re doing a tear down is that as nice as the Cortex is it suffers from at least one well known weakness, the built in H-Bridge motor driver ports are undersized and prone to burn out under normal use.

    The 8 RC style motor drivers rely on external plug-in H-Bridge motor drivers. If a motors stalls or over currents the external bridge can burn out but it is easily replaced. If the built in H-Bridge drivers burn out the Cortex is permanently damaged. Innovation First, the makers of the VEX Robotics line, including the Cortex, will disavow all responsibility after the warranty period runs out. Even if, in my opinion, the weak design of the internal motor drivers is the root cause of the failure.

    VEX Forum\Official Technical Support\Cortex started smoking

    VEX Forum\Official Technical Support\Possible Cortex Motor Controller Burn-Out?

    With the right tools the internal H-Bridges can be replaced and the Cortex brought back to full functionality. The repair of the motor drivers will be covered in another post.

    Keep in mind that opening the Cortex probably voids your warranty, and modifying the Cortex surely makes it ineligible for competition. Given that caveat, here we go.

    Disassembling the Cortex is straightforward, flip the Cortex on it’s back and you will see four philips tip screws, one in each corner.

    BackScrews

    After removing the four screws gently pry apart the front and back covers. The circuit board will likely stay with the back of the housing with the front cover lifting off easily.

    cortexLiftBack

    cortexhalves1

    With the top off of the Cortex the main circuit board is exposed.

    cortexOpenPorts

    After removing the top gently pry the circuit board off of the bottom part of the housing. The circuit board is just wedged into tabs on the bottom of the housing and is not fixed in place.

    cortex3parts

    The Cortex has two thermal overload breakers inline with the motor control circuits. If the motors draw too much current the breakers overheat and reduce current to the motors, effectively putting the motors, and your robot, out of action until the breakers cool down. The breakers serve to protect the Cortex but pose a serious issue in a competition. The breakers take up to tens of minutes to cool down, effectively putting your robot out of the match you are in and potentially out of the next match as well depending on how fast and furious the matches are coming.

    cortexMotorCB

    The major components of the Cortex are shown below.

    cortexpcblayout

    The main system processor that controls the Cortex is an NXP LPC2458FET180.

    ControllerLPC2458FET180sml

    From the NXP website for the LPC2458.

    "The LPC2458 microcontroller is ideal for multi-purpose communication applications. It incorporates a 10/100 Ethernet Media Access Controller (MAC), a USB full-speed Device/Host/OTG Controller with 4 kB of endpoint RAM, four UARTs, two Controller Area Network (CAN) channels, an SPI interface, two Synchronous Serial Ports (SSP), three I²C interfaces, and an I²S interface. Supporting this collection of serial communications interfaces are the following feature components; an on-chip 4 MHz internal precision oscillator, 98 kB of total RAM consisting of 64 kB of local SRAM, 16 kB SRAM for Ethernet, 16 kB SRAM for general purpose DMA, 2 kB of battery powered SRAM, and an External Memory Controller (EMC). These features make this device optimally suited for communication gateways and protocol converters. Complementing the many serial communication controllers, versatile clocking capabilities, and memory features are various 32-bit timers, an improved 10-bit ADC, 10-bit DAC, two PWM units, four external interrupt pins, and up to 136 fast GPIO lines. The LPC2458 connects 64 of the GPIO pins to the hardware based Vector Interrupt Controller (VIC) that means these external inputs can generate edge-triggered interrupts"

    The datasheet for the LPC2458 is here.

    The system processor runs the Cortex system firmware, as opposed to the user uploaded robot control program. The system processor manages the wireless link and the bulk of the communication with the joystick.

    The user processor, the processor that runs the user uploaded code, is a STMicroelectronics STM32F103 ARM Cortex-M0 processor.

    ControllerSTM32F103

    From the STM32F103 datasheet:

    "Medium-density performance line ARM-based 32-bit MCU with 64 or 128 KB Flash, USB, CAN, 7 timers, 2 ADCs, 9 communication interfaces including up to 2 x I2C interfaces, up to 3 USARTs, up to 2 SPIs, a CAN interface, and a USB 2.0 full-speed interface."

    Four particularly interesting chips are the drivers for the internal H-Bridge motor drivers. The internal motor drivers form an H-Bridge consisting of an International Rectifier IRF8313PbF HEXFET Power MOSFET coupled with a Fairchild FDS4935BZ Dual 30 Volt P-Channel PowerTrench MOSFET.

    MotorDriversTop

    MotorDriversTopChip

    The top half of the H-Bridge motor drivers are found on the bottom side of the circuit board.

    MotorDriversBottom

    MotorDriversBottomChip

    The Top Half / Bottom Half nomenclature of the H-Bridge comes from the way H-Bridge circuits are typically drawn. The positive voltage to motor control FETs (P-Channel) are typically drawn above (nearer the top of the drawing) and the motor to ground control FETs (N-Channel) are typically drawn near the bottom of the drawing, top half, bottom half.

    H-Bridge

    That pretty much wraps up the interesting chips. The VEX Cortex controller is not a particularly complex board but it is almost all surface mount components which makes it just this side of impossible for most robotics clubs to work on when it fails. At $250 USD each burning up a Cortex is not a cheap proposition.

    In an upcoming post we will cover how to replace the motor driver FETs when motor ports 1 and 10 fail.

    Nov 012014
     

    One of our favorite meals is a vegetarian vegetable curry soup over rice, with or without grilled chicken. We like this curry for multiple reasons; first it is delicious, second, it lets us use up vegetables that are on the brink, and third, it freezes well and lets us pop out a dinner on very short notice.

    When we first started making this curry we would make a standard soup pot full, about enough for a dinner and maybe a left over. Once we discovered how much we liked it we started making bigger and bigger pots. Now we are using our big canning pot and making about three and a half gallons at a time. This soup freezes well and heats up to a quick and delicious dinner.

    The soup is mostly a mix of vegetables and fruit, curry spices, and coconut milk. The flavor is a mix of sweet, spicy, and creamy. We usually pick a mix of vegetables and fruit that end up being sweet when tasted alone, then we add enough curry to give it a bite, and then mix in coconut milk to give it a delicious creamy flavor.

    In our curry we usually start with a base of onion, cauliflower, carrots, and apples. Then we mix in whatever extra vegetables we have in the crisper that we want to use up before they go bad. Historically we have tried adding peppers, spinach, broccoli, kohlrabi, cabbage, and pears. The recipe is not exact, use what you have, or keep it simple if you want a simpler taste.

    currysoup-1

    currysoup-2

    currysoup-3

    currysoup-4

    currysoup-12

    currysoup-15

    currysoup-14

    currysoup-33

    Step one is to wash, sort, and trim the produce. I usually wash all of the vegetables and fruit, then I trim off the ends and any bad spots. I core the fruit and toss out any obviously bad leaves or stems. I usually leave the skins on and cook them into the soup. I do not add in the greens from the vegetables.

    Step two is to dice up the produce, mostly just to have it pack in tighter and cook quicker.

    currysoup-25

    currysoup-26

    currysoup-27

    currysoup-28

    currysoup-19

    currysoup-16

    currysoup-17

    currysoup-22

    Step three, add all of the chopped fruit and vegetables into an appropriately sized pot and add water to just under the level of the produce.

    currysoup-18

    currysoup-20

    currysoup-21

    currysoup-23

    currysoup-24

    currysoup-29

    Step four, boil the produce for anywhere from a half an hour to an hour and a half depending on the quantity and mix of vegetables. Soups heavy on carrots and other root vegetables will likely need to boil a bit longer. Test the softness of the vegetables every ten minutes or so after the first half hour to get a feel for the progress. You should be able to easily stick a fork into the produce when it is cooked.

    currysoup-32

    currysoup-34

    currysoup-35

    Once everything is nice and soft it is time to blend it. Turn down the heat from high to a mid range temperature. You want the soup to stay hot and continue to simmer but not to fully boil.

    To blend the soup you MUST use an immersion blender. Do not try to use a mixer or counter top blender. You are working with a pot of boiling hot vegetable paste. You really need to keep all of the hot soup in the pot and bring the mixer to the pot, not the other way round. I happen to use a Kitchenaid Variable Speed Immersion Blender. I like the extra length, the metal construction, and the variable speed. We used to use a simple all plastic immersion blender when we were making smaller pots of soup but the larger batches really need the extra length of a bigger blender.

    currysoup-35

    currysoup-37

    currysoup-38

    currysoup-42

    The soup will start out chunky and lumpy but will eventually blend down smooth.

    currysoup-39

    currysoup-44

    Once the soup is blended you can taste it to see where it stands. We typically add in a pinch of salt to get the flavors to pop.

    At this point the soup is probably very vegetable, or possibly apple, tasting and is probably a bit on the sweet side. Between the carrots and the apples the base has a very sweet natural flavor. Now you are ready to add the curry. We use a curry paste we buy at our local Asian market. You should be able to find a bunch of different flavors. We tend to like the Red Curry Paste best with Masman or Panang next. Once you’ve opened the paste you need to store it in the refrigerator. This step, the adding of the curry, is a very personal thing. Add in a little bit of curry at a time, maybe a tablespoon at a time depending on the size of your batch of soup, and mix it thoroughly into the still simmering soup. Use the immersion blender to make sure the curry is well dispersed. Keep adding curry until you get the bite you want. The three and half gallon batch we just made took almost a full cup of curry paste. Remember you will be adding coconut milk which will mellow the flavor. I like to go a bit on spicier side and then mellow it out with the coconut milk. Be careful though, it is easy to let the curry get away from you and make a batch with a bit too much bite.

    currysoup-33

    currysoup-40

    As you mix in the curry taste as you go. Add curry until the soup has the bite you want. Besides the coconut milk keep in mind what you will be serving the soup with. If you are putting the soup over rice the rice will also act to buffer the spice.

    After the soup is spiced to taste turn off the heat. We are about to add the coconut milk and you don’t want to cook the coconut milk. You want the coconut milk to melt into the hot soup but you don’t want to over heat the milk. Again, turn the heat off under the soup and then add the coconut milk. The amount of coconut milk will depend on the size of your batch of soup and your taste.

    currysoup-14

    After the coconut milk is mixed in the soup is ready. If you just made enough for one meal your dinner is ready, serve and enjoy. If you made extra let it cool and freeze it in appropriately sized batches. When you need a quick dinner grab out a frozen batch of soup, put it in pot to heat while you make the rice. If you make long cook rice your soup should be hot about the time your rice is done. You can have a hot delicious meal in about a half hour.

    currysoup-45

    currysoup-44

    Here is the recipe. Remember this soup is done to taste. Add in more or less curry and more or less coconut milk depending on your taste. Pick vegetables and fruit that you like or have handy.

    Our soup:
    1 to 2 heads of cauliflower
    5 to 12 carrots
    5 to 24 apples
    1/4 to 1 sweet onion

    Optional vegetables and fruit:
    peppers
    spinach
    broccoli
    kohlrabi
    cabbage
    pears
    other readily available produce to your taste

    Wash, trim, and chop the produce.
    Add the produce to a pot, add water and bring to a boil.
    Boil the produce until soft to a fork.
    Blend the produce using a hand immersion blender until smooth and well blended.
    Add a pinch of salt to taste.
    Blend in curry paste a little at a time to taste.
    Remove from heat.
    Stir in coconut milk until well mixed. Add coconut milk to taste.
    Done.

    Mar 242014
     

    I have two 3D printers, both are the FDM types that squirt out plastic filament and build up an object layer by layer. My first printer is MendelMax 2.0 cartesian printer I built from a kit a couple years ago and the second is a RostockMax delta style printer I’m in the process of building.

    The MendelMax has been a good printer but I’ve always had mixed results. I get good prints one time and horrible prints the next. I built the printer on a table in the family room, so I could work on the printer but still be around the family, and did all of my test and tuning prints sitting on the same table. Results were consistently inconsistent. Eventually I got frustrated, and tired of having the printer sitting in the family room so I moved it downstairs to my workroom. My workroom is a bunker style room in the basement with no windows, no vents, and only one door. I immediately noticed a huge improvement in print consistency. Prints might have errors but the errors were repeatable and reproducible. The number of errors were significantly smaller when printing in the basement than in the family room and the errors were consistent. It finally occurred to me that being in the family room the print nozzle and print surface was subject to the whims of breezes and temperature changes that come with people entering and exiting the room, windows and doors being opened and closed, uncontrolled variations that changed the print quality every time the environment changed. Being in the “bunker” in the basement the environment was mostly stable and undisturbed. With no windows or vents and only one door the basement room is a pretty consistent temperature and there are very few random breezes. A more stable environment led to more stable printing.

    After moving the printer to the basement I could finally get consistent prints, not error free prints, but repeatable prints. When I did have a recipe for an error free print I could print the same object again and again and finally expect the same results. Yahoo! Life is good! But, you know the old saying, if you give a mouse a cookie…. Anyhow, now that the major obstacle was overcome, just being able to get a repeatable print, it was time to start looking at secondary failures.

    The next biggest class of failures I experience are the saggys. Saggy prints, bridging that droops, overhangs that fall and loop, glooping and bumps, all failures indicative of printing too fast, that is, not letting the material cool before trying to lay down another layer.

    Here are some images of the Pink Panther Woman printed with one or two perimeters, in ABS with 0 to 40% infill. Mostly with one perimeter and 0% infill.

    PinkPantherWoman

    You can see multiple places in my prints where the filament sags and droops when trying to print an overhang.

    ppw_sagback

    ppw_sag2

    ppw_sag1

    ppw_sagback3

    ppw_sagback2

    I found that if I print really slow, like really really slow, I could get a great print. The nozzle takes so long to traverse the print the previous layer had time to cool before being visited by the printhead again. This worked but the print time was increased by a factor of 3 to 10. That was clearly unacceptable.

    The next solution was to add a print cooling fan. The kit I bought was the MendelMax from 3DPrinterTek.com. I have been super happy with the kit, it is well made, well supported, and super complete. All of the parts needed to assemble the kit, plus extras was included. A nice organizing case was provided for the screws and small parts. Cables came pre-terminated. I had to do a little soldering but for the most part the kit was plug and play. A very clean build and with what seem to be quality parts. I’ve not had a bit of trouble with the printer to date.

    One thing the kit did not ship with was a fan duct for filament cooling at the printhead. It did ship with the fans, RRD Fan Extender, and cables to add up to two filament cooling fans, but no fan duct.

    The first step in figuring out how to add a fan was deciding if my software and electronics could support an extruder fan. I’m running Marlin as the printer firmware so a quick google search confirmed Marlin’s support for an extruder fan. Now how about the electronics. The printer is driven by a RAMPS 1.4 on top of an Arduino Mega clone with Pololu style stepper drivers. All in all a good electronics platform but it turns out the RAMPS 1.4 out of the box does not support an extruder fan as a standard option. Some might take issue with this last statement given the unused D9 port, but D9 was intended for a second extruder, not an extruder fan.

    In order to drive a fan a high power output is required, higher than can be driven by the bare io pins from the Arduino. The RAMPS board provides three high power outputs, D8, D9, and D10.

    rampsd9_2

    D10 is used to power the heater on extruder 1, D8 is used for the hot bed, and D9 is intended for extruder 2. On a single extruder printer D9 is unused, and therefore could be used to power and control an extruder fan, and indeed there are multiple internet responses supporting doing just that, wiring a fan into D9. So indeed it is reasonable to say that the RAMPS board supports an extruder fan out of the box…. assuming you never want to add a second extruder. For those who think they might want to have a second extruder D9 is off limits and another solution is required.

    Obviously I’m not the first guy to want dual extruders AND extruder cooling fans on the RAMPS electronics. To satisfy the limitation in the RAMPS board of no high power outputs for extruder fans some enterprising souls created the RRD Fan Extender board. The RRD board mounts directly onto the RAMPS board and adds two channels of mosfet controlled power output. These two channels are not nearly the current capacity of D8, D9, and D10, but are more than enough for running a fan. The RRD board is able to take input power from 5V or 12V so it can support 5 or 12 volt fans. The RRD board has two channels of output supporting two extruder fans for dual extruder setups.

    Something to keep in mind when buying a RRD Fan Extender. The servo port brings out pins D11, D6, D5, and D4. Some RRD boards bring D11 and D6 out to drive the two fan mosfets and some RRD boards bring D4 and D5 out to the mosfets. You need to check which RRD board you have because the printer firmware, Marlin in my case, needs to be configured properly to tell it which pins the fans are on.

    If your RRD board uses pins D4 and D5 no software changes are required because the stock Marlin configuration for a RAMPS 1.4 (motherboard 34) is already configured to use D4 as the extruder fan 1 control. If your RRD board uses D11 and D6 you will need to edit pins.h and change your FAN_PIN assignment.

    Like I mentioned above, the 3DPrinterTek kit shipped with a RRD, multiple fans, and all of the cabling required, but no fan duct. Not really a big deal, there are plenty of fan duct models out there, just download one, print it, and wa-la, instant extruder cooling.

    Step one was find a fan duct compatible with my printer. A quick search of Thingiverse turned up this duct for a MendelMax.

    Fan_Shroud_3_display_large

    I printed the duct, mounted a fan to the duct with 3mm screws and nuts, zip tied the duct to the print carriage, and wired it up. The RRD mounts onto the servos port of the RAMPS and power is jumpered from either the 5V or 12V aux power. My fans are 12 volt so I jumpered to the 12V aux power pins.

    rrd_mounted

    The RRD supports up to two fans but I’m only using one so I only have one of the outputs cabled.

    Here is the printed fan duct zipped tied to the printer carriage.

    fan_mount3

    fan_mount2

    fan_mount1

    fan_mount4

    Notice the fan only points at the back of the print so I expect I may still have problems with the front side of the print.

    With the fan duct installed, the RRD on the RAMPS servo port, and Marlin configured to use pin 4 as the FAN_PIN I ran a test with the same model.

    ppw_fannedback2

    ppw_fanned

    Notice the sagging on the back of the butt is nearly gone and the sagging on the upper back is completely gone. The quality of the prints, at least from the back, has jumped tremendously. The next step is to either get a fan pointed at the front of the print or print a wrap around cooling duct.

    Maybe like this wrap around fan duct.

    mm_jhead_fan_duct_display_large

    Feb 282014
     

    Progress is being made on the hardware. The motors are mounted, the EggBot controller board is mounted, new spools are printed and installed.

    Here is the overall mounting scheme so far

    drawbotone2

    I ended up printing these small spools from thingiverse.

    drawbotonespool1

    I used a screw specifically made for screwing into plastic. It has deep coarse threads that bite well into the soft ABS plastic. We’ll see if it holds long term but it seems to have a good grip right now.

    The EggBot board has an issue where the upper and lower copper planes are one power and one ground. The problem is the mounting holes do not have copper pull backs so if you put a metal screw or stand off through the mounting holes the power plane and ground planes are shorted together. So that’s no good. Mounting the EggBot board requires using non conducting mounting hardware. I decided to print a mounting platform and hold downs.

    I printed reliefs in the mounting platform for the pins that protrude from the bottom of the EggBot board. The four pins in the corners go through the EggBot board mounting holes to align the board and keep it in place when held down.

    eggbotboardmount1

    eggbotboardmounted

    holddown

    holddown3

    eggbotboardmount3

    I’ve done some simple tests communicating with the EggBot board and moving the motors, making sure everything is still in working order and nothing got crimped or crushed.

    Next steps are to string the gondola and get some code working.

    Feb 282014
     

    I’ve combed through enough of Wilba’s code to understand the fundamentals. I’ve done some cleanup and added comments and a bit of debugging functionality. I’ve uploaded the latest updates to github.

    Searching the web for drawbot stuff I came across a post by Wilba on XKCD’s forum with some pictures and comments describing his drawbot geometry. This was a big help when trying to understand the code.

    Wilba’s drawbot code supports using a larger spool and calculating the tangent point of the cord from the spool when calculating the pen position. The drawbot I’m making is much simpler. I’m using fishing line through an eyelet which fixes the cord origin regardless of the spool diameter or angle to the pen. Using a string around a spool does have the issue of the spool diameter changing due to wrap up of the string around the spool, but I’m using fishing line on a reasonably sized spool so the diameter change should be small.

    At this point I’m going to fork the code from DrawbotWilba to DrawbotOne. DrawbotOne will be simpler to start with since it will only support the cord entering the drawing space from a fixed point at the eyelet.

    Feb 212014
     

    I’ve taken Wilba6582’s eggbot drawbot code and cleaned it up enough to build under Processing 2.0. It requires grabbing the latest controlP5 library and I’ve removed the gamepad control.

    I haven’t tried running it against an EiBotBoard yet but that’s the next step. The code builds and runs, it rasterizes an image, and brings up a gui with the ability to drag the pen around.

    I’m in the process of organizing and cleaning up the code and I’ll continue to push changes to github.

    We’ll see where this goes but it gives a nice starting point for jumping off, a big thanks to Wilba6582 for doing the initial work.

    Here’s the interface up and running from the barely modified code.

    DrawbotWilbaInteface01