MAKING FORGE DOORS!!! Part 2
Вставка
- Опубліковано 19 гру 2019
- Check out the phenomenal range of ovens and kilns Paragon offers here: bit.ly/paragonandsteele
Thank you to Paragon for sponsoring this episode.
OUR PRODUCTS: alecsteeleco.com/
INSTAGRAM: / alecsteele
ALECSTEELECO UA-cam: bit.ly/alecsteelecoYT
ALECSTEELECO INSTAGRAM: / alecsteeleco
LEARN BLACKSMITHING ONLINE: beginblacksmithing.com/
PATREON: / alecsteele
We use Paragon Ovens for our heat treating! They are one of our Sponsors and create some of the most durable kilns and ovens available in the World. Be sure to learn more here:
bit.ly/paragonandsteele
Instagrams:
Alec: @alecsteele
Will: @will_stelter
Jamie (editor): @jamie.popple
Isaiah (Videographer): @isaiaharnoldfilm
My name is Alec Steele and I am a 22 year old blacksmith from England, now living in Montana in the USA! With a great team of hardworking folks, we upload videos showcasing the projects we get up to here at the workshop. Lots of sparks, lots of making, lots of fantastic-ness. Great to have you here following along!
/ alecsteele
INSTAGRAM @alecsteele
FACEBOOK PAGE / alecsteeleblacksmith
SNAPCHAT @ALEC-STEELE
MUSIC:
Epidemic Sound - goo.gl/iThmfx
- signing up at this link supports the show!
MUSIC - goo.gl/iThmfx signing up at this link supports the show!
------------------------------------------------
AMAZON AFFILIATE LINKS TO GEAR I LIKE, buying here supports us:
--------------
CAMERA + MAIN LENS: amzn.to/2CrLyYP
WIDE LENS: amzn.to/2CsAZou
TRIPOD: amzn.to/2GpBX7f
MIC: amzn.to/2CrBmiQ
SD CARD: amzn.to/2sF0i7g
COMPUTER: amzn.to/2C4i0oo
---------------------------------------------------------
Alec Steele Blacksmith 2019 - Розваги
"Blacksmith discovers electricity" is what the title should be. the pure joy is so wholesome when it starts rotating
😅😅😅
You 100% have to use a worm gear in case the electronics fail, the door doesn't just slam shut when the motor loses power. It'll also mean your motor isn't constantly loaded.
Edit: ALEC read this about CO build up -
Say the counterweight is not properly balanced and the motor fails, the doors drift shut when alec/will are doing something else, causing carbon monoxide build up. All that would happen when a worm gear fails is the door would stay in position. So sure, add a counterweight but couple the motor into the system through a worm gear first
Yeah a serious concern. Though they'll only be powered while the doors are opened, which they won't be a lot I guess. At least needs a mechanical stop (something to jam in there, safety pin through both zylinders maybe) to safely work on the forge if your hands go near the doors, e.g. to clean out the inside.
Or use a counter weight. The doors can open and close faster.
Steppers don't care about being constantly loaded.
Or one can counter-weight the door and put a goof buffer on the travel stop for the counter-weight (so if it ever ends up in freefall it will not hard-stop by slamming shut) or put in a wedge/block that positively engages stops on the frame unless actively retracted (so a failure of the system results in a door that safely stays in place.)
I think a counterweight would be a better option as it means less moving parts and things to wear out. Also, alec could forge some nice looking weights to go on It.
You should probably have some limit switches and code to stop trying to raise or lower the door past mechanical limits. Otherwise the motors could burn out or mechanical things go snap/bang.
Or, they could think about springs or counterweights. Probably cheaper than buying new electrifical stuff.
limits could possibly added in the software depending on the controllers used for the stepper motors.
@@capelectronics So why have limit switches on a 3d printer? It's just for safety and doesn't cost that much. The coding is simple to.
He needs the help of Michael Reeves
@@capelectronics You don't need to set the switch near the door at all. With wire and pulley's on the stepper motor, you could easily set the switch elsewhere away from the heat ; )
Alex: You might consider rotating the design 90 degrees, supporting the door on THK rail, and sliding the door left to right with a linear actuator rather than raising the door. This has the advantage of getting the motor as far from the heat as possible, greatly reducing the motor load, and in a catastrophic failure the door doesn't fall.
Alec, if you publish the code, I'll take a look at getting it up and running for you, as this is what I do for a living. A lot of people below are saying that you can't do simultaneous input/output off of an Arduino, which is technically true. However, you can fake it through interrupts and/or polling. I'll reply to myself with a code sample in a few minutes showing how you can do this, but there are edge cases where it might not work. If you can get the code over to me, I can get you fully working code instead of an example!
me two
he put links in the description :) or at least that is what he said in the vid
Without having seen the code, my guess is that he's throwing each button input into its own loop while being independent from each other. Since he'll need both motors at the same time, he should use a loop with both inputs being conditions to enter it. I'm also unsure which motor drivers he's using but he could also tie them to the same output connection to make things simpler
Also a programmer by trade, if the changes are open source and less than 100 lines, I could do it tonight 😄.
Oh you legend. Thanks for taking the micro-controlled bullet for the rest of us.
"Can this lift 30 lbs?!"
Of course it can. That's what gearing is for.
And/or counterweights.
@@atomicmonkeysquad And pullies ;) A couple extra of them would do the trick.
Anything can lift 500 lbs with the right gearing, 30 lbs is nothing
"Gonna use a Snatch Block here" SmaterEveryDay has entered the chat....
SNATCHBLOCK
SNATCHBLOCK!
SNATCHBLOOOOOCK!!!
Congratulations Alec, you've discovered the wonders of programming...
May God have mercy on your soul...
He's just got to discover the "it worked and now it doesn't" pain
i know this is a 2 year old comment but I just started learning python and your comment made me laugh/cry
Don't forget you can hang some counter weights from the cables to help the motors last. Great work 👍.
This guy will literally try anything and go balls to the walls even if he has little experience in it and he has the best attitude about it. Pretty fucking awesome
I'm 100 seconds into the video...and problems already? Anyhow...paused it: Can that little motor lift 30lbs? Yes. Option 1: Gears to get more torque and. Option 2: Pulleys to do the same. Option 3 (The best idea): Counter-weight the door with a mass that's 95% percent of the mass of the door.
Don't forget that he can and should put a worm gear on the stepper motor. This way the motors don't have to work so hard to keep the door up in the air
First thing that came to mind when he mentioned the weight and questioned his little motors... Pulleys and snatch blocks.
Ahh he beat me to it with the pulleys/snatch blocks. I was just watching the snatch blocks video by SmarterEveryDay a few days ago. Any one of these aforementioned options with the motors below the heat would solve both problems!
@@crazyeyez1502 keeping it simple is the key.
Couple used motorcycle chains, weld on some counter weights, and sprockets, motor can move the doors, doors stop where they’re stopped, just need minimal framing to weld sprockets to
Just use a counter weight to make the doors lighter.
You should come over and forge sometime! We are in the same town!
Hello friend from the 406!
What town
I live in Shepherd which is about 15 miles NE of Billings! Right under 2 1/2 hours to Bozo (I say affectionately) from here.
Mjölnir Odinson hi! I’m in Bozo
Have you ever seen him in public?
Some coding advice: two lines of code will not act simultaneously. It's a linear process of one line, then when that line completes, it checks the next line, and does that line to completion. So if you have a conditional statement or while loop that acts while a single button is held down, it will ONLY do what's contained in that loop or conditional statement until the condition is no longer true, regardless of if you held down other buttons.
You need to make conditions within conditions if you want multiple inputs to occur simultaneously.
I love how excited Alec gets about his programming successes!
Things that are less complicated than the forge doors:
Quantum Physics
Mapping the human genome
Linear Algebra
The ending to Interstellar
The riddle of Alec’s hair
This is an underrated comment.
Linear Algebra is simple lol
I feel like this is the most complicated way of building doors possible 😂
Nah...
He cuda used a turbine
@@Mr.redacted. The way its going he'll be hitching a couple of horses to it next!!
But it's fun to watch
Any motor would work if you use wait for it..... counter weights. Bam
beat me to it!
Oh seizure tree, oh seizure tree, how flashy are your branches.
Easiest solutions:
Simultaneous door operation
- unless you actually want to work on your programming abilities, get another Arduino (they're cheap) and run 2 completely parallel systems.
Load capacity
- get a couple of those hands crank worm drive winches from harbor freight, modify them to be driven by your Arduino/stepper solution.(Cheap and more than capable)
Simultaneous AND load capacity
- scrap it all and get a couple of cheap winches, fab something to give yourself foot levers to manipulate the controllers.
Undoubtedly, Alec will end up with a thousand dollar jewel encrusted Frankenstein that works and creates plenty of content, with 10s of episodes, and i will watch them all enthusiastically! Good luck bro!
Better version would be to figure out how and machine your own worm gear setup - that would be cool. Lol. I was mistakenly under the impression a worm gear set would be more expensive, but with a little research it appears you can probably buy a nice pretty little set for less than the harbor freight winch. Good luck!
Hi Alec, control systems student here. We can't see your code but I'd imagine that the problem is how your loops are working. If your code checks 'Is button A pressed? Do thing X until A isn't pressed anymore' and the same for Button B does Y. What you want is to put in another statement to check for when both are pressed, for example 'If A AND B pressed, do both X and Y'.
What this will achieve is it will keep the motors (X/Y) going until one of the buttons are released, wherein your code will keep going round and find the state it is actually in. you'll want to put in another equivalent loop or set of loops for backwards as well.
Can't be too much more specific without seeing the code.
A problem you may encounter if you just put this in as another if statement at the bottom of the script, it won't work properly. You'll need to use IF, ELSE IF, ELSE to make it work how you want it to.
TLDR; Arduinos are bad at multitasking, so you just have to give them a single task to do both motors, and have it trigger that task when both buttons are pressed and stop when either condition is no longer true.
Hopefully this was helpful, apologies if I was too vague.
I was thinking the same thing it would get a bit complicated having to poll motor position and decide to continue or stop a motor but seems doable (not sure what the data payload of the encoder looks like so it might be tricky to jump in and 'check' the motor position each loop. worst case you might not have precise position control and would need an emergency cutoff switch to keep from crashing the door into something.
would this work though, if you pressed both buttons at separate times? cause if you're holding down motor 1 up, then it will be stuck in that loop until you release it, and it wont be able to run through the rest of the code. if you pressed both motor 1 up and motor 2 up at exactly the same time, it might work, but the odds of that are slim to none. im not nitpicking, im genuinely curious, cause ive been playing with arduinos for about 3 years now, and havent been able to do what Alec is trying to do...
@@analog56x that's only the case if you use if statements to directly control the actions.
If you use the if statements to shift bits into a variable and then use a switch case to execute the commands it doesn't matter in what order you press the button because you will have an action for every combination.
Example:
Button up 1 adds 0001
Button down 1adds 0010
Button up 2 adds 0100
Button down 2 adds 1000
Now if you want up on motor 1 and up on motor 2 you put that in case(0101)
It doesn't matter if you first add 1 or the other. At the end of the day you are left with 0101
@@TerrorBunney that makes sense, i think... so it would be constantly looping and checking to see if the variable has changed. if it has, it acts accordingly.
im struggling to figure out how you would change the variable while outputting though... there would have to be a momentary pause in the output to be able to loop again and check to see if anything has changed... wouldnt there?
@@analog56x on an Arduino, if you set a bit it stays set until changed. So if you go through and set 1 for FrontUp, the Arduino doesn't have to keep running logic to keep telling it to run, as long as you've wired the motor logic to go up when the bit for FrontUp is set to 1. It will run until the Arduino changes that bit to 0. So in the meantime you can run your checks for the other 3 buttons and set those bits to their needed state. That's running in a loop so in a millisecond or so you will have gotten back to checking the state of the FrontUp button, and so on. There will be no perceptible lag between when the human presses the button and when the outputs change.
Weren't you planning on doing something with Colin Furze at some point? hint hint
Got there before me but this would have been the optimal time to get that tie wearing OG on the show!!!
"I had to actually use my brain"
That's my thought so far for my entire engineering career.
Btw when you finally get your code to work right it is such a nice feeling. Great job!
I feel like a $50 winch with a foot pedal would be a lot more simple...
@Alex Steele What do you think about elevators?
If you don't have enough potency on the steppers, just add a counterweight like in elevators.
That way the stepper will only need to deal with the diference from the doors and the counterweight
Alexa open the forge doors!
Omg. Sponsership!!
Playing music by The Doors.
“I’m sorry, Martin. I’m afraid I can’t do that.”
@@TXHeat1776 Or songs about doors. The Door by Al Denson. or Shut De Do.
@@TXHeat1776 come on baby light my fire
As a developer, it makes me grin so much to watch you enjoy the moment that your code works. It's just another form of creation, and I hope you enjoy the bits of it you get to do as much as this first magical moment.
Alec:”I’m going to do a thing”
Also Alec:*does the thing*
Still Alec:”what a FANTASTIC turn of events, this is amazing!”
If the design had counter weights he wouldnt need to mess around with steppers. Also, dont forget the limiting switches.
It's pulley driven to adding weights on the cable down line is still a option.
@@capelectronics in theory yes, but I guess you have never used them in practice.
This woulda been a good opportunity for a colab with Bob Clagget.
It's great to see Alec doing the passionate learning thing - not that he isn't always passionate, but it's projects like this one where he just lights up and makes people want to learn all the cool things he's learning...
Remember when there was blacksmithing and live shows and it was interesting. A motor spinning wow!
Yay, never been so excited for doors!
Last time I tried to forge something I knocked a piece of glowing yellow firebrick onto the workshop floor because I didn't realise the shamshir was longer than the forge.
Maybe I should make some forge doors
The feeling of satisfaction from teaching yourself something is unbeatable. I have taught myself everything that I know about electronics, computers, making things, ect by just getting the stuff and doing it. It is a real feeling of empowerment. I am happy that you are excited about doing that as well Alec. Great video!
I feel like this might be a little over-engineered, but I appreciate the enthusiasm.
Someone give him smarter everydays switch block video
Snatch block
I was thinking the same thing
Alec: “this door is heavy”
Me, jumping in frame: “SNATCHBLOCK!”
Why not make a door out of fire bricks rather than refractory and K.I.S.S. it Alec Keep It Simple Stupid. A pulley with pair of steel cables one side is connected to a foot bar the other is a offset weight 20lbs of weight would give the foot bar a 8lb weight to lift. He could even use this to fix the weight issue on his doors. send the cables out like T connect one side to a offset weight. The purpose of this weight is to reduce the weight of lifting the door as long as the door is heavier than that weight it will go back down. You could reduce the weight to almost nothing to make it easy on the motors.
Yeah, I was just going to suggest a counterweight
Or use a Gearbox
Yep, counter weight the doors and those beefy steppers will have no trouble moving them
@@oliverklotz6064 counter weight forged out of cast iron... or Damascus foot pedal forged... cast bronze...
I agree... Adding complication and tech to a simple lift gate will cause future issues... A simple mechanical foot peddle with a ratio based cable and counter balance is simple and fool proof... And yes I am an Engineer...
As a software developer and electrical engineer, it brings me so much joy seeing your "It works" reaction. Reminds me of when I first started fiddling around with an Arduino.
THANK YOU FOR TRYING IT YOURSELF. Seriously. I'm so sick of "maker" channels saying "i dont do x,y,z so i brought somebody in to do it for me because i need to make quota for my channel!" thanks dude! :) and this made me so happy to see your discovery. best video i've seen in the last year. honestly!
alec you need some limit switches (optical or mechanical) if you need some help let me know
Alec, I agree. It will be easier to stop the motors once the doors reach the point you want them. It also doesn't require coding. You can look up how limit switches work. It will help a lot in this proyect. ;)
wouldn't it be possible to measure the resistance of the stepper motor ? no extra hardware and would add a safety element to.
“Snatch Block!!” -Smarter Everyday
As soon as I heard Alec say snatch block I imagined Destin from smartereveryday suddenly looking up, his snatch block senses tingling. He knows...
Unlike every other commenter on the forge doors series, I don’t know how to do it better than you, Alec, and I’m having a blast watching you figure it out and do it the Alec Steele way. Rock on.
"If it's worth doing, it's worth overdoing."
"SNATCH BLOCK!!!" -Destin from Smarter Every Day 🤣🤣🤣
So after my comment about pilots last week, I had a change of heart. The issue is that Stepper motors don’t have much holding torque (the torque that holds the same position once the Arduino is no longer asking it to move, but to stay put).
If you counterbalance the weight of the door and use a double-wide pulley on the motor, you only need torque for moving the door. Wrap the cable around the motor pulley two or three times to act like a capstan. The tension of cable wrapped around it will produce enough friction to ensure it moves the cable. The counter balance will double the weight, but will use the motor to its best advantage.
Other option is to buy Technic Servos. They have integral controllers, use the stepper output (direction and steps) to simplify applications but offer HUGE holding torque. They’re also more expensive, starting at any $250. One for your app with a capstan or spool is abt $430.
Since you already have the steppers, my vote is for the counterbalance over a “block and tackle” arrangement.
Also, as someone else wisely stated, limit switches will save you from deep, abiding grief later. I prefer the “no contact” type (proximity sensor). They are VERY good at sensing steel. With tabs welded to two points on the same side of the rig, you can get away with one sensor for each door.
I can send sketches, if this is too vague.
Carry on, boys! This is really stretching your creative and technical muscles. Good stuff!
Seeing the joy in your face when you finished your first pass of a program reminded me of the first time did the same. Then the crushing defeat when you realized you forgot so much stuff.
I'm sure you've already thought of this, but COUNTERWEIGHTS! I think you want a slight bias to keeping the doors closed, so maybe have the counterweight be a few ounces less than the doors.
Alec: Counter weight the doors so the servos don’t have to hold the weight. If you rely on pulleys alone to handle the weight, it might be too slow to lift and lower.
6:25 The new motto for the whole shop right there!
"I'm just shocked at what you can learn just muddling through something"
What I love about this channel is how both Alec and us learn new things all the time
Alec: "What do you think, little motor, can you lift 30 lbs.?"
Archimedes: "Give me a lever long enough and a fulcrum on which to place it, and I shall move the world."
A blacksmith working with electronics, what a wonderful world!
Patrick Irish pretty fucking sad if you ask me.
After all this time spent watching in amazement as you do work in a field I know nothing about, it's really really fun seeing the tables get turned and watching you play around and get excited over something that it's in an area I understand
As an electrical engineer, I definitely know the joy of the first programmed micro-controller, keep at it~!.
me: design a mechanical linkage like a foot actuated trash can.
alec: COMPUTER FORGE!
Worm gear! If anything on this setup fails (power, arduino, motor, cable) , you will have a 30 lbs door dropping on whatever happens to be underneath.
Also, you could make the door with fibrewool insulation and only a little bit of refractory cement for health reasons, to save on weight
When you got the motor to work and got so excited I thought for sure you were going to exclaim It's alive, alive! Felt like a young Frankenstein moment to me, nice work and I'm sure you have more than enough help with the code reading the comments below, it's great seeing everyone trying to help!
ALEC! Look into a counter weighting systems like how elevators work. That will take out the worry that the stepper motors will not lift it and reduce wear! It will also prevent the doors from slamming shut when the electronics fail, which they may if they have to hold up the weight constantly when it’s open.
Why didnt you use the same door technic they use on a steam locomotive on the firebox
Exactly....
Hmm I'm surprised you haven't added an ignition pack to your forge yet lighting it with a torch come on laddy make your life easier
I love how excited you get when you get a motor to turn
if there was ever a vid for a 1 time sponsor this was it. the joy and astonishment of getting a stepper working! it took me back to my verry first programs. best add ever! you should have taken a sponsorship from arduino.
worm gear will minimise stress on the motor. i thought you might be going chain and sprocket route being more durable. although i do like the cables. a counterweight will be worth the effort. you could use a ratchet to hold the door without power. im thinking medievil portculis type mechanism, butmore complex.
A 4:1 block and tackle pulley rig would drop the weight of the doors to 8.25 on the doors. Whelp you just got to that part.
To get both motors to work you'll need an if statement at the top of the code checking that both buttons are pressed at the same time. Then adding the code that makes them turn in each direction.
The reason they both don't work is because it gets 'stuck' running one of the sections of code and can't activate the other part.
Good luck!
Happy to write or walk you through how to write the code, looks awesome!
Here's the code!! :)
// Alec's 2 motor, 2 button program!---
// named constants for the switch and motor pins;
int switchPin1 = 2; // The number of the Counter Clockwise pin
int reversePin1 = 3; // The number of the clockwise pin
int driverPUL1 = 7; // PUL- pin
int driverDIR1 = 6; // DIR- pin
int switchPin2 = 8; // The number of the Counter Clockwise pin
int reversePin2 = 9; // The number of the clockwise pin
int driverPUL2 = 12; // PUL- pin
int driverDIR2 = 11; // DIR- pin
int spd = A0; // Potentiometer
// Variables
int pd = 500; // Pulse Delay period
boolean setdir = LOW; // Set Direction
int switchState = 0; // Variable for reading the switch's status
int switchState2 = 0; // Variable for reading the switch's status
void setup() {
// Initialise the MotorPin as an output:
pinMode(driverPUL1, OUTPUT);
pinMode(driverDIR1, OUTPUT);
// Initialise the switchPin as an input:
pinMode(switchPin1, INPUT);
pinMode(reversePin1, INPUT);
// Initialise the MotorPin as an output:
pinMode(driverPUL2, OUTPUT);
pinMode(driverDIR2, OUTPUT);
// Initialise the switchPin as an input:
pinMode(switchPin2, INPUT);
pinMode(reversePin2, INPUT);
}
void loop() {
//11111read the state of the switch value:
switchState = digitalRead(switchPin1);
switchState2 = digitalRead(switchPin2);
//Check if CC switch is pressed.
if (switchState == LOW) {
// Turn Motor on
pd = map((analogRead(spd)),0,1023,2000,50);
digitalWrite(driverDIR1,setdir);
digitalWrite(driverPUL1,HIGH);
delayMicroseconds(pd);
digitalWrite(driverPUL1,LOW);
delayMicroseconds(pd);
}
else {
//read the state of the switch value:
switchState = digitalRead(reversePin1);
//Check if CW switch is pressed.
if (switchState == LOW) {
// Turn Motor on
pd = map((analogRead(spd)),0,1023,2000,50);
digitalWrite(driverDIR1,!setdir);
digitalWrite(driverPUL1,HIGH);
delayMicroseconds(pd);
digitalWrite(driverPUL1,LOW);
delayMicroseconds(pd);
}
//Check if CC switch is pressed.
if (switchState2 == LOW) {
// Turn Motor on
pd = map((analogRead(spd)),0,1023,2000,50);
digitalWrite(driverDIR2,setdir);
digitalWrite(driverPUL2,HIGH);
delayMicroseconds(pd);
digitalWrite(driverPUL2,LOW);
delayMicroseconds(pd);
}
else {
//read the state of the switch value:
switchState = digitalRead(reversePin2);
//Check if CW switch is pressed.
if (switchState == LOW) {
// Turn Motor on
pd = map((analogRead(spd)),0,1023,2000,50);
digitalWrite(driverDIR2,!setdir);
digitalWrite(driverPUL2,HIGH);
delayMicroseconds(pd);
digitalWrite(driverPUL2,LOW);
delayMicroseconds(pd);
// Turn motor off.
digitalWrite(driverDIR2,setdir);
digitalWrite(driverPUL2,LOW);
delayMicroseconds(pd);
digitalWrite(driverPUL2,LOW);
delayMicroseconds(pd);
}
}
}
}
Proposed changed code... didn't test it, but hopefully easy to understand.
// named constants for the switch and motor pins;
int switchPin1 = 2; // The number of the Counter Clockwise pin
int reversePin1 = 3; // The number of the clockwise pin
int driverPUL1 = 7; // PUL- pin
int driverDIR1 = 6; // DIR- pin
int switchPin2 = 8; // The number of the Counter Clockwise pin
int reversePin2 = 9; // The number of the clockwise pin
int driverPUL2 = 12; // PUL- pin
int driverDIR2 = 11; // DIR- pin
int spd = A0; // Potentiometer
// Variables
// FIXME: this seems like PWM drive. 250 high 250 low is the same
// as 500 high 500 low (50% fill). 70% high is faster, 30% slower
// I will not change this tho, but right now might not work properly.
int pd = 500; // Pulse Delay period
boolean setdir = LOW; // Set Direction
// ADDED
boolean reverse1, reverse2; // reverse direction. used with XOR
int switchState = 0; // Variable for reading the switch's status
int switchState2 = 0; // Variable for reading the switch's status
void setup() {
// Initialise the MotorPin as an output:
pinMode(driverPUL1, OUTPUT);
pinMode(driverDIR1, OUTPUT);
// Initialise the switchPin as an input:
pinMode(switchPin1, INPUT);
pinMode(reversePin1, INPUT);
// Initialise the MotorPin as an output:
pinMode(driverPUL2, OUTPUT);
pinMode(driverDIR2, OUTPUT);
// Initialise the switchPin as an input:
pinMode(switchPin2, INPUT);
pinMode(reversePin2, INPUT);
}
void loop() {
//11111read the state of the switch value:
switchState = digitalRead(switchPin1);
switchState2 = digitalRead(switchPin2);
// ALSO moved
//read the state of the switch value:
reverse1 = digitalRead(reversePin1);
reverse2 = digitalRead(reversePin2);
// NEW, moved
pd = map((analogRead(spd)),0,1023,2000,50);
// switch 1 pressed
if (switchState == LOW) {
digitalWrite(driverDIR1,setdir ^ reverse1); // XOR with reverse1
digitalWrite(driverPUL1,HIGH);
}
// switch 2 pressed
if (switchState2 == LOW) {
digitalWrite(driverDIR2,setdir ^ reverse2);
digitalWrite(driverPUL2,HIGH);
}
// same speed for both, if either is on. high duty cycle
if(switchState==LOW || switchState2==LOW) {
delayMicroseconds(pd);
}
if (switchState == LOW) { // if not really needed
digitalWrite(driverPUL1,LOW);
}
if (switchState2 == LOW) { // if not really needed
digitalWrite(driverPUL2,LOW);
}
// low duty cycle
if(switchState==LOW || switchState2==LOW) {
delayMicroseconds(pd);
}
// FIXME: might add a small delay here, to avoid busy wait. uncomment following
// only happens when motors are off
// else { delayMicroseconds(100); }
}
I just love how excited you are about doing electronic projects!
Add end stops to. That way you can’t go to far up or to far down.
It might be a bit of extra work, but if your interested we have what's called "Source Control" that allows anyone to browse your code, suggest modifications or copy it for their own projects. This might be a handy way to get feedback or loop in remotely located experts.. These are typically free for public use. Some common providers are GitHub and GitLab.
I'm sure as hell no programmer, though I do have to use some SQL for my job. I just really enjoy seeing that so many different types of people enjoy watching Alec, Will, and the team do what they do best.
@ 11:25 OH YEAH, THE ALEC STEELE SHOW IS BACK, BABY!!
This series will be 100 parts ending on 1 april 2020
Alex, install yourself a carbon monoxide sensor on uour forge aswell. You cant afford to muck arround with Co build up.
I so enjoy how excited Alec gets when learning something new and succeeding in applying the skill. You guys are awesome!
Love how he just keeps on working with new stuff.
I don´t think the arduino is having a problem driving two motors at the same time. It may be that it pause the code in a way when a button is pressed. Maybe an if statement like if both button 1 and 3 is pressed start both motors.
Hey alec, it sounds like you have an if else chain for containing all the buttons. if you split off one motors pair of buttons into it's own if else you can get it to work. however i couldnt find the code to verify that that's the problem. hope it helps.
As a machinist/blacksmithing fan/programmer I've naturally never been looking forward to a video of yours like this one! Congrats for getting over your fear of electricity and into such a project!
If you're using the standard stepper library, keep in mind that it locks the program's execution until the number of steps requested are finished. Try moving 1 or either a small fixed amount of steps per loop and using a unsigned long variable per motor along with millis() to time the stepping (check BlinkWithoutDelay.ino). Also just in case, don't use if/else statements to chain-check your buttons, just an isolated if statement per button.
Good luck!
Ah, as an electrical engineering student, watching Alec having fun making his arduino work gives me great pleasure. Reminds me of my electronics laboratories
you need to ad another conditon.
currently you just have button one or button two but you need (button one) or (button two) or (button one and button two)
I hope this helps
Lukas (germany)
there are 4 buttons though, that'll be a pretty long if else chain. It'd probably be simpler to write a single function MoveDoor(bool door, bool direction) or whatever the arduino equivalent would be and just have that function be called instead, then you wouldnt need to ccopy the same code 4 times or more, just one switch statement and a single function
@@themanofquagga but i want to make it easy
MAKE THE DOORS MECHANICAL!!! GET BACK TO BANGING ON HOT STEEL!!! Merry Christmas 😊
Yes please
Hey Alec! Please note for future reference that 'refractory' is an adjective, not a noun. There are no such things as 'refractories' or 'some refractory'. It's cement - 'refractory' is a describing word, like 'heavy' or 'brown'. A really interesting video, but hard to listen to! On a less critical note, I'm fascinated that you went for a stepper-motors-and-controller setup here. If you ever build another version of this, you might want to consider a simpler method - counterweight the door, and wrap the counterweight around a pulley driven by a motor. Then simply drive the motor in two different directions, using limiter switches on the weight (run it in a tube and slot either end to mount and adjust the door's upper and lower limits) and DPDT foot switches to isolate the two circuits. It's much simpler and less likely to fail under those harsh conditions :O)
Seeing someone get the "arduino bug" for the first time makes me feel all warm inside. That moment when you first figure things out and something works is magical!
I have never seen something this over-engineered in my whole life
I was in literal awe when i saw how much useless parts there were in the circuitry
He's having fun though, so I think it's great!
@@akosszennyai5814 Cut Alec a break. He just started learning this stuff. His primary skill is hitting red hot steel with a big ass hammer (which he's damn good at btw) so give him a hot minute to figure out which parts he can do without.
Sometimes over-engineered things can be really awesome if you do it on purpose.
And its beautiful
I think your code may be using delays in the code, it pauses the program to do something and that can stop doing things at the same time. You can set up what is called a millis timer that can let you run many things at the same time.
Dont think its delays, must be the way he programmed his buttons. If he has it programmed like this,
sudo code (not real code):
/*this will cause the program to enter the while loop, halting the rest of the code
* while(button is being pressed){move the stepper motor}
*/
The way to fix this issue would be to use constants and if statement such as
/* int butt1;
* int butt2;
* if(button is being pressed){ butt1 = true}
* if(button2 is being pressed){butt2=true}
*
* if(buton1 == true){ move stepper motor1}
* if(button2 == true){move stepper motor2}
*/
This again is sudo code, You will need to translate the logic to the arduino. Assuming you have a while loop; when you press the button, the code will continue to loop in the while loop until the button has stop being pressed. Consider posting your code on github, an open source code platform.
@@chachasmooth1992 that could also be an issues I think if you replace the If statements with While statements it should fix that.
nothing is sweeter than learning something hard and it works first time
Almost two years later, I still watch this from time to time just for his "COMPUTERS, AMIRIGHT???" and reminding me why I love programming :D
"We then proceeded to forget to make forge doors."
“It’s gonna be the bees knees”
Alec 2019
This quote has been around since the 40s or 50s! Lol my grandfather used to say it all the time.
I am loving your enthusiasm Alec
Hi Alec, current mechatronic engineer here, building an Arduino circuit. Just a note about those pin cables on the breadboard; the internals & ends break, bend etc pretty easily. Looks alot neater & cleaner when you use singlecore pathwayed cable ;) easier to follow too.
Heh. Look up how they opened the firebox doors in steam engines. Amazing simple.
Engineering rule #1: KISS
Keep It Stupid Simple
(Dont kiss kiss the door, it'll hurt)
We have gone from no forge doors to the single most overly complex doors in history 😂 what happened to keep it simple stupid
Alec, add a bumper switch to the bottom of each door and adjust the switch point so that the cables don't slack out and add an open limit for each door. Add inputs for dual or single operation of each door off of the same same foot pedal switch input. Also add an E-stop push button somewhere just in case a door limit fails to trigger.
The screams of joy he makes when getting things working is why I became an electronics engineer 😀
Yeah noice
"We're gonna make an *aluminium* pulley"
Excuse me, what?
That will break
I second this as you have steel cable and aluminum pully it will eat through the pulley with in a few uses please change this before next Episode. Also could use a weight distribution system where you have counter weights on pullies on each corner at the top of the frame so if the motor fails the door won't fall shut rather ease it's way down slowly. Please read this
@@nicojoubert9338 lol, I love how everyone else is pointing out the logistics of this bad decision, but I was just joking about him saying "aluminium".
@@christophermorin9036 I totally understand but I say aleminum and not aluminum it's interesting how one piece of alloy can have two different ways of being pronounced.
Needs an aluMAXIMIM pulley.
Paragon is awesome, based on your explanations and experiences. Yours is a wonderful channel for encouraging emerging technicians and for helping to show new would-be technical people several of the crafts that might interest them.
Victor Frankenstein 1818 "Its Alive..." Alec you crack me up. Keep up the fun and have a great Christmas.