Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Adding an inexpensive small motor tie into 12v as a novelty item Linear Motion  (Read 846 times)

0 Members and 1 Guest are viewing this topic.

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
So basically I'm looking to add the cheapest way possible a small motor that will constantly run on a tiny track / slide / ballscrew etc basically Linear motion with me hooking it up into my 12v power supply. Alternatively if more cost effective I can also use a USB for power / or adapter. I plan on having it about 18-23'' or so which will sit behind the marquee / screwed in.

Example :
2,370,650 Gun.Smoke

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17605
  • Last login:Today at 02:16:37 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Go to a junkyard, find a power seat and pull out the guts.  Then you'll have  linear rails that work on 12v.  You'll need a dedicated power supply.  An Arduino with an appropriate shield can control the thing as you'll need some way to reverse the motion when it reaches the end. 

Here's the thing though..... how heavy is the thing you are trying to move?  The reason I ask is because most of these systems are quite loud and power hungry.  For moving lightweight stuff a small dc motor turning a belt on two wheels is a better option. 

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Go to a junkyard, find a power seat and pull out the guts.  Then you'll have  linear rails that work on 12v.  You'll need a dedicated power supply.  An Arduino with an appropriate shield can control the thing as you'll need some way to reverse the motion when it reaches the end. 

Here's the thing though..... how heavy is the thing you are trying to move?  The reason I ask is because most of these systems are quite loud and power hungry.  For moving lightweight stuff a small dc motor turning a belt on two wheels is a better option.

It's not heavy very light, and if anyone has a suggestion for a specific dc motor / turning a a belt that the recommend let me know. I can tie it into my 12v or 5v off the power supply. Again I'd like to move something back and forth.
2,370,650 Gun.Smoke

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1687
  • Last login:Yesterday at 11:15:23 pm
  • Web Developer.
Cheap 12vdc pneumatic pump, solenoid, actuator? What is this for?

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Cheap 12vdc pneumatic pump, solenoid, actuator? What is this for?

Unfortunately I can't say, I keep changing my mind as to how to achieve what I'm looking to do in a cost effective / reliable manor to tie into the power supplies 5v or 12v. As of now I'd like something that raises / lowers in a slow manor that would go up/down a few inches. It doesn't need to support that much weight, it can be anything on a retractable pole is what I'm thinking. I want it to constantly run up/down motion it's gotta be mountable as well.
2,370,650 Gun.Smoke

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
As of now I'd like something that raises / lowers in a slow manor that would go up/down a few inches. It doesn't need to support that much weight, it can be anything on a retractable pole is what I'm thinking. I want it to constantly run up/down motion it's gotta be mountable as well.
How about a stepper motor and a scotch yoke mechanism?



By changing the shape of the slot, you can add dwell-time at one end of the stroke. (or both ends)



If you need a shallower design to fit behind the marquee, try something like this:
- No spring needed
- Adjust the shape of the cam



If you need a shallow design that moves perfectly vertical, try a parallel X-link like this driven by a stepper motor + eccentric cam that pushes on the blue arm.



A 28BYJ-48 stepper motor and ULN2003 Drive Module Board is really inexpensive combo.
- Lots of YouTube tutorials on how to control them using an Arduino.
- Everything runs off 5v.

Single: https://www.amazon.com/You-May-Stepper-ULN2003-Arduino/dp/B07PYXFSS6/

5-pack: https://www.amazon.com/ELEGOO-28BYJ-48-ULN2003-Stepper-Arduino/dp/B01CP18J4A/

The 5mm round to 3mm double-flat shaft on the 28BYJ-48 is a bit unusual, but you can overcome that using a 5mm coupler or by 3d printing.

There are almost 500 28BYJ-48-related parts designs on Thingiverse, some of them you can customize using OpenSCAD.
- Customizable Wheel for 28BYJ-48 stepper motor - https://www.thingiverse.com/thing:862438/
- Maze mouse wheel for 28BYJ-48 stepper motor - https://www.thingiverse.com/thing:122305

LMK if you need help designing/modifying a 3d prinitable part using OpenSCAD.


