Wednesday, January 29, 2020

Breadboarding and Fritzing

I had an interesting situation presented to me last week when a couple of Grade 7 students asked for help with Arduino. Sensing a greater play at work I asked what they were trying to accomplish and it turns out they had purchased a NEMA17 1.7amp stepper motor from Amazon and wanted to make a moving arm model for science fair.

It took me a few seconds to gather my thoughts but it turns out they had a family friend who had constructed one similar and suggested to them to acquire the necessary materials. Unfortunately, said friends neglected to over Arduino basics, breadboarding or stepper motors controls.

It gave me an opportunity to revisit the Arduino and pinning out of various components and modules, and also gave me opportunity to play with Fritzing, a handy breadboarding/circuit diagram planning program. Note that there is a Homebrew Formulae for Fritzing at: /api/cask/fritzing.json

I ordered some A4988 stepper drivers and Easydrivers and set it all up on a small board. Inputted some quick code (see below) and printed out the diagram:




/*this code controls a stepper motor
 * it uses two push buttons on a breadboard
 * one is forward and the other is reverse
 * StepForward and StepBack tell the motor what to do when a button is pushed
 * adjust the x< value for rotations
 * adjust the delay for speed
 */
 
#define stp 2
#define dir 3
#define MS1 4
#define MS2 5
#define EN  6

const int button1Pin = 7;
const int button2Pin = 8;
const int ledPin =  13;
int button1State = 0;
int button2State = 0;

char user_input;
int x;
int y;
int state;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(button1Pin, INPUT);
  pinMode(button2Pin, INPUT);
    
  pinMode(stp, OUTPUT);
  pinMode(dir, OUTPUT);
  pinMode(MS1, OUTPUT);
  pinMode(MS2, OUTPUT);
  pinMode(EN, OUTPUT);
  resetEDPins();
}

void loop() {
      button1State = digitalRead(button1Pin);
      button2State = digitalRead(button2Pin);
      
      if (button1State == HIGH) {
        digitalWrite(EN, LOW);
        StepForward();
        resetEDPins();
        delay(1000);
      } 
      if (button2State == HIGH) {
        digitalWrite(EN, LOW);
        StepBack();
        resetEDPins();
        delay(1000);
      }else {
        digitalWrite(ledPin, LOW);
      }
}

void resetEDPins()
{
  digitalWrite(stp, LOW);
  digitalWrite(dir, LOW);
  digitalWrite(MS1, LOW);
  digitalWrite(MS2, LOW);
  digitalWrite(EN, HIGH);
}

void StepForward()
{
  digitalWrite(dir, LOW);

  for(x= 1; x<500; x++)
  {
        digitalWrite(stp,HIGH);
        delay(1);
        digitalWrite(stp,LOW);
        delay(1);
    }
}

void StepBack()
{
 digitalWrite(dir, HIGH);
  for(x= 1; x<1000; x++)
  {
    digitalWrite(stp,HIGH);
    delay(1);
    digitalWrite(stp,LOW);
    delay(1);
  }
}

Tuesday, January 28, 2020

Slicer 360 and 3D models

I've been having some fun with cutting larger 3D models using Slicer 360. It allows import of .STL files and slices them into a variety of interlocking slices. The models below were made with interlocking slices, however you can also do stacked slices, such as the terrain models I created last year.

I can see the benefit of having bigger 3D shapes made out of little material, and the challenge or puzzle of slotting them all together. I think kids of all ages would get a kick out of it. However, I can see the limitation being the actual 3D .STL file -- creation using Blox 3D Junior is limited in its 3D formation and Tinkercad is a bit too tricky for the younger ones. I guess you start creating in Blox 3D Junior and then import into Tinkercad for further refinement but that level of app smashing is probably too much for our kids.



Monday, January 20, 2020

Rapid prototyping with cardboard

I was inspired by John Umekubo's cardboard cutting tips to investigate how to make prototyping with cardboard faster, easier and safer. Cardboard, of course, is a wonderful medium for design thinking and prototyping because it's plentiful, reusable and offers unlimited possibility in construction with little modification. How else can young students learn the meaning of flanges, flutes and corrugation?

In my brainstorming for a recent kindergarten class I opted to laser cut some construction tiles, similar to K'nex or Kiva planks in their versatility. I emphasized the idea of imagination and creativity, and the "first draft" mentality of prototyping.

I began with Shel Silverstein's The Missing Piece and the idea of incompletism. That is, making creative thinking unlimited by not restricting ourselves to perfectionism. Can machines be built that are missing a piece? Would that make the machine unusable or broken? Or could modifications be made? It was an interesting discussion, though in retrospect most kids would have preferred spending much more time playing with the tiles than considering the legitimacy of perfectionism!





Wednesday, January 15, 2020

Snow day!

Vancouver received quite a bit of snow this morning so most schools are closed in the area. It gives me a chance to reflect on the first few days back and prioritizing the projects I'm working on this year.

We're still having a bit of trouble with the laser cutter not cutting through materials dependably. I'm going to try to clean the lenses and bed soon and see if that helps.

Our Ender 3 is running PETG reliably now. Unfortunately, I've noticed that the bed is quite warped; it is higher in the center than on the edges and corners. The buildtak surface also works a bit too well and the PETG seems to bond too tightly to it; it's actually ripped in a few places due to print jobs adhering to the surface. I applied a broad sheet of kapton tape to it and that seems to be working much better.

I also updated the firmware to enable manual mesh bed levelling. This is a game changer in levelling the bed. After calibration, the z-height is adjusted as the extruder moves across the bed; you can actually see the z-stepper motor move as the extruder travels along the x and y axes. I first updated to the latest Marlin firmware but had a bit of trouble with memory space, so switched to the much leaner TH3D firmware.

To actually updated the firmware on the Ender 3 I had to load a bootloader. It was a straightforward process involving an Arduino Uno board and half a dozen dupont wires. I haven't used an Arduino in over a year so it was a nice refresher in using the Arduino IDE.