Close
0%
0%

The Drummer

We want to create a remote/automatic drummer, the goal is to simplify the use of the instrument by making it follow a scheme and exec

Similar projects worth following
The project is supposed to be in two parts, the left being the reflection of the right side, the objective is to create an interactive way to control drum sticks.

For the futur. 

We couldn't obtain the best of what we intended to do, also we tried to implement a button that could actualise the potentiometer variation and change the motor speed in a instant. We succeed with one motor but it didn't worked on the second one so we removed is to the final render.

For further advancement we should make a better way to interact with the machine, also add a battery to each Arduino card could free the project from the pc. 

because nothing is done forever see you soon on this page for further avancements.

stepper motor casing v4.stl

stl file for final casting of the support (resin)

Standard Tesselated Geometry - 52.04 kB - 12/19/2024 at 09:27

Download

WhatsApp Image 2024-12-18 à 23.14.45_86884cd8.jpg

Overview sketches

JPEG Image - 81.66 kB - 12/19/2024 at 09:23

Preview

WhatsApp Image 2024-12-18 à 23.14.23_a661c8b3.jpg

first attempts V2

JPEG Image - 73.94 kB - 12/19/2024 at 09:21

Preview

WhatsApp Image 2024-12-18 à 23.14.13_fe099c25.jpg

first sketches attempts

JPEG Image - 78.13 kB - 12/19/2024 at 09:19

Preview

stepper motor casing v2 (2).stl

Support file for 3D print

Standard Tesselated Geometry - 33.29 kB - 12/18/2024 at 21:52

Download

View all 12 files

  • 2 × Stepper motor nema 17
  • 2 × driver support for driver a4980
  • 2 × driver a4980
  • 2 × arduino uno R3
  • 16 × jumper cables male/male male/female