Scott

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
Things are not usually built on the fly with random thoughts given to design, At the very least it would be the black box theory of perimeters that would implement the best design, implementation, and ultimatly choice of parts as to not being under or overbuilt...IE: Size, weight, distance and adding a factor of 20% for safety margin would get you ballpark but stress factors should not be overlooked  (that is what ultimatly sank the Titanic).

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
But given what we do know...Light and behind Marquee, My first thoughts would be ultra quiet, pumps, and whirring steppers would create undo noise An animator clock motor would most likely do any job in that area of the cab without unnessary noise.
« Last Edit: August 07, 2019, 09:48:53 pm by jennifer »

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Quote
How about a stepper motor and a scotch yoke mechanism?




A 28BYJ-48 stepper motor and ULN2003 Drive Module Board is really inexpensive combo.

Single: https://www.amazon.com/You-May-Stepper-ULN2003-Arduino/dp/B07PYXFSS6/

5-pack: https://www.amazon.com/ELEGOO-28BYJ-48-ULN2003-Stepper-Arduino/dp/B01CP18J4A/


LMK if you need help designing/modifying a 3d prinitable part using OpenSCAD.


Scott

That mech video looks literally perfect for what I want with the exception I want it vertical behind the cabinet to raise / lower slowly repeatedly. The prices for those motors and that tiny board is insanely cheap, but If I can use the 5v or the 12v off the switching power supply home run. I'm not familiar with printing any 3D parts, but yeah Ideally it would be a smaller low profile design (attahcing to back of cabinet hiding most of the mechanics with exception of item I'm raising / lowering) but essentially the same overall mechanics in that video. I don't know anything about Arduino ? I was thinking just wire this up and have it run ?!
2,370,650 Gun.Smoke

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
That mech video looks literally perfect for what I want with the exception I want it vertical behind the cabinet to raise / lower slowly repeatedly.
The mech will work vertically, too.   ::)

The prices for those motors and that tiny board is insanely cheap, but If I can use the 5v or the 12v off the switching power supply home run.
Everything electrical (motor, driver, and Arduino) will run off 5v and ground from the switching power supply.
- Wire everything as indicated in the video and notes below.

I'm not familiar with printing any 3D parts, but yeah Ideally it would be a smaller low profile design (attahcing to back of cabinet hiding most of the mechanics with exception of item I'm raising / lowering) but essentially the same overall mechanics in that video.
You can fab the mech yourself (lots of scotch yoke physical builds on YouTube to copy) or I can help with 3d design if you provide certain critical, specific details/measurements.

I don't know anything about Arduino ? I was thinking just wire this up and have it run ?!
It's a stepper motor, so you will need the Arduino to run through the steps. (4 phase wires ==> 4 steps/phases)

This tutorial has the basic intro info you need:

  5:30 - Electromagnetic coils in the motor
  8:27 - Driver board
  10:39 - Wire power to external source
  11:36 - Full Stepping wave forms (best speed and torque)
  14:31 - Full Stepping animation

The Arduino specific info is at https://channel9.msdn.com/Shows/themakershow/8.
- Video shows how to wire everything to an Arduino Uno.
-- See notes below for how to connect to a less expensive Pro Micro board.
- Change speed by changing the delay value. (13:30 - 14:50)

Here's an adaptation of his "S01_BruteForceWaveDrive" sketch changed to Full Stepping.
- This code does continuous, Full Step, CW rotation.
- The delay variable "delay(2);" (line 64) takes about 4 seconds per rotation.  NOTE: This is the max speed for a full up/down cycle with this motor and the scotch yoke mech.
-- If you change it to "delay(3);", it will take about 6 seconds per rotation.
Code: [Select]
int bluePin = 2;    //IN1 on the ULN2003 Board, BLUE end of the Blue/Yellow motor coil
int pinkPin = 3;    //IN2 on the ULN2003 Board, PINK end of the Pink/Orange motor coil
int yellowPin = 4;  //IN3 on the ULN2003 Board, YELLOW end of the Blue/Yellow motor coil
int orangePin = 5;  //IN4 on the ULN2003 Board, ORANGE end of the Pink/Orange motor coil

//Keeps track of the current step.
//We'll use a zero based index.
int currentStep = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); 
 
  pinMode(bluePin, OUTPUT);
  pinMode(pinkPin, OUTPUT);
  pinMode(yellowPin, OUTPUT);
  pinMode(orangePin, OUTPUT);
 
  digitalWrite(bluePin, LOW);
  digitalWrite(pinkPin, LOW);
  digitalWrite(yellowPin, LOW);
  digitalWrite(orangePin, LOW);
}

