My son's 24'' MTB conversion

cybug

10 mW
Joined
Sep 13, 2013
Messages
28
Location
France, Montpellier
VTT_NOE_33.jpg


More pics : https://plus.google.com/photos/+GuillaumedeBailliencourt/albums/6028938144325737009

13614951354_6ac968d5cf.jpg

Pics of the DIY Spot welder and battery pack welding : https://www.flickr.com/photos/95721093@N05/sets/72157643383857074/
 
Nice spot welder, do you have info on the design. I've seen microwave ones created, but have not seen your version with the display.
 
You might want to check he has enough tyre clearance to the battery to accommodate the front suspension travel, it might prevent a face plant! Difficult to tell from a pic, he may have checked and it is safe to use?
 
Tench said:
You might want to check he has enough tyre clearance to the battery to accommodate the front suspension travel, it might prevent a face plant! Difficult to tell from a pic, he may have checked and it is safe to use?


That was the first thought on my mind too...looks dangerously close.
 
Tench said:
You might want to check he has enough tyre clearance to the battery to accommodate the front suspension travel, it might prevent a face plant! Difficult to tell from a pic, he may have checked and it is safe to use?


Yes of course ! Double checked ! It doesn't touch in any case, even with me (90Kg, twice the weight of my son) on it, pushing and braking as tough as I can. The fork got only about 50mm effective travel.
 
kfong said:
Nice spot welder, do you have info on the design. I've seen microwave ones created, but have not seen your version with the display.


It's based on this one : http://www.avdweb.nl/tech-tips/spot-welder.html

I've replaced the Inverse parallel SCRs (I burnt) with a SSR from ebay ( http://www.ebay.fr/itm/24V-380V-40A...ate-Relay-Module-3-32V-DC-To-AC-/310733040176 ).

I've modified the firmware to support push buttons and display :

Code:
/* 
Arduino resistance spot welder timer
 
Copyright (C) 2012  Albert van Dalen http://www.avdweb.nl
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.gnu.org/licenses .
Version 10-9-2013

Guillaume de Bailliencourt (Cybug) : Add support for menu with push buttons and display.
*/
 
#if ARDUINO >= 100 
  #include "Arduino.h"
#else
  #include "WProgram.h"
#endif
//#include <Streaming.h>
#include "switch.h"

// using LiquidCrystal library
#include <LiquidCrystal.h>
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// define some values used by the panel and buttons
int lcd_key     = 0;
int adc_key_in  = 0;
#define btnRIGHT  0
#define btnUP     1
#define btnDOWN   2
#define btnLEFT   3
#define btnSELECT 4
#define btnNONE   5
 
const byte spotWelderButtonPin = 52; 
const byte spotWelder = 53;
 
bool continuousWelding = 0; // enable continuous welding
bool startWelding = 0;
unsigned long startWeldTime = 0;
int iterWeld = 0;
int preWeld_ms = 50;
int step_ms = 150;
int weldPause = 500;
int tSelect = 3;
 
Switch spotWelderButton(spotWelderButtonPin);
 
void setup() 
{ Serial.begin(9600);
  pinMode(spotWelder, OUTPUT);
  lcd.begin(16, 2);              // start the library
  updateDisplay(0);
}
 
void loop() 
{
   
 
  spotWelderButton.poll();
  if(continuousWelding) weld(spotWelderButton.on());
  else  
  if(spotWelderButton.pushed()) weldCyclus(step_ms);

 //lcd.setCursor(0,1);            // move to the begining of the second line
 lcd_key = read_LCD_buttons();  // read the buttons

 switch (lcd_key)               // depending on which button was pushed, we perform an action
 {

   case btnRIGHT:
     if (!continuousWelding) {
       tSelect += 1;
       if (tSelect >=4) tSelect = 1;
       updateDisplay(300); 
     //lcd.print("RIGHT ");
     }
     break;
   case btnLEFT:
     if (!continuousWelding) {
       tSelect -= 1;
       if (tSelect <=0) tSelect = 3;
       updateDisplay(300); 
       //lcd.print("LEFT   ");
     }
     break;
   case btnUP:
     if (!continuousWelding) {
         if (tSelect == 1)
          preWeld_ms += 1;
        else if (tSelect == 2)
          weldPause += 50;
        else
          step_ms += 10;
    
     updateDisplay(300); 
     //lcd.print("UP    ");
     }
     break;
   case btnDOWN:
     if (!continuousWelding) {
         if (tSelect == 1)
          preWeld_ms -= 1;
        else if (tSelect == 2)
          weldPause -= 50;
        else
          step_ms -= 10;
          
       updateDisplay(300); 
     //lcd.print("DOWN  ");
     }
     break;
   case btnSELECT:
     {
       continuousWelding = !continuousWelding;
       updateDisplay(300); 
     //lcd.print("SELECT");
     break;
     }
     case btnNONE:
     {
     //lcd.print("NONE  ");
     break;
     }
 }
}

