controlling a robotic arm (Grad proj ) - Page 1
Forum section: electronics / projects

author: ahes
author_rank: Contributor
timestamp: January 20, 2012, 10:11:29 pm
content: Hi.I'm a senior in control department of an engineering faculty and my graduation project is an industrial robotic arm.actually this isn't my first time, I made this project 3 times before ( the results came up bad ) the last one was the only one worked automatically.here is a video for this last robot arm:And yes I know it's slow and the path trajectory isn't uniform.that is what I want to improve in this grad projectfor the speed problem this was something wrong with the motors driver, and I'm planning to use inverse kinematics technique to solve the trajectory problem.I'm writing this topic because I was planning to make tutorials and videos about the phases that my grad proj will go through. and I was planning to make them in Arabic.and I saw Dave's videos on youtube (they helped me alot ), and it encouraged me to make an English version of it too. and the best place for that is this forum.any suggestions, help or any comment is appreciated.

author: ahes
author_rank: Contributor
timestamp: January 20, 2012, 10:44:34 pm
content: I will start trying to solve to speed problem.In the attachments you will see the schematic and the layout of the old driver that I used.If you want to increase the speed of a stepper motor you have to work on a higher voltages ( that means you will charge the coil of the motor faster, delivering the required amount of mechanical power of the new speed, ext ) I will get back to this later in the designing step of the new driver.fair enough, what I suffered from really when I was designing the old stepper motor driver is if I want to change the driver parameters, like ( changing the chopper frequency for the chopper regulator, the rotating speed ) I had to change the values of the RC oscillator and it was really hardyou have to make you chopper frequency at least 10 times faster than your rotating speed and stuff like that ( don't worry I will get them in details later ) my point is it will be much better if you made all of these parameter changeable from digital device.that's why I decided to design a kit for developing the stepper motor driver.I'm using mcu AVR atmega8 that will receive command from a custom GUI ( I programmed that GUI using Ms VB6 ) those commands are the parameters that I want them to be changeable like the speed, direction, chopping frequency or even enabling or disabling the whole driver.long story short is I made this circuit ( you can see the schematic in the attachments too) and It actually succeeded but after leaving it for couple of weeks I tried to program it again but the mcu on the board is responding with pullshit I don't know where is the problem but I'm trying to fix it and I will keep you up to date.

author: amspire
author_rank: Super Contributor
timestamp: January 20, 2012, 10:52:18 pm
content: I am impressed just to see how far you have got. It may be early stages, but the arm is on the way.If you are going to use inverse kinematics, what sort of coordinate system are you using? A cartesian system, or some sort of quadrature system?I suspect that if you are going to use IK, the Atmega8 will struggle, as you will need a fair bit of matrix and trig processing power. Something with a floating point hardware would be good.One of the things you could do is to use an animation program to model the arm, and to generate smooth trajectory paths. That would be a quick way to get some really smooth arm motions that are changing all axes simultaneously, and even with the current motor speed, it will make the arm much faster.Please make some tutorials. They should be interesting.Richard.

author: Rerouter
author_rank: Super Contributor
timestamp: January 20, 2012, 11:13:20 pm
content: just a small thing, it looked as if the arm was hunting (rotation wise) as it lowered to each can, is there any specific reason behind this, or was it just the rotation of the lowering motor?

author: ahes
author_rank: Contributor
timestamp: January 20, 2012, 11:34:14 pm
content: @amspirethe coordinate system I'm going to use will depend on the type of joint for each linkthe arm I'm going to use has 3 revolute joints "rotating around a fixed axis " so I'm going to use a cylindrical coordinate system for each link and then all of them will be converted into a Cartesian coordinate system originated at the base, and this c-s will be the reference that all of the other points (the gripper, and all the work pieces ) is measured with respect to this system.ATmega8 is used just for the kit it's not the main processor in the system.Remember that the PC is involved, it will send the path as a punch of points in a matrix like a G-code in a CNC machine.and the processor will solve the unknown parameters using iterative techniques.if Atmega128 isn't enough I can upgrade to ARM core based mcu.for the floating point and trigonometric function it will depend on the sampling speed of the controller, still early to talk about this stage yet.@Rerouterdo you mean the vibration.

author: mobbarley
author_rank: Regular Contributor
timestamp: January 21, 2012, 12:05:01 am
content: Did you program acceleration / deceleration into it? It appeared to start and stop pretty harshly.

author: ahes
author_rank: Contributor
timestamp: January 21, 2012, 12:13:37 am
content: No,I had to deliver this arm in a harry, but if I did I would've been able to use IK.but I have an idea for the motors to accelerate and decelerate according to specific functionlike making the motor speed to follow a sinusoidal wave form, this is useful if you want to move the arm in circle for example.but every thing in time, the first thing I've to do is to make a decent driver.

author: mobbarley
author_rank: Regular Contributor
timestamp: January 21, 2012, 12:25:32 am
content: driver for steppers? I've used this board in the past - the IC is easy to work with.http://www.schmalzhaus.com/EasyDriver/index.html

author: ahes
author_rank: Contributor
timestamp: January 21, 2012, 12:49:22 am
content: Thanks for the linkbut I've read the specs and it said that the driver is working on 750 mA per pahse, but one of my motors is sucking 6 A per phase and this enough to blow up the circuit.alse I'm planning to use 80v supply and the circuit can take only 30v max.I think I will go through designing my own driver and it would be nice having a design that takes the parameters I'm putting for my robot, it can replace the commercial ones in our little projects.

author: mobbarley
author_rank: Regular Contributor
timestamp: January 21, 2012, 02:39:46 am
content: Absolutely - for that kind of power level you won't get an integrated IC, mosfet bridges in a package could still be used to save space compared to a completely discreet design.

author: ahes
author_rank: Contributor
timestamp: January 21, 2012, 03:28:55 am
content: I used before 3A mosfet bridge, It wasn't cheap 30 EGP about 6$ us.Size isn't really my biggest concern, I'm going with discrete components.the problem is how to drive them at higher frequencies, they have quite big input capacitance and if you didn't drive them strongly, you might be ended up operating in the linear mode.do you remember the video Dave made about designing Lab power supply when he used a transistor to switch off the linear regulator in the current limiting mode.the same thing will happen in here, at higher frequencies the input capacitance will filter the switching signal to an average dc voltage and that will drive the transistor in the linear region.so that I need a high output current capacity transistor driver, that can work on higher voltages.I found IR2110 MOSFET driver and it can operate to 500 V, and I will test it later.

author: mobbarley
author_rank: Regular Contributor
timestamp: January 21, 2012, 06:57:33 am
content: Mosfet driver ICs - but i'm sure you already know that as you know about gate capacitance.

author: daedalus
author_rank: Regular Contributor
timestamp: January 23, 2012, 02:45:46 pm
content: ahes: neat arm, and for a graduate project it looks like you have put a fair amount of effort in already. Here are a couple of things I would do:Buy and fit an E-STOP! seriously you have what look like pretty high gear ratios on this thing, and although its slow now, im sure you will turn the speed up at some point. Im sure there are some pinch hazards on the thing, and its a good habit to get into, especially on prototype robots which tend to go wrong a fair bit.Maybe redesign the gripper a bit. At the moment you have a rigid mechanism with stiff jaws, and no sensing of contact pressure. This means that you are relying on compliance in the object you are grasping to ensure sufficient force is achieved during movement (and in the process crushing the can a bit).Either taking a serial elastic actuator approach on the motor (spring in series with motor drive, sensing of spring position), or changing the gripper teeth to a compliant material like rubber, and measuring contact force with an FSR. The latter approach could probably be retrofitted easily enough, and is similar to how the PR2 gripper works.Control wise it seems like you are doing bang bang control on the axes. Having a trapezoidal velocity profile will smooth things out a bit. With regards to path planning, take a look athttp://www.kuka-robotics.com/en/products/software/educational_framework/arm_tutorials/PS_Content_Arm1.htmwhich covers the basics of generating paths for arm controllers. As long as your low level control is embedded, you can build the fancy stuff (FK, IK, path generation) as PC software and just command the arm over a serial bus, you don't have to worry about getting it all banged out on a cheap micro.Good luck with your project.

author: ahes
author_rank: Contributor
timestamp: January 23, 2012, 10:53:11 pm
content: Quotejust I wanna clarify something, the arm in the video isn't my graduation project, it's an old projectIt was a job assigned to me from a factory who wanted to make something to put it in quality control gallery.my grad proj is a new arm ( I aim to be better than the one in the video ) every time you gain some experienceI have a picture for the new arm I just don't remember where at the moment, but I will post it here soon.Quoteit hit me on my head once, but here in Egypt we don't care about safety, we have more people than we need. It is ok if it killed some one "I'm just kidding".certainly I'll do that.Quoteyeah, that was a design error, I was interested more in the motion profile, but I already looked into some force sensors, and I'm going to use one.QuoteI couldn't agree more.and specially the rubber idea, I'm gonna use it if I ran out of time.QuoteThis specially what I wanted to thank you for.the inverse kinematics and the path trajectory finding was consuming me,that I didn't have much thoughts about how to make them all move together "the joints I mean" so that each link will reach it's final position at the same time, accelerating and decelerating simultaneously.Quoteyes, that's what I'm planning to do.I want to send the path trajectory as a series of points and the MCU has only to connect the dots and filling the spaces, no IK for the MCU unit.thanks daedalus your post really helped me a lot.

author: ahes
author_rank: Contributor
timestamp: January 23, 2012, 11:07:51 pm
content: this is our new armjust remove the link in the middle.

author: ahes
author_rank: Contributor
timestamp: February 22, 2012, 08:18:07 am
content: sorry for being late.The thing is I want to start with making the stepper driver and all of the control and electronics circuit.but there were an uprising and turmoil in tahreer square where the electronics market is located, and the whole market were blocked, that why I had to wait.but then I started making the software first, and finally I made a 3d simulator for the armthis video will explain every thing.any comments or other ideas will be appreciated

author: IanB
author_rank: Super Contributor
timestamp: February 22, 2012, 08:57:35 am
content: If you take a look at the Dymola modeling system from Dassault Systemes (there is a free demo to download) there is an industrial robot arm included as one of the demos. This is a model of a six axis arm with electrical and mechanical systems and a path planning controller. You may find some useful insights in that model.

author: ahes
author_rank: Contributor
timestamp: February 22, 2012, 03:15:47 pm
content: It's a powerful tool, but it seems a little bit hard to usedo you have a video for path planning controller

author: ahes
author_rank: Contributor
timestamp: February 22, 2012, 04:25:22 pm
content: take a look at this videoin robowave they made an offline programmer for the robotyou see the little arrows specifying the paths of the robot's end effectorI want to build a software that enables the user to draw this paths "like routs on a pcb" then he can put what ever he/she wants "robot commands" on those paths.and then if you're sure that every thing is good, then you can compile the motion plane into an executable file to download it on the real robot.what do you think about this way of programming.

author: ahes
author_rank: Contributor
timestamp: February 24, 2012, 04:30:36 pm
content: Hello Again.in the last video you saw when I want to change the camera view point in order to look at the robot from another place I had to move location along with each individual axis.This was ugly and unprofessional, in all programs they rotate the camera using the mouse wheel button, and the mouse pointer location.but there is a problem arises in here that the mouse moves in two coordinate plane and the camera is placed in a 3 coordinate system, this what we are goint to talk about here. but first we need to establish some rules.This is not a tutorial explaing how to use directx we'll use it to ilustrate things up, using it as a tool studing it is beyond the scope of this script.The same thing is applied on the programming language I'm using here, you can apply it on any programming language ( but if you don't know any language it is really a shame.)The videos are going to be without any commentary this time. ( I've listened to video I made last time and my accent sounded outfall, although it kinda sounded nice when I was hearing the words straight from my mouse)before you continue with me you should've studied linear algebra ( specifically Matrices )and lastly take a look at:http://en.wikipedia.org/wiki/Rotation_matrixhttp://www.fastgraph.com/makegames/3drotation/this is about rotating objects in space.now to answer the previous question how to use 2 coordinate sytem to control 3 coordinated sytem.direct x uses transformation matrices in order to manipulate every thing in the 3d worldI will asume that you've read the previous links about transformation matrix.the first matrix that direct x uses is "the world matrix" this one represent the base coordinate sytem where every thing is placed with respect to. If this matrix is "I" ( identity matrix ) every thing will be rendered (drawed ) without altering its position or it's orientation "compounded pose"the other matrix will represent the camera ( or your eye ) this matrix holds information about the camera postion and orientation " where the camera is looking, witch way is up, so not to draw every thing fliped upside down )and what directx does actualy is that it will multiply those two matrices to generate one matrix that directx will use to draw every thing with respect to it.but first it has to reverse what ever this matrix tells youfor example if you're holding a camera taking a photo of a carif you maved the camera right then you can imagine that the car is moved left.you see the car is moved left or the camera is moving rightit's now obvious to manipulate the camera matrix to change the way you look at the scene.back to our problem how to use 2 coordinate mouse to control 3 coordinate camera matrixone of the solutions "I'm using now" is to rotate around y "yaw rotation" using the mouse movement on x Axis.each step positive you can rotate like 5 degrees clockwise or more depending on the speed you want.but this will leave us with 2 other axis ( x,z) and only one mouse axis to control them.if you assigned this direction of mouse to control for example the x axis of the world "graphics world, not the world we live"you will get the results in the next videoAfter couple of rotations and you'll be lost then you will foget how to go back to the orginal pose.the solution for this particular prblom is not to rotate around the the world's X axis, use the camera X axis instead, now you will gain control over the world's X,Z axis.the axis of rotation depends on the order of rotation matrix multiplication.if you pre-multiplied the camera matrix by the rotation matrix ( C * R ) then you will get a rotation around the camera's X axisbut if you post-multiplied the camera matrix by the rotation matrix ( R * C ) then you will rotate around the World's X axisand what we're going to do is that when we rotate around Y "yaw rotation " we will Post-multiply and in the case of x we'll pre-multiplylook at the results yourself in the next videooops the rotation is around the x but the camera is filming the sky.imagine that you're holding the camera, in the yaw rotation you can move around the object but in the pitch case "rotaion around X" you have to evovle 2 wings and flyin mathimatics you have to rotate the vector connects the worlds's coordinate system's origin to the camera's originthen you have to multiply the Rotation matrix to this vector and then you will rotate that vector with the camera "fly with the camera"here's the final result-------------------------------------finally: I know all of the stuff in here are not electronics but this really important in robotics "Transformation matrices I mean"If there's any one interested of what I'm saying please let me know.the purpose of writing this thread in here, is to share every step I'm taking as my project is evolving with people who have the same interest I do. and first I thought it's going to be a couple of chips and a software on a microcontroller then I'm done.so please tell me should I continue.or you really guys want to stick to electronics

author: FreeThinker
author_rank: Frequent Contributor
timestamp: February 24, 2012, 05:15:32 pm
content: I remember my first experience with an industrial robot arm (Kuka). I can say without doubt that they are very unforgiving if you get in thier way.

author: ahes
author_rank: Contributor
timestamp: February 24, 2012, 05:46:34 pm
content: And the last video is up.I don't know is it me or youtube is getting slower.Quoteget in their how, and what they gonna do.

author: daedalus
author_rank: Regular Contributor
timestamp: May 21, 2012, 01:17:22 pm
content: Hi Ahes,Just a quick hint, in case you are still having issues with the 3d mapping for mouse, what you are looking for is called an arcball algorithm. This projects your 2d mouse movements to rotations of a sphere, and calculates the correct transform for the object, which allows 3 rotational DoF with a 2d mouse. It will be documented in any good directx book, and I bet there are loads of tutorials online.You will still need 2 modes, one with arcball for rotation of scene, one for panning.The rotational effect is that the scene rotates in front of viewer, if you want a more first person effect (like your head turning left/right), you could implement a first person camera system, again there will be lots of tutorials for this.Its probably worth looking at building a scene graph into your code, this is a tree structure where each node has its own relative matrix transform, and a list of child objects. If you google scene graph you will find lots of tutorials.