void loop() {
 
  //Comment out the Serial prints to speed things up
  //Serial.print("Step: ");
  //Serial.println(currentStep);
 
  switch(currentStep){
    case 0:
      digitalWrite(bluePin, HIGH);
      digitalWrite(pinkPin, HIGH);
      digitalWrite(yellowPin, LOW);
      digitalWrite(orangePin, LOW);
      break;
    case 1:
      digitalWrite(bluePin, LOW);
      digitalWrite(pinkPin, HIGH);
      digitalWrite(yellowPin, HIGH);
      digitalWrite(orangePin, LOW);
      break;
    case 2:
      digitalWrite(bluePin, LOW);
      digitalWrite(pinkPin, LOW);
      digitalWrite(yellowPin, HIGH);
      digitalWrite(orangePin, HIGH);
      break;
    case 3:
      digitalWrite(bluePin, HIGH);
      digitalWrite(pinkPin, LOW);
      digitalWrite(yellowPin, LOW);
      digitalWrite(orangePin, HIGH);
      break;
  }
 
  currentStep = (++currentStep < 4) ? currentStep : 0;
 
  //2000 microseconds, or 2 milliseconds seems to be
  //about the shortest delay that is usable.  Anything
  //lower and the motor starts to freeze.
  //delayMicroseconds(2250);
  delay(2);
}
- You might also like the reversing motion of his S05_FullSteppingWithArrays sketch.
-- Alternates CW and CCW rotation through a set number of steps as demonstrated in the Arduino specific video above.

What wires go where on the Pro Micro:
  Two grounds (upper left) - Connect one to the switching power supply and the other to the driver board.
  2 - IN1 on driver board.
  3 - IN2 on driver board.
  4 - IN3 on driver board.
  5 - IN4 on driver board.
  VCC (or RAW) (upper right) - 5v (or 12v) from switching power supply to power the Arduino.
- Arduino may need 12v on regulated RAW pin if 5v on unregulated VCC pin doesn't work.
- See details under "How to Power the Pro Micro" here.
- No USB connection is needed after the board is programmed.   ;D




Scott

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
PM sent
2,370,650 Gun.Smoke

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
Reply sent.


Scott

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
Scott...I like it (and the vid was fun)...But...I hope seriously you are just giving him direction in "cheap" and given the facts the op won't even tell us what it is to be moved...I would have to say supposing he wanted to move  3oz snow cone back and forth at a constant rate perpetually in attract mode that first drive gear would give out sooner than later (object in motion) would be my guess.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
Bad news:  Turns out the 28BYJ-48 stepper motors are really weak.   :embarassed:




Scott

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
There you go Nm is the key for sucess...upgrades wouldn't be that hard to find however given that is the basis of Cnc (2 motors working together  in X/Y axis) so obviously the idea is good...And most defintally would move something.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
Without revealing the theme, the mechanics that Josh and I have been discussing have evolved into something more complicated (and cooler  ;D) than previously discussed in this thread.

- An arm raises/lowers about 2-3(?) inches.
-- There is a 608 bearing (or similar) on the side of the arm.
-- The item being raised/lowered at the end of the arm weighs less than one ounce.

- A motor moves a platform 8-10(?) inches horizontally.
-- The arm is mounted on this platform.  The arm's fulcrum axis is perpendicular to the direction of travel.
-- This platform is WAY too heavy for the 28BYJ-48.

- The rise/fall of the arm is controlled by the bearing rolling through a track on a vertical piece of MDF (or layered acrylic?) mounted parallel to the moving platform.
-- If the arm is moving left to right and the track is shaped like this ----\__/\_/\___ the arm will start high, then dip low, pop up/down twice and end low
-- The bearing might pop out of the track if improperly aligned.  Proper design should minimize this risk.

- It's probably best to use a leadscrew, pillow bearings, and two limit switches (not shown) in the horizontal drive mech.
-- It's far more durable than a scotch yoke .
-- Used in the Z-axis of many 3d printers and CNC machines.

