I Built a SCARA Robot
Вставка
- Опубліковано 19 гру 2022
- You and your company can try Onshape Professional for free at Onshape.pro/LeviJanssen
Support my work on Patreon - / levijanssen
Join me on Discord - / discord
Follow me on Instagram - / leviajanssen
View the CAD files for this project through Onshape: cad.onshape.com/documents/8f1...
I built a SCARA robot from 3D printed materials and laser cut aluminum. The two actuators are cycloidal drives made with NEMA 23 stepper motors. The purpose of this project was to build a fun platform to experiment with simple inverse kinematics. - Наука та технологія
- Is the stuttering due to varying loop execution time? You could correct this to some extent by fixing the interval between executions using a timer interrupt or with a non-blocking wait.
- You could speed up the code by pre-calculating all of the required angles for your work space and resolution, then putting the results in a look up table. The Arduino doesn't have to do most of the trigonometry on the fly and just look up the required results.
- Thirdly, i've developed a commercial product that does something that we call a bump and home because we didn't want to include a limit switch on the product. We tell the motor to move slowly towards the limit. We know we've reached the limit when the following error gets too high - this is now our home position.
I might be tempted to try implementing the IK as a coarse LUT on a 1cm grid, mapping (x,y) to entries not just (a,b) but also the d(x,y)/d(a,b) jacobian to use to take two or three Newton-Raphson steps on the interpolated LUT to get the error down to almost nothing.
Came here to suggest precomputation, glad to see it's one of the top comments.
@@AJMansfield1 ⚠️ God has said in the Quran:
🔵 { O mankind, worship your Lord, who created you and those before you, that you may become righteous - ( 2:21 )
🔴 [He] who made for you the earth a bed [spread out] and the sky a ceiling and sent down from the sky, rain and brought forth thereby fruits as provision for you. So do not attribute to Allah equals while you know [that there is nothing similar to Him]. ( 2:22 )
🔵 And if you are in doubt about what We have sent down upon Our Servant [Muhammad], then produce a surah the like thereof and call upon your witnesses other than Allah, if you should be truthful. ( 2:23 )
🔴 But if you do not - and you will never be able to - then fear the Fire, whose fuel is men and stones, prepared for the disbelievers.( 2:24 )
🔵 And give good tidings to those who believe and do righteous deeds that they will have gardens [in Paradise] beneath which rivers flow. Whenever they are provided with a provision of fruit therefrom, they will say, "This is what we were provided with before." And it is given to them in likeness. And they will have therein purified spouses, and they will abide therein eternally. ( 2:25 )
⚠️ Quran
Alternatively, build a lookup table for the trig functions and do some tricky float cheating with that power/sqrt function (i.e. bitshifting the exponent of the float over one bit to the left, doubling the exponent and therefore squaring the float, or a right bitshift of the exponent with extra logic to approximate square root)
@@42468 perhaps, but if you're on the sorts of small microcontrollers where precomputed function LUTs are relevant, you probably don't have a hardware floating point unit. In which case, integers and fixed point arithmetic are supreme.
Great work Levi!
Long time! I am happy to see you back, with this amazing content. I really enjoy it :-)
No idea why I was not subscribed yet ... where have you been all my life? Please continue, don't let me interrupt.
Onshape rocks! Really cool project. Looking forward to your future projects
I agree, looks totally cool, and for a first time project like this, I feel you knocked the ball out of the park! I look forward to seeing more of your videos and projects you bring to life.
If you're spending a lot of time in CAD, I strongly recommend picking up a SpaceMouse. I have the Pro version with buttons around the sides and I can say with confidence that it has saved me countless hours in CAD and has made using the software so much more pleasant. Cannot recommend enough if you use CAD a lot.
Great project as always, and I'm glad to see that you're back!
GitHub?😳
For some beefier processing check out the esp32 dev boards. They can be programmed with the same Arduino IDE and code but are single or dual core, 32 bits, and up to 240MHz. Oh and like four bucks a pop.
Nice project. Onshape is a good offer thank you.
Great job on the video! As a robotics engineer with experience designing and deploying industrial robotic arms, I have a few recommendations for improving the performance and reliability of this project.
First, I recommend using stepper motors with pre-installed gearboxes. Stepper motors offer precise control and high torque at low speeds, making them ideal for robotics applications. Gearboxes can help reduce the required torque and increase the achievable speed, but they also introduce backlash and hysteresis, which can affect the accuracy of the system. Pre-installed gearboxes offer better tolerances and lower backlash than those that are 3D printed, which can be difficult to manufacture with sufficient precision due to machine errors and limited material options.
Second, consider using closed loop stepper motors for professional use cases. Closed loop control allows the system to detect and correct errors in real-time, improving the accuracy and reliability of the system. It also enables additional features such as homing, which can be useful for calibrating the system or returning to a known position. The additional cost of an encoder - around $20 per motor - is generally worth it for professional applications.
Third, consider using a more powerful microcontroller. The Arduino Portenta is a good option, as it offers high performance and a range of connectivity options. Alternatively, an RP2040-based board can also provide good performance at a lower cost. The microcontroller plays a crucial role in the control and communication of the system, so it is important to choose one that can handle the required workload and has sufficient memory and processing power.
Finally, if you plan to add an end effector to your setup, make sure to consider the weight and the required torque and speed at the joints. The selection of bearings will depend on the load and the required stiffness and accuracy of the system. Proper sizing and lubrication of the bearings can help improve the performance and lifespan of the system.
I hope these suggestions are helpful, and I look forward to seeing more of your work on the channel!
Why recommend these mcu's? Portenta is way overkill and the 2040 does not have a single timer/counter with decent functionality for motor control. Closed loop for steppers is irrelevant if the system is designed correctly (e.g. loads are within spec).
I heard the teensy 4.1 has an actual FPU and performs as fast as integer math. That plus the higher clock speed might make it a good candidate for replacing the arduino nano.
Great to see you back. Hope college is going well and congratulations on the internship!
Awesome video 🔥 just found this channel a couple of days ago and binged almost all the videos instantly, and what is the chances that you uploaded a video just after. Can’t wait for the next one, keep it up
Just discovered your channel! Outstanding video! Keep up the great work! 👍🏼👍🏼
Subscribed. Great project and you explain things so well. The video pace is so good. And thanks for sharing the equation/code, I've been dealing with a calculation problem in my program and I think that's going to solve it.
I haven't tried this myself, but I think you might want to look at Jacobian matrices. The control loop could take the difference between the desired position and the current position to get a desired velocity vector in global coordinates. Then use the Jacobian to get required joint velocities. The resulting motion should follow something of a straight line. Also, you could look at equations for a four bar linkage to calculate joint angles and possibly use those to arrive at a Jacobian. Whether that could be implemented on a small microcontroller or not is another issue.
I really liked this project. I feel like this is a project that really brings together concepts learned throughout the engineering curriculum. Great job
Great video and explanations. You've got some great pedagogical skills as well as the engineering. I can definitely see myself borrowing that explanation of inverse kinematics in the future (soon to be teacher of math and technology here).
Really awesome Levi…every part of this build. Your explanations are executed very well, and the end result is outstanding!
What are the disadvantages of cycloidal drives? Many talk about their love for cycloidal drives and their compactness but no one talks about when one might chose a more traditional gearbox design.
This is a great explanation of some of the inner workings of a delta 3D printer too, and it’s easy to understand why they work so much better with a 32bit processor controlling them vs. the cheap 8bit micro controller the budget one came with.
Cool Levi, thanks for sharing!
We're happy to see you back. 😀
Thank you for giving parallel sacra some of the attention it deserves. I have a lot of interest in implementing this design in modern 3d printing.
I think there is a lot of potential in your design, I hope you keep improving it!
Wow congrats on your internship, great video love the editing and cool project.
Its good to see you're back developing your interest, cycloidal drive.
Great Job, keep up the good work!
Nice video! Good explanation of the IK. A large difference between scara and this 5 bar is that this is a parallel manipulator while scara is serial. How did you decide link lengths? I read a paper awhile ago about optimization of workspace to determine the geometry. Nice work again!
Great project. I'm happy to see you back, and I love the cycloidal gears. For your next trick, try building a spherical parallel manipulator and then explain the inverse kinematics.
the mechanical design looks so pretty!
Very well spoken and correct terminology; SUBBED !!
This was interesting. What i really liked, is this smart guy actually explained the problems and solutions for people like me. I'm so sick of watching people make awesome stuff, but they don't explain a single thing. I mean great, I love seeing the videos, but I am more interested in how it was done. Especially since I wasn't serious about education when I had the opportunity in school, and I work full time now, but now I am serious and constantly learning.
Anyways, great video, very interesting, and excellent job explaining it. I hope to see more!
I built a 3D printing parallel scara arm a few years ago. The main challenges were the gearbox backlash and how to home/zero the machine with good enough precision.
I ended up using belts and pulleys as a gear box, a harmonic drive would be ideal but they are way too expensive/hard to build. The zeroing was also very important to get done with very high precision. If the angle the software thinks you have is even very slightly off from the real angle, straight lines will not be straight anymore.
The parallel scara is very strong and can move at very highs speeds and accelerations. In the end the 3D printer actually performed pretty well. The zeroing was never properly solved so all prints were a little bit crooked, the prints looked good though.
Excellent work ,very interesting
Thanks! I actually was searching for the actually "SCARA" mechanic, but I didn't know what it was called. You made my day :) Also you gained a subscriber
Your freehand circle drawings are impressively good
Excelente trabajo, gracias por compartir tu creación.
oooh that's super neat I keep imagining a 3dpriter with a u shaped bed. but truly amazing great work man
That's really something! Levi! BTW, a big Merry Xmas to you and your family!🎄🎄🎄
I would use theta= atan2(y,x) instead of inverse sine and inverse cosine. It’s more stable and keeps track of the quadrant.
As for zeroing, I would put a single limit switch in the frame right in the middle where a “wrist” feature can touch. The homing would be really simple with that.
Try moving to an esp32 . Two cores . So you can move the calculations to the second core in order to always move with the first
I work with a similar arm at work, except only one motor drives the two arms in opposite directions (basically acting as the r control) and then the second spins that mechanism around (giving you theta), so it can cover nearly 360° out to the full arm extension with just 2 motors in the same relatively simple construction.
Good work. I built a scara arm myself too now working as a sandtable. For the compute issue you could Upgrade to an esp32 or esp8266. This would also enable you to Programm a simple Web ui to control your robot.
That is one hellava cup holder for your car! 😉 Awesome build.
Love this bro
yay Levi is back!!!
If you're doing simple linear stepping, the instantaneous velocity change may cause a lot of jerkiness, which is further exacerbated by the large backlash. The linearization will also likely cause angular velocity to change very often.
Great work!
Fantastic video
For the linearization, I think it would also be inteeesting to re-frame the problem in terms of the discrete steps that you take along the path. At each step, you need to determine which motor you want to step to remain as close as possible to the target line. (If you care about a constant movement speed, you would also need to solve for the individual delays in between those steps). That would involve just a bit of forward kinematics to simulate the outcome of each option, and then pick the one that is closer to the line. I feel like this could be done on-the-fly pretty easily.
Congrats on working in JPL!!!
Very cool project. I see a lot of people suggesting using a more powerful controller.
I wonder if a simple lookup table for the inverse trig functions wouldn't work in this case...
I played around with double polar drawbot concept, with very similar kinematics to scara kinematics. I precomputed the gcode for the linear movement and transmitted them over serial. I then stumbled across a project which inspired me to use gcode arcs rather than interpolating all the points, which was easily handled by the Nano.
Cool deal. You can pre-compute your inverse trig functions at some resolution (say every 1 degree), and put them in a lookup table. That way the robot's top speed will be much faster.
Highly recommend Mbed as a superior Arduino replacement if you're running into performance problems. Simple things are almost as simple, and more complex things are vastly simpler, than using Arduino. Performance is off the charts in comparison because the libraries are much better written. The full Mbed build includes a real-time operating system so you can even run multiple threads concurrently with little effort. There are hundreds of Mbed compatible boards around too, most very low cost. Hope this helps!
Those steppers look plenty strong to directly drive the arms when unloaded.
great job!
Motors are affected by acceleration constraints too; that could be the source of the “cruncyness”
Great project, but you can improove arm. You can preload robot arms by weak springs and use ceramic bearings in arm joints (due to lower weight). In addition you can install IMU sensor into the end of robot arm for more precise movements control. Best regards
Nice project. An idea from my side: You have both arms on the same vertical level. Therefor they collide quite fast, and you have only a little more than a 180° of working area (as you have shown). But if one is above the other, you may increase this to close to 360°. Best regards from Switzerland.
Really interested in this project. I'm trying since forever to buy a scara 3d printer. And I'm finally realizing I will have to build one myself if I want one
Have you seen arcdroid? Belts and pulleys. Very smooth. Also have you looked at core xy 3d printers firmware? I would think it would work great for this type of setup. Cool project!
if you remove the gear drive and use micro stepping ,then place the motors and arms at right angles then you should have a X and Y then grbl should work and 0/0 would be page center and gcode should drive the arms to any position within the limits.
Slick. For the cycloidal drive 3d printed inaccuracy issue, maybe use send-cut-send for them also? Can you see what sort of back EMF you're getting (you can make directional loop antenna with copper, place it near each stepper, and then hook it into your Rigol's chan 1 and2)
The cogging (or "stuttering" as other people have said) could probably be fixed with a look-up table? I don't know arduinononono but I know that division in general is 20x cycles more than any other math operation. I'm guessing any sinusoidal operation is moving into the 500ish territory unless youre using a DSP/FPGA.
What steppers are you using? They look pretty slick. If you replace the flat-base with 4 bearings, I bet you could turn this into a "Shaper Origin" DIY and out-perform most Bridgeports since you can get balanced BLDCs or PMSMs are in the sub-500$ range, and they're running at the ideal 30krpm that CBN and sintered-carbide inserts like. Or at the very least, low hanging fruit would be to just throw a plasma cutter head in there.
Would love to see a fixed version in a short video! Love it!
Awesome project! Did you consider getting the gears punched out the same way as the arms to take advantage of the accuracy of laser cutting?
Don’t stop. You are the future.
Have you considered adding one or more off-cycles between heavier calculations where you use a bit of interpolation to smooth things out before correcting the position in future cycles?
Sidenote each trig op takes much longer than a digital write I believe, but youre doing a lot of them and they add up so you might also want to look into direct port manipulation. For every set of digital writes you could basically have a single register store and it would be something on the order of 10-20 times faster. I also realize you are using a lot of delays which I'm not sure aren't just as significant than whatever math the arduino has to do. So if those are necessary - and it looks like they are - then nothing with port manipulation will improve efficiency much and you probably already knew that.
Expect the asin operation to take something like 100 micros although you also do some math inside the sin but lets say no more than 200. Some people have made their own look up table implementations plus some interpolation to combat the slow trig functions but I would start here first and before doing anything too fancy you would probably just get a different micro which is completely reasonable.
Hey Levi, great video! Glad to see you back on youtube.
Your comment on the computation time is probably not accurate. I have run a couple inverse kinematic functions on Arduino boards with 3 degrees of freedom and found that they run in microseconds.
You can use the micros() function on Arduino to find the actual time that the function takes to run. This micros() function does round to the nearest 4 microseconds.
My guess is that running the linearization loop with a shorter interval may fix your problem.
Also,, make sure you are using a stepper library that uses interrupts. This allows the microcontroller to pause computation to send a pulse to the stepper motor and then return to computing the equation.
Hey Levi, love your video. Just an audio suggestion have your mic slightly off center from your facing and you'll reduce the number of plosives you get, if you find that during editing that your left right balance is off afterwards, you can copy the more dominant channel across to even it out.
Sorry if you already know all that, since only a couple pars had any plosives it was probably just that you didn't have the time to re-record it.
Wow, such a nice project, I should really think about doing something similar in the future :) What is your background in mechatronics? Do you have a degree or are you a student?
Dr. Levi Lightning back at it again, showing off a JPL shirt.
I literaly just started on this exact project like 2 weeks ago lol. sadly I don't have any super fancy equipment or parts, besides a 3d printer, just some skateboard berings and some screws. ( I am using an arduino uno with a CNC sheld to control the nema 17 stepper motors) I was able to make the lines fairly consistant and not vary stuttery when going in stratgh lines and 45 deg angles. but they get more sloppy and "stairstepy" when going at steep angles. I found that you need vary little to no backlash and a whole lot of points for it to make a good line. I split it up so there is a point every millimeter. I hope this can help
It is not really a SCARA robot but a 5-bar one used on agravity plane.
I think this was worth the wait.
this is a very impressive build. would you be able to share some dimensions on the arms please as would like to have a go at building something like this. Thank you in advance.
At 10:40, if you have the circle intersection point for where the two links will meet, you can ignore the second (outer) link and final end point and just calculate the angle of the intersection point from your horizontal line using an arctangent function (rotating the angles if needed to account for the motor orientation). Calculating two angles and adding them is extra and unnecessary math work, in my humble opinion. But I've only done this sort of kinematics work on a laptop, not a microcontroller so I could be wrong about "just" being able to call an atan() function using the x,y offset of that intersection point.
Try using a raspberry Pi Pico for your next prototype, it's much faster while being pretty cheap, great video, and amazing inverse kinematics explanation
could prob throw some rubber bands or attach some springs to smooth out that backlash a bit... those motors should be able to handle that easily
Awesome!
You should give an esp32 a try. Then it could probably be controlled wirelessly also
Which stepper motors did you end up using specifically? I'm looking for a similar closed-loop stepper and these look really sleek!
I’m also interested since these have the IC board mounted directly to the back. Also, Have you thought about hooking this up to a HMI for more robust control interface?
Love it
Amazing! Where did you get the custom aluminium done?
nice job, I'm looking to do one too
Maybe use a worm gear to eliminate backlash ? Interesting idea nonetheless
Awesome robot
CAD software is great and all, but we all know the most important tool in the engineer's toolbox is McMaster-Carr
This semester in my University we are working on OnShape and it's a great tool, but we don't know how some features works, like FEA. Could you make some video lessons? We could really use it for our projects ;)
Parallel scara could make a interesting plasma cutter.
Wait, 1 year later he's back, great!
very cool. Where did you order the metal plates from?
any place you have shared the arduino code? great work.
If the one side was built higher than the other by the thickness of the inner arms and... The more extreme arms were built with an offset mount at the end you could make that robot reach over the back and maximise the motion.
Who did you use for the aluminum part outsourcing? Did you send them part files? STL’s? Thanks in advance.
Great ...so I this design four and more voice coil accurater can attach to print different colours 3d printer felament?
Fun fact: GRBL running on the same Arduino can control real-world milling machines straight from g-code with no stutter whatsoever.
You should be proud of your work here, ~25% of 'robotization tasks' are just a simple pick and place (and real world dynamics is more than sufficient distortion).
You should also research how to linearize the motion using state space and discretization techniques (if not for your own edification).
If you use induction motors (due to their power) for a project you don't have that position control as with stepper motors, so it means more control computations.
.....oh and encoders....don't forget the encoders.
Cool video. Use a Teensy instead of Arduino for computing power
Congrats on the internship!