1 / 2
Gravitrax Marbel lift - fully functional with complete description — zdjęcie 1
1 / 2

Gravitrax Marbel lift - fully functional with complete description

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

A fully functional marbel lift with a complete description. See: https://www.youtube.com/watch?v=UvaC-TC-NDI

Ocena
0 / 5
Polubienia
9
Pobrania
48
Wydruki
0
Wyświetlenia
689
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Licencja
BSD License

When soldering the original stepper motor mentioned in the original model I destroyed it because I applied too much heat to it. Since it was damaged already I opened it up, saw a few wires hanging out. I've learned some electronics almost 30 years ago. But I didn't remember anything and it made me wonder: How on earth does this copper wire get this motor to turn in any way? Since it had two coils stacked on top of each other, it didn't ring any bells.

But I have this buddy, ChatGPT, who seems to know everything. So I've chatted long hours with him until deep in the night. Even though he was wrong from time to time it was really fun to fall in this rabbit hole with him! :-D 
That's the result:

As the original model used a stepper motor, I started with one as well but I guess it would have been better to use a simple DC brushless motor instead.

It's a 28BYJ-48 5V 4-Phase stepper motor with a ULN2003 driver. You can get it here for example: https://www.amazon.de/dp/B0CW9ST4XM 

I've used this 3D model and converted it to STL to use it in my model and fit the precise holes for the screw conveyor and the motor plate:
https://www.printables.com/model/341017-28byj-48-stepper-motor

The microchip I've used is just compatible with the Arduino Nano, it's not directly an Arduino. You need to install the driver for the CH341 chip from
https://www.wch.cn/download/CH341SER_MAC_ZIP.html
 

You can see the wiring in the photo. But you basically connect 
ULN2003 driver → Arduino Nano module
IN1→D2
IN2→D3
IN3→D4
IN4→D4

+→5V
- →GND

I've used a power bank with 5V and 2A as a power source but it should work as well, if you use 4 AA batteries with a battery holder. The Arduino should be able to handle the resulting 6V.
 

It's standard female-male jumper wire. E.g. this one:
https://www.amazon.de/dp/B01EV70C78

This code slowly accelerates to a speed of 600 using the AccelStepper library.

For some reason, the order of the 2nd and 3rd inputs needs to be swapped for the library.

#include <AccelStepper.h>
#define IN1 2
#define IN2 3
#define IN3 4
#define IN4 5

AccelStepper stepper(AccelStepper::FULL4WIRE, IN1, IN3, IN2, IN4);

void setup() { stepper.setMaxSpeed(600.0); stepper.setAcceleration(25.0);

// The run() functino that is used with acceleration only works with moveTo(). // That's why we set a large target and reset it when it's reached. stepper.setCurrentPosition(0); stepper.moveTo(999999); }

void loop() { // run() accelerates from 0 to MaxSpeed. stepper.run();

// Target reached. Reset. if (stepper.distanceToGo() == 0) { stepper.setCurrentPosition(0); stepper.moveTo(999999); } }

This code neither uses a library nor an array to visualize what happens. The 2nd and 3rd inputs don't need to be swapped and are correct as is.

There is no ramp up in speed here while the delay of one should be the equivalent of the speed of 1000 above and the 28BYJ-48 handles it like a champ. Even with 6 marbels.


#define IN1 2
#define IN2 3
#define IN3 4
#define IN4 5

int currentStep = 0;

void setup() { pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT); }

void loop() {

switch (currentStep) { case 0: digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); break; case 1: digitalWrite(IN1, HIGH); digitalWrite(IN2, HIGH); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); break; case 2: digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, LOW); digitalWrite(IN4, LOW); break; case 3: digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH); digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW); break; case 4: digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW); break; case 5: digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, HIGH); digitalWrite(IN4, HIGH); break; case 6: digitalWrite(IN1, LOW); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); break; case 7: digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH); break; }

currentStep++; if (currentStep > 7) { currentStep = 0; // start over } delay(1); }

This is TinkerCAD Blockly code that I might share with my son:
https://www.tinkercad.com/things/6EdS4bltGli

When downloading the code it converts it to C++ to be used in the Arduino IDE. The only thing that should need to be changed is the delay. With a delay of 5 it should work just fine already.

Btw: This is my sons account I've accidently uploaded this model here.


The model could be improved by adding a housing for the boards and the cable.

You can use wood screws to fixate the motor plate on the frame and smaller ones to fixate the motor on the motor plate. 
Just use force to get it into the PLA :-D

If you would open the motor you would maybe be surprised about how the coils are arranged. In this video the motor is actually opened and at the beginning of the video you can see it:
https://www.youtube.com/watch?v=k2pz-4nsXbc
This is because it is actually an unipolar can-stack motor. The bipolar version is explained here in english;
https://youtu.be/AqZ6e4-fw0M?si=MhlD11bb__lqYDG9&t=1936

And here in german:
https://youtu.be/spWVb9cb7dA?si=LKZjcAefX1aBfreE&t=1980


Enjoy!