- Will need to find/write Arduino code to make the motor run one direction until it hits a limit switch, then run the other direction until it hits the other limit switch.
---------------------
NEMA series motors with A4988 driver boards have the power to do everything Josh wants to do, but they are much louder than the 28BYJ-48.

The hard part is finding something between the $2 28BYJ-48 (380 g-cm) and a $10-15 NEMA 17 (60oz.in ==> 4320 g-cm?) commonly used in 3d printers/CNC machines.

Any suggestions for an inexpensive, quiet stepper motor/driver combo mid-way between the 28BYJ-48 and NEMA 17?


Scott
« Last Edit: August 14, 2019, 01:30:52 am by PL1 »

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
At slow speeds the noise would be less. Personally I like the bigger motor option, And would look for and upgrade to quality (brass or steel gears) for not only a good long life, but potential for less noise...But before I go I have to ask, does it really need to move something? or could the illusion of something being moved suffice? Peppers ghost is quite fun.
« Last Edit: August 15, 2019, 06:55:33 am by jennifer »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
Personally I like the bigger motor option
Didn't find any mid-range options and the 28BYJ-48 obviously doesn't have the torque, so I ordered two NEMA17 motors, some A4988 driver boards, a lead screw set similar to the one pictured above, and some 608 bearings.

And would look for and upgrade to quality (brass or steel gears) for not only a good long life, but potential for less noise.
No gears in this design.
- The lead screw coupler connects directly to the motor shaft to power the horizontal drive train.
- The lifting arm will use 608 roller bearings, so that part will be very quiet.

Depending on how noisy the prototype is, I may need to add a vibration isolation mount for the motor.

But before I go I have to ask, does it really need to move something? or could the illusion of something being moved suffice? Peppers ghost is quite fun.
Yes, Peppers ghost is fun, but it wouldn't work for this theme.

The physical movement of a 3d printed part travelling 8-10 inches horizontally and 2-3 inches vertically is essential to making Josh's theme work properly.


Scott

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3417
  • Last login:Yesterday at 10:43:05 pm
  • card carrying purist
What is this for?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
What is this for?
Read this post and the next 17 replies.  :P   :lol


Scott

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3417
  • Last login:Yesterday at 10:43:05 pm
  • card carrying purist
So what is it for?

None of those posts answer my simple question.
« Last Edit: August 15, 2019, 11:16:52 am by Mike A »

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
So what is it for?

None of those posts answer my simple question.
Basically it is the ideas behind an idea, (Although yes, there are some missing facts)...You should watch those videos when you got some time, You will not be dissapointed  at the lack of convention.
« Last Edit: August 15, 2019, 05:53:16 pm by jennifer »

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3417
  • Last login:Yesterday at 10:43:05 pm
  • card carrying purist
I get the idea. I just want to know what the ultimate goal is.

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
Does it really matter? If you understand how it is done the execution and what you are capable of, your idea could be so much better...

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3417
  • Last login:Yesterday at 10:43:05 pm
  • card carrying purist
It's called curiosity. Look it up and report back to me.

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
It's called curiosity. Look it up and report back to me.
Jennifer reporting back sir... I looked it up and found you to be lacking in the fabrication dept...GO BUY A WELDER!!!!

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
I get the idea. I just want to know what the ultimate goal is.


Wait . . . that's not it.

The ultimate goal is . . . a     mechanically     animated     cab     topper     with     the    same    dedicated     theme     as     the     video     game     inside     the     cab . . . but for today, we'll settle for annoying the card carrying purists.   :duckhunt   jk

Picture an animated (i.e. moving) toy from a pinball game sticking out through the top of a full-width, 6" tall(?) box on top of the cab.
- The front edge of the box is directly above the marquee.
- The box hides the animation mechanism and has paint or artwork related to the theme.


Scott

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3417
  • Last login:Yesterday at 10:43:05 pm
  • card carrying purist
That could be interesting.
Any specific game ideas yet?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
That could be interesting.
Any specific game ideas yet?
Yes, as implied earlier.
Without revealing the theme

If anyone wants to play along just pick a game, figure out what motion you need to tell the story, and design the track.

For example, if you wanted a Super Mario Bros. theme:

- Put a horizontal pipe on the left and a vertical pipe on the right.

