| Main > Project Announcements |
| Stepper motor mechanism for animated cab topper |
| << < (7/8) > >> |
| mrclean:
--- Quote from: PL1 on September 10, 2019, 08:57:25 pm --- --- Quote from: jennifer on September 10, 2019, 07:23:03 pm ---Now that IS cool, Good job!... :applaud: --- End quote --- Thanks, Jennifer. :cheers: Squared off the back of the vertical bearing arm on the moving platform. - It's now much easier to install the arms and bearings. Made a version of the vertical lift arm with the ramp bearing, platform, and ghost on the left instead of the right. The fully commented OpenSCAD code for these parts is almost ready. ;D Scott --- End quote --- I really can't express how incredibly grateful I am that Scott (PL1) :applaud: is helping me take on this element. I couldn't of partnered with anyone better to bring an idea which became bigger and better with suggestion, brainstorming, research & development etc. I'm truly super excited to see the purpose of what was envisioned which evolved & this finalized... What Scott has revealed in regards to what you see the Pac-Man Ghost is just simply a place holder. It gives a good representation of what it's mechanically going to do. Until it's completion on both Scott's & my end majority of it's still being kept a secret. Once I complete the rest of the build on my end I'll be doing a reveal of the purpose of this along side the completed game. As I had discussed with Scott likely +/- 4-6 weeks or so middle to the end of October is when I plan to tackle the project. The good news is that once I have time to start, majority of the elements are already done, however I've got many other things on my plate so It will need to wait until that time frame. I don't have a deadline nor does Scott, It won't be revealed until completed so he's got all the time he needs on his end as we had discussed in the beginning on this project should it line up to when I'm ready on my end great! |
| bperkins01:
I think I'm late to this thread- but this guy (I watch a lot of his videos) just did one on steppers and Hall Effect sensors as limit switches. What's nice about them is they are triggered my magnetism (no contacts or leds). They are pretty cool and he covers what you are trying to do. See here: |
| mrclean:
--- Quote from: bperkins01 on September 11, 2019, 09:35:55 pm ---I think I'm late to this thread- but this guy (I watch a lot of his videos) just did one on steppers and Hall Effect sensors as limit switches. What's nice about them is they are triggered my magnetism (no contacts or leds). They are pretty cool and he covers what you are trying to do. --- End quote --- That's neat, next project ! ..... anyways I already have some Hall Effects ;D .... but those are inside my Escape From The Planet Of The Robot Monsters. Side note I think I'm more impressed with that guys organization of his tools. |
| PL1:
--- Quote from: bperkins01 on September 11, 2019, 09:35:55 pm ---this guy (I watch a lot of his videos) just did one on steppers and Hall Effect sensors as limit switches. --- End quote --- That's one of the better videos on the subject. :cheers: He uses a more advanced programming approach with interrupts that probably is better, but it is harder to convert for physical switches than the code from the other video. :dunno I'm trying to keep the hardware requirements as simple, inexpensive, and flexible as possible for anyone else who wants to build something like this, so it's best to be able to handle either type of switch. --- Quote from: lilshawn on September 11, 2019, 05:01:18 pm ---apparently there is a way to drive stepper motors to make them nearly silent. it has to do with ramping up the current at the beginning of the step (or some voodoo like that) it's something being implemented in 3d printers to cut down on the noise. --- End quote --- Interesting. Driver boards like the A4988 can work with inline motor filter boards like these or piggy-back on filter boards like these or there are some driver boards like the TMC2208 and TMC2100 designed for silent motor operation. Adding a filter board or a silent driver board is more expensive than using A4988 drivers, but the noise reduction may be worth the extra cost. :cheers: Scott |
| PL1:
I've been experimenting with A3144 Hall effect switches and they are perfect for this application. ;D - The linked switches are momentary, not latching. (A3144's come in both styles) Wiring is easy. - Narrow face with the writing on it goes toward the magnet. - 5v on pin 1. - Ground on pin 2. - Signal out from pin 3 to the Arduino input. - 10k resistor between pins 1 and 3. There isn't much info on which magnets to use and at what distance they trigger the switch. - Tried these 10mm round x 3mm thick with a 3mm countersunk screw hole magnets and they work perfectly. - The countersunk side of these magnets trigger the switches above. (Not sure if that is the N or S pole.) -- When perfectly aligned, the switch triggers at about 1/2"/12mm. -- If the edge of the magnet is within a 1/2" x 1/2" box the switch triggers at about 10mm distance so there's lots of horizontal and vertical wiggle room. ;D The plan is to use a #4-40 x 3/4" screw + nut to mount two magnets directly under the lead screw, one on each side of the Moving Platform. An A3144 and 10k resistor will go on each bearing mount bracket. -------------- Adapted code from the Limit Switch sketch demonstrated in the DroneBot Workshop video above. Changed the time variable value for troubleshooting, added comments, and inserted some "Serial.print" commands. - Every time a step pulse is sent, it sends "Step 0" (step left) or "Step 1" (step right) to the Serial Monitor window. - When the left switch is triggered, it sends "Go right". - When the right switch is triggered, it sends "Go left". --- Code: ---// Stepper motor mechanism controlled by an Arduino Pro Micro, an A4988 driver board, and two directional Hall Effect switches. // Stepper motor goes one direction until it hits that directional switch then reverses until it hits the other switch then goes the original direction again. // Adapted from https://dronebotworkshop.com/stepper-motor-hall-effect/ /* Stepper Motor Limit Switch Demo Uses Hall Effect sensors as limit switches */ // Define connections #define SWITCH_A 2 // Arduino pin that connects to the left directional switch. #define SWITCH_B 3 // Arduino pin that connects to the right directional switch. #define DIR 8 // Arduino pin that connects to A4988 driver board DIR pin. #define STEP 9 // Arduino pin that connects to A4988 driver board STEP pin. // Variables int pd = 500; // Pulse Delay period -- original was 4000 microseconds boolean setdir = LOW; // Set Direction // Interrupt Handlers void limit_a (){ // Reverse motor setdir = HIGH; // Print direction and carriage return Serial.println("Go right"); } void limit_b (){ // Reverse motor setdir = LOW; // Print direction and carriage return Serial.println("Go left"); } void setup() { // Setup the stepper controller pins as Outputs pinMode(DIR,OUTPUT); pinMode(STEP,OUTPUT); // Setup the switches as Inputs pinMode(SWITCH_A, INPUT); pinMode(SWITCH_B, INPUT); // Attach interrupt pins to handlers attachInterrupt(digitalPinToInterrupt(SWITCH_A), limit_a, FALLING); attachInterrupt(digitalPinToInterrupt(SWITCH_B), limit_b, FALLING); } void loop() { digitalWrite(DIR,setdir); digitalWrite(STEP,HIGH); delay(pd); // default = delayMicroseconds(pd); digitalWrite(STEP,LOW); delay(pd); // default = delayMicroseconds(pd); // Print step, direction (0 or 1) and carriage return Serial.print("Step "); Serial.println(setdir); } --- End code --- The odd thing about this is that after switching directions, it consistantly takes one more step in the old direction before changing to the correct direction. :dunno Sample of Serial Monitor output: --- Code: ---Go left Step 1 Step 0 Step 0 Go right Step 0 Step 1 Go left Step 1 Go right Step 0 Step 1 Go left Step 1 Step 0 --- End code --- Scott |
| Navigation |
| Message Index |
| Next page |
| Previous page |