Tuesday, December 27, 2011

Sanguinololu 1.3a - Part 3:Not Out of The Woods Yet

See Also:
Part 1 - Build
Part 2 -  Trouble in Paradise


After the events of the last 2 parts I thought the Sanguinololu was finally working properly. But that would have been too easy, right? (I wouldn't have called it easy.) Of course not, something's still not right. Now I could upload and download firmware fine, and they seem to work. Except...
  • Both boards seem to reset or reboot at random.
  • One board gets a lot of serial errors, I resoldered the FTDI chip several times. I'm convinced my soldering is OK.
  • I noticed that touching my scope's 10x probe to the resonator pins produced serial errors and seemed to crash the 1284p some times
Turns out the Sanguino, from which I tried to use the bootloader and related software, as per the instructions on the Sanguinololu wiki page, is built with a crystal oscillator, not a ceramic resonator, so the fuse settings may be different. The Mighty 1284p bootloader is also set to a crystal oscillator.

I used http://www.engbedded.com/fusecalc/ to calculate new fuse settings

I burned Mighty 1284p bootloader with new fuse settings (changed in boards.txt):
Low 0xD6
High 0xDC
Ext  0xFD

I ran the controller connected to usb (no motors or external power) for over 3500 lines of g-code without error. Previously it would error some where between when it connected (before the build even started) and definitely before 200 lines of g-code.

I hooked up my motors and ran another build. I haven't built a frame yet, I've got other projects to finish first, but it ran the motors for a full build (11222 lines, the sample build-benchmart.stl), so we'll call it good for now.

From what I have been able to find the fuse settings for the Sanguino and Mighty 1284p are just plain wrong for the Sanguinololu. They are for a external crystal oscillator. Apparently the full sweep oscillator setting is required for a resonator. The above settings seem very stable so far.

UPDTATE: I just got a 644p to play with, I haven't had a lot of time for testing yet, but it seems stable on both the default settings (ext crystal osc) and my modified fuse settings. I think almost everyone uses the 644p and this may be the reason I haven't found anyone else with this problem. I'm inclined to believe that my setting (full swing osc - ceramic resonator) is correct for both micros, but the 644p doesn't mind the wrong setting nearly as much as the 1284p. I've still got more tests to run on it, so I'll update as I go.

Monday, December 26, 2011

Laptop on a wall

What do you do when you get a laptop with a broken screen? I priced a screen and it cost half a new laptop.

I've been using my laptop as a desktop for several years now and the biggest problem I've run into is the amount of space it takes up on my desk. I could shove it in a drawer or something, but then I can't turn it on...

A while back my father broke the screen on his laptop, after pricing a new screen he bought a new laptop, and the old one was buried in a closet. I've been pondering what to do with it ever since, it seemed a waste to just throw it out.

I finally decided to mod the power switch so it would be outside the case, then I could shove it somewhere and still turn it on and off, unfortunately it won't power on when the lid is closed. 

I've always liked "naked" electronics. All the components, right there for anyone to see, no silly plastic designed to look good, covering up an amazing array of traces, chips, caps, etc. So I tore it down, mounted it to the wall and hooked it up. I'm thinking about a plexiglass cover and some sort of frame to hide the wires eventually. I think it's cool, and I now have half my desk back.



RobertShaw HV SP715A furnace ignition module

House call today, a furnace wasn't heating, seems this usually happens on a bitter cold weekend, that's a holiday, and usually after any store that might have be open earlier is closed. Today's wasn't quite that bad, but I have to say it. Anyway, here's the run down from the phone conversation:
  • Pilot was lit
  • Thermostat was calling for heat
  • Breakers were on
  • Main burner wasn't coming on
I was thinking a bad limit, transformer, or gas valve (not much else on a simple pilot furnace)., But when I arrived I found the furnace was actually a HV (Spark) ignited furnace.

Sorry about the quality, cell phone in basement, at least I took a picture of it.
The  Robertshaw sp715a control box:
  1. Turns on the pilot gas
  2. Jumps a spark until it senses a flame
  3. Turns on the main burner
Since it wasn't trying to light the pilot (audible clicking and a visible spark in the pilot area) it had detected that the pilot was lit, but for some reason the main burner was off. A quick check with a multimeter verified 28vac at the pilot terminal, and about 2vac at the main burner terminal. I was trying to pull the thermostat wire off the control when the main burner suddenly lit! Surprised, I let go and pulled my hand out as the burner shut off. I tried it again, confirming when I pulled on the wire (and flexed the PCB it was connected to) the burner came on.

You can't really see them in the picture, but 2 of the solder joints on the big black relay that controls the main burner were cracked. I had to run to a store to buy a soldering iron (a $6 firestarter), but it was quicker than driving home to solder them. I resoldered and reassembled the furnace. They've got heat and didn't have to buy a $100 module (or wait in a cold house until I could get one either).
Steve

UPDATE: A Few Links




Wednesday, December 14, 2011

Sanguinololu 1.3a - Part 2: Trouble in Paradise

See Also:
Part 1 - Build
Part 3 - Not Out of the Woods Yet

Part 2 of my RepRap build. As noted in part 1 I had some trouble right off the bat.

NOTE: Part 3 include additional information concerning the bootloader and fuse settings. I highly recommend you read it before burning your bootloader


FTDI 
 According to the Sanguinololu wiki page, you should test the FTDI chip after installing the USB port and related components. all you have to do is:

1. Plug the board into your computer.
2. Install the driver software.
3. Connect to the COM port with something like Putty
4. Short the RX0 and TX0 pins together (use a piece of wire or something, it needs to work for about 1 second, don't worry about soldering it or anything.)
5. Type stuff on your keyboard, it should show up when the pins are shorted, and stop when disconnected.
6. If this worked your FTDI chip is operating properly.



 Of course this did not happen for me. The first board my brain wasn't fully engaged and I forgot to add flux, then tried to solder it with an iron, even though I had a hot air reflow station just sitting there. Stupid! I managed to bend a couple pins slightly up, just enough that they wouldn't connect.

 So after a half hour of fixing it all looked good, but the computer didn't recognize anything attached. I went over the pins one at a time with a soldering iron with a really fine tip, just putting a little down pressure on each one. Now the computer recognized it, loaded up putty and the loopback worked fine. 


The second board I did with the hot air and a good dose of flux. It looked beautiful compared to my first attempt, like a factory placed chip. It was immediately recognized by the computer, but the loopback didn't work. I took it off, ran a blob of solder across the pads to wet them, removed the excess, and replaced the chip on the board. Then it worked fine.

 Bootloader


 The wiki said the ATMEGA1284p was a drop in replacement for the 644p. I checked the specs, for a dollar or so more I'd go for the 1284p. Now, I'm not quite sure what they mean by "drop in compatible", it does indeed fit in the slot and it does indeed work with the board. After 5 hours of hacking. The first problem was the bootloader. I downloaded the 0023 version from here (the options were 0018, which doesn't support the 1284p and 0023 which does). I had arduino version 0022 and that didn't work. I downloaded 1.0, that seemed to. I burned the bootloader with the Arduino ISP as noted in the wiki. At some point I changed the last 3 line of hardware /  Sanguino / boards.txt to:


atmega1284.build.mcu=atmega1284p
atmega1284.build.f_cpu=16000000L
atmega1284.build.core=arduino


It seemed to burn fine, no errors.

 Using an Arduino to Flash the bootloader onto a 1284p

I put the chip in the Sanguinololu plugged it in and loaded the Sprinter firmware into arduino 1.0 (despite it claiming to not work with 1.0) Surprise! it errored out on the compile, couldn't find "arduino.h". Also wouldn't compile with 0022 (don't remember the exact error), but claimed to be compatible with 0018, so I downloaded that.

UPDATE: The "arduino.h" error can be corrected by creating "INSTALL_LOCATION/Arduino-1.0/hardware/Sanguino/cores/arduino/Arduino.h" and putting "<#include WProgram.h>" in it. I didn't figure this out, but I lost the reference. (Semi off-topic note: replace "Sanguino" with "Arduino" for other boards - uno, duemilanove, etc.)

It compiled fine with 0018, I copied the Sanguino files from the hardware folder of 1.0 over and tryed to upload it to the board. Nope, 0018 has no idea what a 1284p is. I finally managed to get the following fron 1.0's hardware/tools/avr/etc/avrdude.conf:


#------------------------------------------------------------
# ATmega1284P
#------------------------------------------------------------

# similar to ATmega164p

part
    id               = "m1284p";
    desc             = "ATMEGA1284P";
    has_jtag         = yes;
    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode   = 0x74;
    signature        = 0x1e 0x97 0x05;
    pagel            = 0xd7;
    bs2              = 0xa0;
    chip_erase_delay = 9000;
    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                       "x x x x  x x x x    x x x x  x x x x";

    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                       "x x x x  x x x x    x x x x  x x x x";

    timeout        = 200;
    stabdelay        = 100;
    cmdexedelay        = 25;
    synchloops        = 32;
    bytedelay        = 0;
    pollindex        = 3;
    pollvalue        = 0x53;
    predelay        = 1;
    postdelay        = 1;
    pollmethod        = 1;

    pp_controlstack     =
        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay    = 100;
    progmodedelay       = 0;
    latchcycles         = 6;
    togglevtg           = 1;
    poweroffdelay       = 15;
    resetdelayms        = 1;
    resetdelayus        = 0;
    hvleavestabdelay    = 15;
    chiperasepulsewidth = 0;
    chiperasepolltimeout = 10;
    programfusepulsewidth = 0;
    programfusepolltimeout = 5;
    programlockpulsewidth = 0;
    programlockpolltimeout = 5;

    idr                 = 0x31;
    spmcr               = 0x57;
    allowfullpagebitstream = no;

    memory "eeprom"
        paged           = no; /* leave this "no" */
        page_size       = 8;  /* for parallel programming */
        size            = 4096;
        min_write_delay = 9000;
        max_write_delay = 9000;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
    read            = "  1   0   1   0      0   0   0   0",
                          "  0   0   x   x    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

    write           = "  1   1   0   0      0   0   0   0",
                          "  0   0   x   x    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

    loadpage_lo    = "  1   1   0   0      0   0   0   1",
              "  0   0   0   0      0   0   0   0",
              "  0   0   0   0      0  a2  a1  a0",
              "  i   i   i   i      i   i   i   i";

    writepage    = "  1   1   0   0      0   0   1   0",
              "  0   0   x   x    a11 a10  a9  a8",
              " a7  a6  a5  a4     a3   0   0   0",
              "  x   x   x   x      x   x   x   x";

    mode        = 0x41;
    delay        = 10;
    blocksize    = 128;
    readsize    = 256;
      ;

    memory "flash"
        paged           = yes;
        size            = 131072;
        page_size       = 256;
        num_pages       = 512;
        min_write_delay = 4500;
        max_write_delay = 4500;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
        read_lo         = "  0   0   1   0      0   0   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

        read_hi         = "  0   0   1   0      1   0   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

        loadpage_lo     = "  0   1   0   0      0   0   0   0",
                          "  0   0   x   x      x   x   x   x",
                          "  x  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

        loadpage_hi     = "  0   1   0   0      1   0   0   0",
                          "  0   0   x   x      x   x   x   x",
                          "  x  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

        writepage       = "  0   1   0   0      1   1   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7   x   x   x      x   x   x   x",
                          "  x   x   x   x      x   x   x   x";

    mode        = 0x41;
    delay        = 10;
    blocksize    = 256;
    readsize    = 256;
      ;

    memory "lock"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
                          "x x x x  x x x x   x x o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
                          "x x x x  x x x x   1 1 i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "lfuse"
        size            = 1;
        read            = "0 1 0 1  0 0 0 0   0 0 0 0  0 0 0 0",
                          "x x x x  x x x x   o o o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 0 1 0  0 0 0 0",
                          "x x x x  x x x x   i i i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "hfuse"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 0 0 0",
                          "x x x x  x x x x   o o o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 0 1 0  1 0 0 0",
                          "x x x x  x x x x   i i i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "efuse"
        size            = 1;

        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 0 0 0",
                          "x x x x  x x x x  o o o o  o o o o";

        write           = "1 0 1 0  1 1 0 0  1 0 1 0  0 1 0 0",
                          "x x x x  x x x x  1 1 1 1  1 i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "signature"
        size            = 3;
        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
      ;

    memory "calibration"
        size            = 1;

        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
        ;
  ;

It goes right above:
#------------------------------------------------------------
# ATmega162
#------------------------------------------------------------
Now I get a
avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
Which basically means "something is wrong". It can't connect to the chip at all. I fought with this for a while, and it just wouldn't connect. Even 1.0 refused, not even the "blink" sample code.

I reburned the bootloader with the 8mhz and 16mhz options (the 644p option errored as not the right chip, so the arduino isp was communicating), neither worked, I changed the
"atmega1284.build.f_cpu=16000000L" to "atmega1284.build.f_cpu=8000000L" (as it was 
originally), commented the last 3 lines out (as they were originally), nothing worked.

Finally, when I was thinking I had bricked the chip I found a different bootloader for the 1284, the Mighty 1284p. I burned the bootloader, popped the chip back in the Sanguinololu, and uploaded the blink code.  It Worked! I had a square wave on the scope and everything!

Unfortunately Mighty 1284p is only compatible with arduino 1.0. Using the Sanguino 1284p 16mhz setting in 0018 couldn't upload sprinter. I changed the settings in the Sanguinololu boards.txt to match the Mighty 1284p and Sprinter uploaded fine.

I don't know if the Sanguino bootloader would have worked with 0023, I'm assuming it's something with my setup. The 644p is compatible with 0018, as is Sprinter, if I had known the trouble it would be to get Sprinter on the 1284p I'd have bought 644p's. But it's done, and I'm happy.
Steve


UPDATE
I decided I hadn't given the Sanguino bootloader a fair chance, it was for 0023 and I didn't use that.

I downloaded Arduino 0023, decompressed the Sanguino files into the hardware directory. Same thing, had to do both of the above hacks to get it to write the bootloader, which it again completed successfully. Exactly the same problem too, unable to upload Sprinter (or blink) to it.

I put the Mighty 1284p bootloader back on and uploaded Sprinter fine. Is something different about my chips? My ISP? Who knows? I sure don't.
Steve

Sanguinololu 1.3a - Part 1: Build

See Also:
Part 2 -  Trouble in Paradise
Part 3 - Not Out of the Woods Yet

I've been playing with electronics a bit lately. I've built a bench power supply and an ESR Meter.

I make a case for the Power supply out of an old atx psu case, but haven't found a good one for the ESR meter.

Then I found the RepRap. Of Course! Why buy a box for $5 when I could build a machine that would print me one for just $500? So it was settled.

Oh yea, my brother is building a cnc machine and after the tedious job of wiring up those two projects a cnc pcb router seemed like a really good idea. I'm not sure if the reprap frame is sturdy enough for what I have in mind, but I'm going to build something along that line. Of course the most fun part of the whole project is the electronics. After looking around a bit I decided to build a Sanguinololu to control the machine.

I bought bare PCB's, and assembled pololu (stepstick) boards from ebay, all the components from Mouser (BOM from the Sanguinololu page)

The FTDI Chip Installed:
The USB jack and related Components:
The Pololu Headers, decoupling Caps, etc:
I'm really bad about taking pictures, I am improving, but at this point I got busy and stopped taking pictures, so we skip way ahead to the completed board:
The Pololu Drivers arrived the today:
The Pololu drivers came with tiny heatsinks, here is the completed board, drivers and all:

I did one Sanguinololu for my brother and one for me, the first took about 6hrs, the second about 2. I had some trouble and I'll cover that in another post.
Steve

Saturday, October 22, 2011

Wild and wacky touch screen repair


I really need to start taking pictures of this stuff. I'm kicking myself right now.

OK, Here's a good one. My dad's gps broke. The touch screen became unresponsive. You couldn't get it to do anything at all.

I tore it apart, all the ribbons and connectors looked ok. It was one of those "It's no use to me as it is, so if you completely ruin it it's no big loss." situations.

So I peeled the touch screen apart, looked it over, and put it back together. That didn't fix it, so I started peeling it apart with the unit powered on. After I got the top separated it started working, something on the top was shorting, so I put a piece of clear tape along the upper edge (above the viewable area), stuck the screen back down, and it's still working.

I recommend you do this only when you have nothing left to loose. It was a resistive touchscreen, I doubt it would work with a capacitive one.
Steve

Sunday, September 4, 2011

Dead Dryer and Noisy Refrigerator

Two appliance issues I've fixed lately, not super interesting, but may be useful anyway. I don't fix appliances very often, so I usually do some head-scratching at some point.

1. Kenmore Dryer - A friend bought a new (used) washer and dryer to replace their old, non-functioning ones. after hauling the old ones up the side of a hill and the new ones down it, they discovered the dryer did nothing. Not wanting to haul it back up, they called me. I had him check a few things over the phone, but really didn't learn anything from that. It didn't appear to be getting power.

In hindsight I should have checked the door switch sooner, but I was stuck on a no-power train of thought. It only took a few minutes anyway, thankfully they're not as complicated as cars.

  • With the back cover off I verified the thermal fuse was OK and I definitely had power there. 
  • After a great deal of head scratching I thought it seemed like something had come unplugged, the door light wasn't on when the door was open and the wires to the switch were the only ones I couldn't see. 
  • Most dryers you pull forward and then up to open the top. They swing up on little spring clips that let it move forward enough to clear the front clips. Popping the lid up it became apparent that somehow the wires going to the door switch had come apart at the connector. I really don't know how it separated, it clipped back together firmly enough I didn't think it just popped apart on it's own. But,it's working now.
  • Model # 110.76642500 or 110.7163102 - I have two model numbers written down, not sure which is right.


2. Freezer on bottom refrigerator - My grandparents refrigerator started making funny noises, I thought sounded like bad fan bearings (I could hear it over the phone, sounded really bad).

  • At first I thought it was the fan on the outside, underneath the machine, but besides being very dusty, it make no unusual noises. 
  • That one eliminated left the one inside that circulated cold air through the refrigerator. After removing everything that blocked access to it (and there was a lot in the way) I could see the fan. It's bearings were also OK. So I plugged it back in, hoping to see something change, and did I ever. 
  • It seems that ice builds up in the passage between the refrigerator and freezer. Every once and a while it breaks free, falling back down the passage onto the fan, which flings it at my face. 
  • I'm blaming it on a spell of high humidity and poor design. If something deflected the ice away from the fan it wouldn't have to grind it up with it's little plastic blade. or if the fan was located at the top the ice would fall away from it, like a freezer on top model. 

Dodge 46RE First and Second Gears Only

A friend got a deal on a older Dodge 4x4 truck. It ran great, drove fine except it wouldn't shift past 2nd.
The possibilities are as follows: 
  • Speed sensor
  • Electrical Wiring
  • PWM Solenoid / pressure sensor (typically replaced together)
  • Computer
  • Internally broken parts
A little background:
The Dodge 4xRE RWD transmissions are descendents of an earlier design. Before computer controls they used a centrifugal governor and throttle cable to control shifts. When GM and Ford went to computer controls they used a PWM (pulse width modulation) solenoid for mainline pressure and solenoids for shifting, eliminating the throttle and governor systems. Dodge left the throttle cable, and replaced the mechanical governor with a PWM solenoid and a pressure sensor controlled by the computer. With the exception of 4th, as it is independently controlled by the computer via it's own solenoid, the 4xRE's all depend on the governor pressure to know which gear to be in.

Diagnosis:
We were fortunate to have a 44RE core to steal parts from.
First was getting it here, it would be a long drive in 2nd, so I had him pull the electrical connector off, hoping for third. I didn't know if this would work or not, depending what was wrong, but fail-safe is third so it was worth a try. It worked, so the actual transmission was OK, just something in the controls. (Note: even with the electric off, if it was still stuck in 2nd, it could still have been the governor solenoid stuck)

  1. The speed sensor is a 1 minute swap, we had one, so that was the place to start. But it made no difference.
  2. A visual inspection of the wiring showed no problems, and we didn't have a spare computer to try (that would be #4 anyway).
  3. The Governor solenoid / pressure sensor combo is a very common problem with these transmissions, what happens is over time they get fine metal shavings in them until the solenoid sticks (it is a magnet). This was my guess from the start, but you have to drop the pan to get too them, so don't overlook something obvious. We dropped the pan, swapped them with the ones off my junk tranny (Note: these are such a common problem it is recommended to replace with new every time. He didn't have the money for new, so used it was) That solved it, had 4 forward gears and he was happy.
Notes:
  1. While you have to drop the pan to get to the sensors, they are east to access, being bolted to the bottom of the valve body, on their own little block of aluminum. 
  2. KEEP IT CLEAN! Any dirt is very bad inside a valve body.
  3. USE A TORQUE WRENCH ON THE VALVE BODY! They are particularly sensitive to that sort of thing. (35in lbs. I think)
  4. There is an alternative setup for this using a GM PWM solenoid. They claim it stops this sort of thing from ever happening again. I haven't tried one yet, but definitely would, especially on a tranny that has given me problems.
  5. Don't overlook the obvious, Yes, I was right this time, but it could have been something else. Like the speed sensor, and if I'd gone with my gut and been wrong, I'd have spent an hour fixing something that would have taken a minute.
  6. Most vehicles fail-safe to third (actually direct drive, could be 4th in a 5 or 6 speed auto tranny) in drive, and the manual 1st, 2nd, etc. still work. You can manually shift these to prevent damage - Fail-safe third is third all the time, you will eventually damage something if you don't.
  7. The background may be over-simplified, but contains enough information for my purposes.