- Use one motor to drive two Goombas back and forth, one on each side of a 2 or 3 block high center wall.
-- Limit switches tell the controller to reverse the motor.

- Mario is on the lifting arm platform driven by a second motor moving slightly faster horizontally than the Goomba motor.
-- An open-top guide track for the first lifting arm bearing (yellow) has a few vertical "jumps", one of them so he clears the center wall, one so he jumps into the pipe on the right, and one or two more for fun.
-- Put a second bearing on the other side of the arm that is pushed up by an angled block that is part of the Goomba mount. Instead of running into the Goomba, Mario "jumps" it.

- When Mario gets to the right side and drops into the pipe, he falls down to the bottom, and continues to move to the right. Shortly after that, the platform hits a limit switch and the Mario motor reverses.

- As Mario moves all the way to the left, the bearing (yellow) passes under a 45 degree "trapdoor" (red) which falls down behind the bearing after it passes.  Shortly after that, the platform hits a limit switch and the Mario motor reverses again.

- The bearing now rolls over the top of the 45 degree "trapdoor" and up until Mario exits the horizontal pipe, starting the cycle again.

Bonus points for adding relevant sound FX -- see WannabeJoy's project here for the board to use.

Double bonus points for getting Mario to punch a brick and have a coin pop up.

Super triple bonus points for adding a mech showing Mario running right-to-left through the underground with a guide track shaped like a wider, flatter, vertically-flipped hysteresis curve that slides the underground Mario an inch or two toward the back of the mech on the left end of the Mario motor travel so underground Mario is behind a wall as he moves to the right.  Underground Mario is pushed toward the front of the mech as he reaches the right end of the Mario motor travel.  As underground Mario travels left in front of the wall, the wall blocks the view of above-ground Mario as he also moves left.     ;D


Scott
« Last Edit: August 15, 2019, 10:47:30 pm by PL1 »

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Peppers ghost is quite fun

Nice first I'm seeing Peppers Ghost, (also eerily enough this reply was made when exactly 666 views were on the topic) I've heard of Ghost Peppers don't think my stomach can handle either of them.

That could be interesting.
Any specific game ideas yet?



Well... It's a secret to mostly everybody.
2,370,650 Gun.Smoke

jennifer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2169
  • Last login:August 17, 2019, 04:26:22 pm
Well you wouldn't need to use scary ghosts, It was more about being less mechanical and complex, and still maintaining the same effect with illusion...We don't got many secrets around here, Do not be afraid to document a build for everyone to enjoy and get some ideas from.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
Progress update.

Switching power supply arrived.  Thanks, Josh.   ;D

Spent several hours slogging through tutorials on YouTube.

Found a video that shows the basic motion and controls that we need for this project.   :applaud:



The video description has a link to Maker Tutor's blog post here where she posted the related code.

Code: [Select]
// defines pins numbers
const int stepPin = 5;
const int dirPin = 2;
const int enPin = 8;
const int LimitSwitch_LEFT_Pin  = 10;
const int LimitSwitch_RIGHT_Pin = 11;

void setup() {

  Serial.begin(9600);

  pinMode(LimitSwitch_LEFT_Pin , INPUT);
  pinMode(LimitSwitch_RIGHT_Pin , INPUT);

  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT);
  pinMode(dirPin,OUTPUT);

  pinMode(enPin,OUTPUT);
  digitalWrite(enPin,LOW);

  // Set Dir to Home switch
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction


}
void loop() {

    int leftSw  = digitalRead( LimitSwitch_LEFT_Pin);
    int rightSw = digitalRead( LimitSwitch_RIGHT_Pin);
   
    if( (leftSw  == HIGH && (digitalRead(dirPin) == HIGH)) ||
        (rightSw == HIGH && (digitalRead(dirPin) == LOW)) ){
   
        motorStep(1);

    }
    else if( leftSw == LOW && (digitalRead(dirPin) == HIGH) ){
          digitalWrite(dirPin,LOW);
          delay(2000);
    }
    else if( rightSw == LOW && (digitalRead(dirPin) == LOW ) ){
          digitalWrite(dirPin,HIGH);
          delay(2000);
    }
 
}
void motorStep( int MAX){

   for(int x = 0; x < MAX; x++) {
        digitalWrite(stepPin,HIGH);
        delayMicroseconds(500);
        digitalWrite(stepPin,LOW);
        delayMicroseconds(500);
      }
     
}

One possible concern is that the code is written for and tested on a TB6560 driver board and uses proximity switches instead of physical switches.

The good news is that the basic inputs on an A4988 and a TB6560 appear to be the same.

If so, with a few minor edits this code should do exactly what we need.   ;D

Found several other neat videos by Maker Tutor.

This may come in handy if you want to test which wire pair goes to the same coil.
- Turning the shaft induces an alternating electrical charge as the north and south poles of the magnetic field pass through the coil.



How much of an electrical charge does it generate?  Enough to do this.   :lol




Scott
« Last Edit: August 18, 2019, 03:34:54 am by PL1 »

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Progress update.

Switching power supply arrived.  Thanks, Josh.   ;D


No problemo! Watched all the videos, excited to see some of those techniques applied to this particular project.  :cheers:
2,370,650 Gun.Smoke

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
Finished initial design for the test frame.

The left half is pretty well locked in position.

- Attach the PSU on the top/back of the 2x2x8 pieces.

- Attach the 1x4x24 on the top/front of the 2x2x8 pieces.

The right half may need to move right/left, depending on the design and placement of the moving platfrom and lifting arm.  For now, I'll use some bar clamps to hold the 1x4x24 assembly to the 1x8x12 assembly.

- Attach the 1x8x12 to the back of the 2x2x4 pieces. (NOTE: This must form a 90 degree angle so the face of the test ramp is perpendicular to the 1x4x24.)

- The 24mm tall spacer blocks create a space for the platform bearing to roll. (a 608 bearing has a 22mm o.d.)
-- It rolls between the top of the 1x4x24 and the bottom of the test ramp.
-- The bearing keeps the platform level, preventing it from rotating around the x-axis as the stepper motor drives the lead screw nut.
-- Depending on the amount of wiggle/slop in the platform drive mech, I might need to add two 608 bearings to prevent z-axis rotataion of the platform or (worst case scenario) upgrade to optical guide rod and two LM8UU bearings. (adds about $15 to the build cost)

- The test ramp rests on top of the spacer blocks.
-- It guides the lifting arm bearing, allowing you to test different arm lengths, track patterns, "trapdoor" designs, etc.
-- Include clamp arms in your test ramp so you can secure it to the 1x8x12.

The power distribution harness, Pro Micro, and A4988 drive board mount on a piece of 1x2x8 between the PSU and 1x4x24.

The stepper motor, lead screw, pillow bearings, directional switches and emergency stop switches mount on the 1x4x24. (stepper motor on the left)


Scott

mrclean

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1498
  • Last login:Yesterday at 09:45:22 pm
  • World Record Holder for Gun Smoke Dedicated & MAME
    • Guscade
Where it says PSU I'm assuming that's the switching Power Supply Unit ? I'm confused by that typically I place them inside cabinets as opposed to ontop, figured I would just run the Ground / voltage from the Switching Power Supply with wires up to the top of the cabinet retaining the power supply on the inside of the cabinet.
2,370,650 Gun.Smoke

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7329
  • Last login:Today at 03:08:17 am
  • Designated spam hunter
My pet unicorn just observed that it's unrealistic for me to expect lightning-fast bulletproof results when doing a complicated first build requiring a newly-learned skillset with a somewhat steep learning curve and few clearly relevant examples to follow.  [/snark]   :lol

Crawl.  Walk.  Run.

This is the initial test frame. (crawl)

The mechanism is too complicated to go from rough idea to working prototype in one step without engineering and CAD skills that far exceed mine.

This is where I learn what works and if certain design assumptions are valid or not.

- Is one 608 bearing enough to keep the platform moving straight or does it require two more bearings on a T-shaped platform to keep it from twisting on the z-axis or does it require an optical guide rod and two linear bearings on a T-shaped platform?

- Does the lifting arm bearing need to be in a captive track or will it work with an open edge?

- How steep of an up-ramp is possible?

- Are there any unforseen complications?  * Shakes Magic 8-ball.  "Very likely." *

It will be fairly easy to transplant the electronics and drive train to a prototype when the time comes to walk.   ;D


Scott