void updateDisplay(int ms_delay)
{
  lcd.setCursor(0,0);
  
  if (continuousWelding)
  {
    lcd.print(" Welding while  ");
    lcd.setCursor(0,1);
    lcd.print(" pressing pedal ");
    delay(ms_delay);
    return;
  }
  
  if (tSelect == 1)
    lcd.print("<Pre>Pause Weld ");
  else if (tSelect == 2)
    lcd.print(" Pre<Pause>Weld ");
  else
    lcd.print(" Pre Pause<Weld>");
    
  lcd.setCursor(1,1);
  lcd.print("     ");
  lcd.setCursor(1,1);
  lcd.print(preWeld_ms);
  
  lcd.setCursor(5,1);
  lcd.print("      ");
  lcd.setCursor(5,1);
  lcd.print(weldPause);
  
  lcd.setCursor(11,1);
  lcd.print("     ");
  lcd.setCursor(11,1);
  lcd.print(step_ms);
  
  delay(ms_delay);
}
 
void weldCyclus(int weldTime_ms)
{ 
  lcd.setCursor(0,0);
  lcd.print(" << WELDING >>  ");
  
  //lcd.setCursor(0,1);
  //lcd.print(">");
  
  pulseSpotWelder(preWeld_ms);
  /*
  lcd.setCursor(0,1);
  lcd.print(" ");
  lcd.setCursor(4,1);
  lcd.print(">");
  */
  delay(weldPause);
  /*
  lcd.setCursor(4,1);
  lcd.print(" ");
  lcd.setCursor(10,1);
  lcd.print(">");
  */
  pulseSpotWelder(weldTime_ms);
  
  //lcd.setCursor(10,1);
  //lcd.print(" ");
  
  updateDisplay(0);
}
 
 void weld(bool b)
{ digitalWrite(spotWelder, b);
  if (b)
  {
      lcd.setCursor(0,0);
      lcd.print(" << WELDING >>  ");
      if (startWelding != b)
      {
        startWeldTime = millis();
        startWelding = b;
        lcd.setCursor(0,1);
        lcd.print("                ");
      }
      
      if ((iterWeld++ % 50) == 0)
      { 
       lcd.setCursor(0,1);
       lcd.print("    ");
       lcd.print(millis() - startWeldTime);
       lcd.print("ms");
      }
  }
  else
  {
    startWelding = 0;
    iterWeld = 0;
    updateDisplay(0);
  }
}

void pulseSpotWelder(int ms)
{ digitalWrite(spotWelder, 1);
  delay(ms); 
  digitalWrite(spotWelder, 0);
  //Serial << ms << endl;  
}

// read the buttons
int read_LCD_buttons()
{
 adc_key_in = analogRead(0);      // read the value from the sensor 
 // my buttons when read are centered at these valies: 0, 144, 329, 504, 741
 // we add approx 50 to those values and check to see if we are close
 if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result

 // For V1.0 use the one below:

 if (adc_key_in < 50)   return btnRIGHT;  
 if (adc_key_in < 195)  return btnUP; 
 if (adc_key_in < 380)  return btnDOWN; 
 if (adc_key_in < 555)  return btnLEFT; 
 if (adc_key_in < 790)  return btnSELECT;


 return btnNONE;  // when all others fail, return this...
}
 
Back
Top