changed 6 years ago
Linked with GitHub

Advanced inputs and outputs recipes and coding

[Guillem+Oscar]

Methodology

  1. Narrow down what do we need
  2. Look at existing projects that implement some of the features
  3. Learn the core elements they use
  4. Look at the software they use. Do they use any good libraries?
  5. Look at existing Eagle / Kicad files to built from
  6. Can we buy off-the-shelf parts to test?
  7. Design you own PCB
  8. Built a test code
  9. Integrate everything

Motor drivers? Steppers?

https://reprap.org/wiki/StepStick
https://www.pololu.com/product/1182
https://www.trinamic.com/

Electronics designs?

https://www.instructables.com/id/Drive-a-Stepper-Motor-with-an-Arduino-and-a-A4988-/

https://blog.protoneer.co.nz/arduino-cnc-shield/

Reference designs in Eagle

https://github.com/jrcohen/SmartStepp
https://github.com/candelo/GRBL-CNC-DRIVER-BOARD

Software

https://github.com/grbl/grbl
https://github.com/MarlinFirmware/Marlin
http://www.airspayce.com/mikem/arduino/AccelStepper/

// Run a A4998 Stepstick from an Arduino UNOusing AccelStepper
// Paul Hurley Aug 2015
#include
AccelStepper stepper(1,5,4);//initialise accelstepper for a two wire board, pin 5 step, pin 4 dir

void setup() {
  Serial.begin(9600);
  pinMode(6,OUTPUT); // Enable
  digitalWrite(6,LOW); // Set Enable low
}

void loop() {
  digitalWrite(6,LOW); // Set Enable low
  if (stepper.distanceToGo() == 0)
  {  // Random change to speed, position and acceleration
    // Make sure we dont get 0 speed or accelerations
    delay(1000);
    stepper.moveTo(rand() % 400);
    stepper.setMaxSpeed((rand() % 400) + 200);
    stepper.setAcceleration((rand() % 200) + 100);
  }

Serial.println(stepper.distanceToGo());
stepper.run();  // Actually makes stepper move
}
Select a repo