View all 9 components

  • 11th week

    edgar.febvin12/18/2024 at 21:45 0 comments

    On this week we did :

    -The second side electronic assembly with the second motor 

    -The new fixables support in resin 

    -Replace one of the potentiometer

    -Fix every item on the lid of the box with either screws or fix dough

    as you can see we use a 9v power supply and one computer linked to the two Arduino cards.

  • 10 bis week

    edgar.febvin12/18/2024 at 21:26 0 comments

    On the same week we designed the box we used as a support for the electronic assembly and also as a weight to sustain the vibrations and torque produced by the motor fast rotation. We chose to use 2cm width for the wood and here are the dimensions of the box. 

    35CM/25CM/15CM

    We use a laser cutter in order to obtain the wanted result, we then used wood glue to fix the different parts, except for the lid which remained free.  

    Also we tried and failed to attach the support (motor + stick) to the lid but here is a try. It didn't worked out because the initial support didn't have enough space to drill a hole trough the plastic and the wood. 

  • 10th week

    edgar.febvin12/18/2024 at 20:41 0 comments

    Between sessions we acquired two new items, those beings the actual drums sticks and the piece that attach the stick to the rotor. Innovative Percussion IP-5A Vintage Series DrumsticksDShaped Hole Wheel Shaft Coupling Metal Robot Wheels Metal Wheel Shaft ...With those new equipment we were able to try the new version of the assembly, in order to fix the coupling to the drum stick we used sand paper on tree part of the sick to create a plane surface. The first test showed us that the stick was way too heavy for the motor to sustain the asked speed. So we chopped of the end of it and reduced the max speed from 30000 (in Arduino ide notation lol i genuinely don't know what is the actual corresponding speed) to 12000. After those adjustments we observed that we would need a support to resist the amount of vibration on the motor. 

    So we designed a piece made for support, we 3Dprinted it in plastics but we forgot to dig holes at the bottom of the support, see next session. Anyway here what it looked like. 

    See documents file SVG 

  • 9th week

    edgar.febvin12/18/2024 at 20:30 0 comments

    after some test with the non controlled version we decided to add a potentiometer to the assembly, the objective was to control the step of rotation of the rod attached to the motor. For this we used a mapping function that alignes the initial speed of the motor, considering the minimum and maximum values, with the different values of the potentiometer. Here is the code that we used for this mode.

    #include "AccelStepper.h"

    // Define stepper motor connections and motor interface type:
    #define dirPin 2
    #define stepPin 3
    #define enablePin 4
    #define ms1Pin 5
    #define ms2Pin 6

    #define ms3Pin 7
    #define potPin A2 // Potentiometer pin
    #define motorInterfaceType 1 // Step/direction control

    AccelStepper stepper(motorInterfaceType, stepPin, dirPin);

    void setup() {
      // Set the Enable pin and microstepping pins as outputs:
      pinMode(enablePin, OUTPUT);
      pinMode(ms1Pin, OUTPUT);
      pinMode(ms2Pin, OUTPUT);
      pinMode(ms3Pin, OUTPUT);
        // Enable the motor driver (active LOW):
      digitalWrite(enablePin, LOW);
        // Set the A4988 to 1/4-step mode:
      digitalWrite(ms1Pin, HIGH);
      digitalWrite(ms2Pin, HIGH);
      digitalWrite(ms3Pin, LOW);

      // Initialize the stepper motor with max acceleration:
      stepper.setAcceleration(6000); // Set high acceleration (steps/sec²)
    }

    void loop() {
      static bool movingForward = true;

      // Read the potentiometer value (0-2026):
      int potValue = analogRead(potPin);
        // Map the potentiometer value to a speed range (50 to 12000 steps/sec):
      int minSpeed = 50;    // Minimum motor speed
      int maxSpeed = 12000; // Maximum motor speed
      int motorSpeed = map(potValue, 0, 2026, minSpeed, maxSpeed);
        // Constrain the motor speed to ensure it stays within valid limits:
      motorSpeed = constrain(motorSpeed, minSpeed, maxSpeed);

      // Set the motor speed:
      stepper.setMaxSpeed(motorSpeed);

      // Move motor back and forth between 0 and 20 steps:
      if (movingForward) {
        stepper.moveTo(20); // Move 20 steps forward
      } else {
        stepper.moveTo(0);  // Move back to starting position
      }

      // Run the motor to the target position:
      stepper.run();

      // Check if the motor reached the target position:
      if (stepper.distanceToGo() == 0) {
        movingForward = !movingForward; // Reverse direction
      }
    }

    Also here is the final code that we used but we had to decrease the maximum speed from 30000 to 12000 because of the amount of torque in the final product (see further logs)

    here are some images of the assembly with the potentiometer:

    To plug is to the Arduino we had to use a breadboard because the 5v pin was already used.

    See the video in the files  please.

  • 8th week

    edgar.febvin12/08/2024 at 21:03 0 comments

    On this week we changed the way we wanted to rotate the stepper motor, goin from full step mode to 1/16 mode. By attaching a wood pannel with scotch and glue we figured out that we didn't need to rotate the full lenght of the motor. So, after we rewrote the code,this was it's newer version:

    /*
      Example sketch to control a stepper motor in 1/16-step mode using the A4988 driver, 
      AccelStepper library, and Arduino. The motor alternates directions quickly.
    */

    // Include the AccelStepper library:
    #include "AccelStepper.h"

    // Define stepper motor connections and motor interface type:
    #define dirPin 2
    #define stepPin 3
    #define enablePin 4
    #define ms1Pin 5  // Microstepping pin MS1
    #define ms2Pin 6  // Microstepping pin MS2
    #define ms3Pin 7  // Microstepping pin MS3
    #define motorInterfaceType 1 // Set to 1 for step/direction control

    // Create a new instance of the AccelStepper class:
    AccelStepper stepper(motorInterfaceType, stepPin, dirPin);

    void setup() {
      // Set the Enable pin and microstepping pins as outputs:
      pinMode(enablePin, OUTPUT);
      pinMode(ms1Pin, OUTPUT);
      pinMode(ms2Pin, OUTPUT);
      pinMode(ms3Pin, OUTPUT);
      
      // Enable the motor driver (active LOW):
      digitalWrite(enablePin, LOW);
      
      // Set the A4988 to 1/16-step mode:
      digitalWrite(ms1Pin, HIGH); // MS1 = HIGH
      digitalWrite(ms2Pin, HIGH);  // MS2 = LOW
      digitalWrite(ms3Pin, HIGH);  // MS3 = LOW

      // Set the maximum speed and acceleration:
      stepper.setMaxSpeed(30000); // Maximum steps per second
      stepper.setAcceleration(30000); // High acceleration for quick changes
    }

    void loop() {
      static bool movingForward = true;

      // Move motor back and forth between 0 and 20 steps:
      if (movingForward) {
        stepper.moveTo(20); // Move 20 steps forward
      } else {
        stepper.moveTo(0);   // Move back to starting position
      }

      // Run the motor to the target position:
      stepper.run();

      // Check if the motor reached the target position:
      if (stepper.distanceToGo() == 0) {
        movingForward = !movingForward; // Reverse direction immediately
      }
    }

    We also did test upon the motor duration to see after 5-10min of functioning, if it wasn't to hot. We found no problems on this side. But we had another problem, vibrations. This problem changed our view upon the structure of the whole assembly and we decided to go for a big box full of sand, to add weight. With this need design came the need of a support for the motor itself.

  • 7th week

    edgar.febvin12/08/2024 at 19:50 0 comments

    Between sessions we've been working on the motor assembly and we finally succeded the rotation. With a test code that would work on full step mode we achieved our first objective. 

    here is the first code that worked: 

    // Include the AccelStepper library:
    #include "AccelStepper.h"

    // Define stepper motor connections and motor interface type. 
    // Motor interface type must be set to 1 when using a driver
    #define dirPin 2
    #define stepPin 3
    #define enablePin 4
    #define motorInterfaceType 1

    // Create a new instance of the AccelStepper class:
    AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);

    void setup() {
      // Set the Enable pin as an output:
      pinMode(enablePin, OUTPUT);
      
      // Enable the motor driver (active LOW):
      digitalWrite(enablePin, LOW);

      // Set the maximum speed in steps per second:
      stepper.setMaxSpeed(1000);  // Adjust as needed for your motor
    }

    void loop() {
      // Set the speed in steps per second:
      stepper.setSpeed(1000);  // Adjust for desired speed (max: setMaxSpeed value)
      
      // Run the motor at a constant speed:
      stepper.runSpeed();
    }

    The objective was then to find if if was possible to stop the rotation using a button. In this case we used the button on the Arduino: it worked but only for a couple of seconds right before rotating again. Here is the code with button :

    #include "AccelStepper.h"

    // Define stepper motor connections and motor interface type
    #define dirPin 2
    #define stepPin 3
    #define enablePin 4
    #define buttonPin 5
    #define motorInterfaceType 1

    // Create a new instance of the AccelStepper class
    AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);

    // Variable to track motor state
    bool motorRunning = true;

    // Variables for button state and debounce
    bool lastButtonState = HIGH;   // Previous state of the button
    bool currentButtonState = HIGH;
    unsigned long lastDebounceTime = 0;
    const unsigned long debounceDelay = 50; // Debounce time in milliseconds

    void setup() {
      // Set pin modes
      pinMode(enablePin, OUTPUT);
      pinMode(buttonPin, INPUT_PULLUP); // Button with internal pull-up

      // Enable the motor driver (active LOW)
      digitalWrite(enablePin, LOW);

      // Set motor speed limits
      stepper.setMaxSpeed(1000);  // Maximum speed (steps per second)
      stepper.setSpeed(800);      // Constant speed
    }

    void loop() {
      // Read the button state
      bool reading = digitalRead(buttonPin);

      // Check if the button state has changed (debouncing)
      if (reading != lastButtonState) {
        lastDebounceTime = millis(); // Reset debounce timer
      }

      if ((millis() - lastDebounceTime) > debounceDelay) {
        // If the button state has stabilized and it's LOW (pressed)
        if (reading == LOW && lastButtonState == HIGH) {
          motorRunning = !motorRunning; // Toggle motor running state
          digitalWrite(enablePin, motorRunning ? LOW : HIGH); // Enable/disable motor
        }
      }

      lastButtonState = reading; // Update last button state

      // Run the motor only if motorRunning is true
      if (motorRunning) {
        stepper.runSpeed();
      }
    }

  • 6th week

    Georges Fayad11/20/2024 at 17:32 0 comments

    The 6th week was very productive : we actually found a new working method called the Pomodoro Method, which consist of doing some 25 - 5mn working. 25mn of individual working on specific topic. 5mn of grouping all the idea we got.

    For example, here, each one of us worked on a precise topic : Tim worked on the materials, Sam looked for the final assembling and connnection among the components, Edgar searched for the motor drivers, and I did some maths in order to find the equilibrium between the torque and the RPM.

  • 4th week

    edgar.febvin11/20/2024 at 17:08 0 comments

    First attempt to make the stepper motor turn !! Wasn't really concluant because we spent a lot of time studying the driver needed for the Nema17. The first choice was the DRV4980 but we couldn't find the wiring diagram for it. So we went and choose a A49800 stepper driver. We then used a shield capacitor support that looks like the following picture. 

    But why did we fail our first attempt ? Well we just installed the chip in the wrong direction on the support...It turns out the dir pin couldn't handle a 9V input (sad if you ask me). So see you in two weeks for more advancement (finally some mouvement). Below you can see what the driver A4980 looks like.

  • 5th week

    Georges Fayad11/20/2024 at 16:55 0 comments

    On the 5th week, we had a maths exam and so didn't do much about our project, but to fix we thought about seeing each other during the vacation week and between some International classes.

  • 2nd week

    Georges Fayad11/20/2024 at 16:32 0 comments

    During this second week , we figured out what type of motor we really needed and wanted. We first thought about car door actuator but it was too expensive, and couldn't find any in our school. That's why we decided to go off an other type of motor : the stepper motor.

    It allows us to chose the step we need to have a better precision of the stick control. And last but not least, we found 8 stepper motors in our school that we can use freely!

View all 12 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates