Tent Repair

Slim column of metal with a bulge in the middle and a hole drilled through either end.Some years ago, setting up a tent in the dark, I pushed some parts too hard and a piece of an alloy strut failed. It’s the sort that are connected together with elastic, and each bit of the strut fits into the next. So, today I finally fixed it. I talked it over briefly with Mat, came up with a plan, found the right bit of metal, came up with a better plan, and got going.

I took a cylinder of aluminium down to the right size for a shoulder on the lathe, and then narrowed both ends of that. One part fitted into the bigger end of a strut, one part fitted into the smaller end. Then I sawed off the bits that were bent, losing about as much material as I had length of shoulder. (Because they are socketed, some of what I was cutting off was not adding to the length.) I drilled through the ends so I could run wires through. My original plan was to drill through from both ends and have the elastic run through the middle, but that would have left me with a difficult job of making, and I decided to anchor the elastic to either end of a solid piece.

I was going to flatten the ends so there was room for the wire to pass, but about then my concentration ran out, thanks to a combination of exhaustion, lack of tea, and people talking to me. Mat had already told me how to mill down the ends, and he was kind enough to do the cutting for me, after some mutual cursing at the machine. The rounded bits in the picture are my work; the flat bits, and the fact I didn’t have to do it by hand at home, are his.

Now it only remains to test-drive the work. Given I live in England and it’s summer, I may have to go abroad to do that.

Pi-Puter Notes

Useful and not so useful notes on this project.

I’m breaking it down into pre-computer tasks, rather than trying it all at once. So, organising the power supply for the pi, organising the power supply for the peripherals, and so on. I’ll need to do sound and video, wireless, and a few other things.

Pi-Puter project

I’ve got a love-bored relationship with the Raspberry Pi. On the one hand, it’s a fantastic piece of kit and really cool and you can do stuff with it. On the other hand, I don’t have anything I need to do with it. I’ve got a few ideas about things I /could/ make, but nothing has really shouted. However, I also have an old computer case that I could hack about, which has a known good power supply I don’t know to be bad, and I could make a low-powered but fun working computer out of that. I could embed everything I need into the CD and HD racks in the case, and have nothing actually show if you look into it through the fan outlets. There could be LEDs. Blue ones.

I’d need a screen, a powered hub, the pi and peripherals, and what else? Oh, tea. And a severe hatred for all mankind. Luckily, I have most of that stuff.

Sparky – resistor array

Sparky’s first spark-board resistor was 100ishR, 1/8W, and the magic smoke escaped instantly. The second was 50R, a couple of orders larger in wattage, and much much bigger, and made of metal. After we’d been running the spark table for a while, there was a wisp of smoke from the table, which was starting to melt. So we found four of those in an array, and we wired them up to give us 50R, and they get uncomfortably hot to touch. They’re mounted on an aluminium plate.

Today, Mat converted a lump of car radiator into a heat sink, drilling and tapping all the holes necessary to fit five waaaay chunkier 10R resistors on so we can wire them up with crocodile clips. If we need to water cool them, we can borrow some resistors from someone I know who worked in sound. If /that/ fails, he was telling me about spikes and power switching, and that’s a spare thought. However, this array ought give us a good range from 2-50R, depending on how we wire them, and if 2 Ohms doesn’t set fire to anything, we’re likely to stick with that.

Today, I helped by making tea and not getting in the way, and as a san-check on the positioning of the drill holes, and I also learned a bit about clamping. Mat helped by doing all of the work, and not fucking it up, and also by making tea.

Sparky v2 – latest code

The code for Sparky Version 2 is just about finished. I need to swap something I did back-to-front with something Mat did far more elegantly and in fewer lines, but the logic’s sound. Here, with a bit of editing, is Oxygen v7. V1-5 were debugging programs of various sorts.

/* Version 7 of Oxygen is the software implementation.
 * 
 * We do not use pins 0 & 1 (RX/TX) for the main board.
 * We scan LVL after smoothing, compare to the set voltages of 'max_trigger', and 'min_trigger' trigger DIR to 1 or 0 if we want to move.
 * We then hit STEP.
 * Pins should be set to cross directly to DIR and STEP, on veroboard.
 * For convenience, we begin crossing at pin 3, with pin 2 being the zoom toggle
 * 
 * For debugging, we output LVL, MAX, MIN, DIR to serial, and comment that out.
 * 
 * Arduino takes in LVL and four cut-out or direction override pins, plus one 'zoom' pin to speed up or slow down stepping in software, and outputs 7 pins - M0, 1, 2, Step, Dir, /Sleep, /Reset

 */

// hardware constants for board input/output

const int ledPin = 13;
const int zoomPin = 2;  // earth to 0v on Arduino board to increase speed (decrease software delay)

// digital (output) pins (Arduino Pro Mini matched to DRV8825 Stepper Driver)
const int dirPin = 3;
const int stepPin = 4;
const int sleepPin = 5;
const int resetPin = 6;

// step size pin array
int mPins[3] = {7, 8, 9};
const int mPinCount = sizeof(mPins)/sizeof(int);
int mPinStates[mPinCount] = {};
// char *mPinNames[mPinCount] = {"M0", "M1", "M2"};  // Probably only ever in debugging/humanised printing

// Input for cut-outs and manual drive
const int upperCutoutPin = 10;
const int lowerCutoutPin = 11;
const int driveUpPin = 15;  // A1 Can be used as digital pin.
const int driveDownPin = 16;// A2 can be used as digital pin.

// analogue (measurement) pins
const int levelPin = A0;

// measurement constants
/* lvl = 0...1023 (corresponding to 0 to 5v ish) */

const int AnalogReadsPerVolt = 200;  //1000 ish corresponds to 5v

#define volts  // defines volts as a word to ignore by defining it as blank

const int max_trigger = 1 volts * AnalogReadsPerVolt;
const int min_trigger = .1 volts * AnalogReadsPerVolt;

// measurement variables

int lvl = 0;

// move-related variables and calculations

int move_rate = 100;  // Used for speeding up/slowing down in software
int step_ratio = 1;   // Valid options, 1, 2, 4, 8, 16, 32
int step_index = 0;   // used to keep track of which result we want
int stepsize_results[] = {32, 16, 8, 4, 2, 1};
const int stepsize_count = sizeof(stepsize_results) / sizeof(int);
int modePinSettings[stepsize_count] = {5, 4, 3, 2, 1, 0}; // read from High/Low table in docs, M2 first

/* Finds index within modePinSettings, to give us a later result */
int find_index(int array[], int count, int value)
{
  int i;
  for(i=0; i>= 1;
  }
  
  
  digitalWrite(sleepPin, HIGH); // /SLEEP - high to suppress behaviour
  
  // Reset Stepper Board 
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH); // /RESET
  digitalWrite(ledPin, HIGH);

  //Serial.print("Initialised with min ");
  //Serial.println(min_trigger);
  
}

void loop()  {
  
  
  if(digitalRead(zoomPin) == LOW){  // move rate will appear twice in each loop that moves, once in each loop that does not move
    move_rate = 50;
  } else {
    move_rate = 500;}
  //Serial.print("zoomPin: ");
  //Serial.print(digitalRead(zoomPin));
  //Serial.print("move_rate: ");
  //Serial.println(move_rate);
  
  
  if(digitalRead(driveUpPin) == LOW) {
    //Serial.println("Drive pin: Up.");
    stepUp(move_rate);
  } else if(digitalRead(driveDownPin) == LOW) {
    //Serial.println("Drive pin: Down.");
    stepDown(move_rate); // Behaviour under thick fingers: shout at clumsy person
  } else {  

    lvl = analogRead(levelPin);
    
    if(lvl < min_trigger) {
      //Serial.println("Calling stepUp()");
      stepUp(move_rate);
      // //Serial.println("Moving Up.");  // debugging line
    }
    else if(lvl > max_trigger) {
      //Serial.println("Calling stepDown()");
      stepDown(move_rate);
      // //Serial.println("Moving Down.");  // debugging line
    } else {//Serial.println("Fallthrough.");
    } // lvl not triggering either threshold.  Try earthing it to be sure it goes up.
  }
}

Sparky v2 – analogue and digital

Veroboard with wires, an arduino, and some smoothing capacitorsI’ve soldered up most of the board for Sparky v2, meaning I now know which pins connect where. The Arduino has analogue pins that can also be used for digital input, so although I’m technically out of digital pins, that’s not really a problem. I’ll be testing that theory soon, using a digital read instead of an analogue read, and I’m pretty sure it’ll end up fine. I’ve written the code, soldered most things, but need some small push buttons to test the code entirely, and I don’t want to put on the stepper driver chip before it’s entirely tested.