How To Make 3D Printed Rotating Table
Welcome to EASY TECH! In this video, we’ll guide you through the process of creating your very own 3D printed rotating table. Whether you’re a DIY enthusiast, a maker, or just curious about 3D printing projects, this tutorial is for you!
Diagram:
Components:
- Stepper Motor(28YBJ-48) : https://roboman.in/qv17
- Type C Connector : https://roboman.in/7pas
- SPST Switch : https://roboman.in/6e72
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
// wait for a single step of stepper int delaytime = 2; // ports used to control the stepper motor // if your motor rotate to the opposite direction, // change the order as {4, 5, 6, 7}; int port[4] = {4, 5, 6, 7}; // sequence of stepper motor control int seq[8][4] = { { LOW, HIGH, HIGH, LOW}, { LOW, LOW, HIGH, LOW}, { LOW, LOW, HIGH, HIGH}, { LOW, LOW, LOW, HIGH}, { HIGH, LOW, LOW, HIGH}, { HIGH, LOW, LOW, LOW}, { HIGH, HIGH, LOW, LOW}, { LOW, HIGH, LOW, LOW} }; void rotate(int step) { static int phase = 0; int i, j; int delta = (step > 0) ? 1 : 7; step = (step > 0) ? step : -step; for(j = 0; j < step; j++) { phase = (phase + delta) % 8; for(i = 0; i < 4; i++) { digitalWrite(port[i], seq[phase][i]); } delay(delaytime); } // power cut for(i = 0; i < 4; i++) { digitalWrite(port[i], LOW); } } void setup() { pinMode(port[0], OUTPUT); pinMode(port[1], OUTPUT); pinMode(port[2], OUTPUT); pinMode(port[3], OUTPUT); } void loop() { rotate(100); } |