Skip to content

Week 12. Group / Mechanical design, Machine Design

This is group assignment page for West harima student :

Student

group assignment

  • design a machine that includes mechanism+actuation+automation+application
  • build the mechanical parts and operate it manually
  • document the group project and your individual contribution

hero slide

alt text

hero video

Plan1

1.sketch

To begin, I made several suggestions. alt text

I decided roughly what kind of design we would like. alt text

I also made some sketches to determine details such as connections and specific sizes. alt text

2.BOM

Product name Number of units purchased Price links
NEMA17 Stepper Motor 2 2,400 Amazon
GT2 Timing Belt 1 1,820 Amazon
Electronic Switch Control Board 1 699 Amazon
Wheelp V Wheel Plate Mini 1 1,579 Amazon
380 Sport-Tuned Motor 2 627 Amazon
Switching Power Supply 1 2,980 Amazon
aluminum frame 1 1,060 Misumi

3..Feet

3.0 frame

I purchased an aluminum frame from Misumi.

alt text

I inserted this into Fusion360 with 3D data.
Download ↓ alt text

  • Fusion360 alt text

3.1 Stepping Motor

First, measure the parts to be used.
This process is very important for design.

alt text

I designed the parts to attach the motor to the frame in Fusion360.

  • try1 alt text

It worked, but I had to come up with another design because the motor heats up and could unravel the PLA.

  • try2

alt text

This time I think I have created a simple yet good design!

3.2 Pulley (side without motor)

alt text

I think we have designed this one well.

3.3 assembly

The design is output and attached to the frame.

alt text

Install using TM3 T-nuts.
Install the other side in the same manner.

alt text

Once installed, the next step is to attach the belt and wheels.

alt text

3.4 I’ll give it a try.

I ran the following code to try it out.

Reference site

int PUL=7; //define Pulse pin
int DIR=6; //define Direction pin
int ENA=5; //define Enable Pin
void setup() {
  pinMode (PUL, OUTPUT);
  pinMode (DIR, OUTPUT);
  pinMode (ENA, OUTPUT);

}

void loop() {
  for (int i=0; i<6400; i++)    //Forward 5000 steps
  {
    digitalWrite(DIR,LOW);
    digitalWrite(ENA,HIGH);
    digitalWrite(PUL,HIGH);
    delayMicroseconds(50);
    digitalWrite(PUL,LOW);
    delayMicroseconds(50);
  }
  for (int i=0; i<6400; i++)   //Backward 5000 steps
  {
    digitalWrite(DIR,HIGH);
    digitalWrite(ENA,HIGH);
    digitalWrite(PUL,HIGH);
    delayMicroseconds(50);
    digitalWrite(PUL,LOW);
    delayMicroseconds(50);
  }
}
  • result

4.Case Design

alt text

Two DC motors, one stepping motor, and the part through which the pinball passes are incorporated.

alt text

Output completed! I spent so much time on this. It was very difficult to take pictures because I had so many supports on.


Actually… I tried our best so far, but we decided that we could not make it in time due to time constraints and had to change our plan quickly.

Plan2 (Hey,Omachi!!)

5.connections

alt text

In my case, I used Arduino Uno R4 Minima and connected as follows

ENA : 5
DIR : 6
PUL : 7

  • Arduino Uno R4 Minima Pinuot

alt text

6.set limit switch

alt text alt text

It is attached to both bridges and the part where the plate rides.

7.programming

I sent the following message to chat GPT and asked them to write the code.

Microcontroller : Arduino Uno R4 Minima
Stepping motor : mema 17
Stepping motor driver : TB6600
A 1200mm long aluminum frame is used to make a single axis sliding mechanism. It is belt-driven and has a table in the middle to place a plate.
This plate is driven by a stepping motor. Limit switches are attached to both ends of the aluminum frame and to the middle plate. When an object is placed on the middle table, the stepping motor rotates and the table starts moving.
When it hits the limit switches on both ends, the motor rotates in the direction of rotation and repeats back and forth. When the plate is removed from the middle table, the motor stops rotating.
I would like you to write a program like this.

This is the actual code used.

// Motor control pins
const int ENA = 5;   // ENA (Enable)
const int DIR = 6;   // DIR (Direction)
const int PUL = 7;   // PUL (Pulse)

// Limit switch pins
const int leftLimitPin = 2;   // Left-end limit switch
const int rightLimitPin = 3;  // Right-end limit switch
const int centerSwitchPin = 4; // Center switch (plate detection)

// Motor movement status
bool moving = false;
bool direction = true; // true = moving right, false = moving left

void setup() {
  // Set pin modes
  pinMode(ENA, OUTPUT);
  pinMode(DIR, OUTPUT);
  pinMode(PUL, OUTPUT);

  pinMode(leftLimitPin, INPUT_PULLUP);
  pinMode(rightLimitPin, INPUT_PULLUP);
  pinMode(centerSwitchPin, INPUT_PULLUP);  // Enable pull-up for center switch

  // Enable motor initially
  digitalWrite(ENA, HIGH);
  digitalWrite(DIR, direction);  // Set initial direction (right)
  digitalWrite(PUL, LOW);

  Serial.begin(9600);  // For debugging
}

void loop() {
  // Read center switch (LOW = plate present)
  bool centerPressed = digitalRead(centerSwitchPin) == LOW;

  // Debug: print center switch state
  Serial.print("Center switch state: ");
  Serial.println(centerPressed ? "Pressed (plate present)" : "Not pressed (no plate)");

  if (centerPressed) {
    moving = true;  // Start movement if plate is present
  } else {
    moving = false; // Stop if no plate
    digitalWrite(PUL, LOW);  // Stop motor
  }

  if (moving) {
    // Change direction if a limit switch is triggered
    if (digitalRead(leftLimitPin) == LOW) {
      direction = true;  // Move right
      digitalWrite(DIR, direction);
      Serial.println("Left limit reached → Reversing to right");
      delay(300);  // Debounce delay
    }

    if (digitalRead(rightLimitPin) == LOW) {
      direction = false;  // Move left
      digitalWrite(DIR, direction);
      Serial.println("Right limit reached → Reversing to left");
      delay(300);  // Debounce delay
    }

    // Move motor
    for (int i = 0; i < 64000; i++) {    // Advance 64000 steps
      digitalWrite(DIR, direction ? LOW : HIGH);  // Set direction
      digitalWrite(ENA, HIGH);  // Enable motor
      digitalWrite(PUL, HIGH);  // Pulse HIGH
      delayMicroseconds(20);    // Pulse width
      digitalWrite(PUL, LOW);   // Pulse LOW
      delayMicroseconds(20);    // Interval before next pulse
    }
  }
}

Once the code is written, it is complete!