Mechatronics with MATLAB and Simulink, Part 2: Importing Mechanics from CAD Tools



hello stereo denturri of the MathWorks I'd like to talk about mechanical modeling alright and so we've been working with this you know robotic arm your you know electromechanical system right in that you know mechanically there's what probably about I don't know six or seven moving components but if you actually think about the part and when you're right come down to the nuts and bolts and washers there's probably a couple of hundred parts that make up this robotic system alright and so the mechanical these mechanical design of these systems it takes place in CAD tools tools like SolidWorks pro/engineer CATIA there's a number of very very good tools that do these things all right and effectively what the mechanical design is is a description of the geometry you know the shapes of the parts as well as where and how they're connected and then the material choices and it turns out that that's pretty much you know the majority of the information that we need to build our mechanical models so in this video we want to show how we can leverage these CAD tools to essentially build very useful simulation models that we will employ to develop our mechatronic systems so in our first video we showed that we could directly model the mechanics and the electronics and the controls and software all together and that we could use us to assess you know kind of performance of the design the ability of it to you know hit positional requirements to hit speed requirements and electric power consumption requirements alright so we did all this through the tool MATLAB Simulink and we see that in our plant model that they're really the electronics components and the mechanical components working together like this and we kind of dive in to the mechanical piece a little bit more deeply we'll see that we're working with various you know geometric or really mechanical parts you know whose shape define things like you know the mass and the inertia all that kind of stuff you know it's through this mechanical model that was able to essentially you know accurately represent the mechanical loads that the electronics and controls will work with to achieve the motion objective so I'd like to introduce you to a tool called sim wise right let's hit run you'll see it's a mechanical simulation tool this is not Simulink that's independent product but it's become my preferred way of bringing mechanics into Simulink and so I mean demonstrate that okay so I'll run this little utility I created an import to simulate you'll see it's going to operate on the active sim wise document right there okay and so it opens up a Simulink model a blank Simulink model copies in all the appropriate blocks connects them properly and populates it with the information that represents a system okay now this is a Simulink model if I hit the Run button right now we'll see the animation will automatically be created and there's a robot alright now it's moving as it is is because we're not telling those electric motors you know what to do we're not even really telling the electric motors what they are yet okay and we'll see in a waiter video we'll really get into the electronics of motors in relation you know appropriately represent the the dynamics of the electric circuits and all that sort of thing so this model the robot arm in sim wise took me about 10 minutes to build you know starting from the cat assembly file and bring it into semi like so I want to take you through a little bit of what what I did and the features of this tool that enabled me to do it so rapidly alright so we'll begin with the import of the cat assembly file so let's go to file and we'll open up a new one right and this is very important actually so you'll see the the documents that can be open with this tool so obviously it can open up its own documents you know these sim wise models but you can see all these very relevant CAD tools like in since SolidWorks and Autodesk Inventor Solid Edge CATIA Pro II various generic file formats like steppin ASIS and you know I just and so forth alright and I'll do you know we have this this modeled in in X document and I'll bring that in all right so this is gonna be a CAD assembly file right ok so this is a native import of a Siemens in X assembly you'll see that the assembly structure is WestEd here on the left and it's preserved from what was defined in the original CAD drawing now if I hit the Run button this point everything just Falls freely due to gravity okay and what I'm gonna do is I'm going to just go ahead and anchor and there's this piece it's kind of our natural anchor it'll just choose to fix it and now I'll hit run and I'll see that part remains everything else falls alright now what I'd like to do is put in my first joint my first joint is connected basically with this bracket right here so it's box zoom in there alright I like to hide one of the parts it's kind of a nice way of doing this and I think it'll make sense as I go through this so anyways let's create our joint alright in our joints really begin with the chord tool and the chord is a short for coordinate frame XYZ Cartesian coordinate frame and I'll click a chord frame right there alright and that's gonna mark the location of the joint alright and you'll see that that chord Row is connected to that fixed part all right and we can see that in the assembly structure here – it's that chord has a parent-child relationship with that part ok now my hidden part which shows up in my West right there Ness is I hover over it shows up in – wine format in my viewing window I'm gonna select that as well and it's those two pieces of in from the location of the joint and the other part to connect to is all I need to create the joint I want to create and I'm going to choose a revolute joint let's bring the part back right mouse click show let's hit run okay and that's a revolute joint eventually it tumbles over due to gravity all right that bracket called the turntable base it's part of a sub assembly that was originated in the original CAD definition of this entire robot okay I'm gonna go visibility hide all others just so you can see it and what we have here is really an assembly that's gonna really move as one part all right and and so you could think of it as like welds or screws or you know various things that might connect that overall assembly all right so let's just bring the whole robot back all right but what I want to do is I want to treat this as if it is one part and so I refer to that as rigidly joining the bodies all right and now I hit run and we'll see that an entire assembly is moving like this and you can see the different weight distribution is reflected in the motion that we're seeing you know that it doesn't really do the full rotation that we saw before so the joint that we've put together this one right here that's what we call revolute joints very much like a passive hinge right now in reality it's actually a driven motor all right and so double-clicking on that joint you'll see its definition right there revolute joint well that we can redefine to be a revolute motor and you'll notice as I click on this its shape changes it gets a little bit of a platform also introduces a new page that we can work through I'll go ahead with the default which is really 90 degrees per second angular velocity rotation all right and we'll hit run okay and that will just simply you know not worry about gravity and just drive it at that constant velocity okay and I think just to kind of clean a few things up for right now I'm gonna make it a zero torque motor all right that essentially makes it a revolute joint again it's a revolute joint that's now been identified as a motor all right and I'm gonna label it I'm gonna call it the turn table motor all right and we'll see that that's enough of an indication that when we bring it into Simulink it will know to kind of set it up so it will be ready for a more precise definition of the electro dynamics of a real motor so when I finish up with our original model which we see has six motors and generated the Simulink model that we see here right and so for each of these motors there's an i/o structure that has been created by default it receives a signal with units of Newton meters and centrally those are the torques it will be driving the mechanism through these these motor you know objects all right now the turntable motor you know we're looking at right here essentially it is a block I'm gonna go ahead and delete that input right there and I just want to kind of focus on kind of variations you know the various configurations that we can run this with and so the default will be torque as an input but we can also tell it how we want to move you know that this will be a motion signal that will send in they'll be defined in units of degrees in seconds right another option is what I call a shaft alright and this is important as we get into these electromechanical simulations and we connect into this tool set called sim scape which has some very good electrical models all right and so I'm going to go grab a permanent magnet synchronous machine all right now the default for this is to receive torque as an input signal okay but we can change that mechanical input to essentially a shaft which we can then connect directly into our mechanical assembly like that all right and with a B and C being an electric circuit ports we'll see how in an upcoming video how will connect us into an electric circuit simulation so you're probably beginning to guess already that I like hardware all right and I like the reality that hardware brings to real engineering into real simulation okay and certainly we saw some grab it this way you know we saw some CAD models that reflect the general nature of what this robot is okay and yeah you know maybe one way I'd like to say it is mechanical systems are not just mechanical you know you know and that there are these black boxes right and these black boxes are our electric motors and that this thing will move because software will control the voltages to those motors to in a way that we're able to achieve the movement that we want of the system okay so anyways hopefully what we showed in this video is one of the really important connections all right this is the connection to the world of the mechanical engineers right that they're tall choice is a CAD tool it's in those tools that they design these mechanisms mechanisms they also define the means for having them created or built you know that that machine shops 3d printers you know all of them really begin with some sort of definition of the the geometry as captured in the CAD tool so anyways I think what we saw here this idea of bring the mechanical assembly into Simulink within 30 minutes that's what we need to go for all right and I hope that through this video that you see something promising that will enable you to do that and to really reap the full benefits that simulation can bring because of that so thank you very much for watching this video and if you liked it please hit the like button it's very useful it also makes us feel very good so we appreciate it very much again I encourage you you know connect with us in various meats early and here's my Twitter Twitter √°ndale I think you'll find me unwiped and there's various ways in which I think we can get this conversation going and I would love to hear from you okay so we have more videos coming up I think you have the opportunity to influence those videos by the type of feedback you give us too so anyways thank you very much this is Terry bye

8 Comments

  1. Assignement Help said:

    http://www.assignementsolving-41.webself.net/
    I am industrial engineer. More than 5 years experiences with MATLAB/ANSYS/SIMULINK/R/SPSS/EXCEL/SOLIDWORKS….I can solve all your problem in the fiel of : mathematics, electrical engineering, mechanical engineering,control and automation, data analysis, strengh of materials, physics, fluid mechanical, computational fluid dynamics, system modeling, heat transfert, hydraulics…statistics, linear programming,
    free to colaborate with you (long term)

    June 28, 2019
    Reply
  2. Anthony Odhiambo said:

    Where can I download the CAD model for the robot used in this series??

    June 28, 2019
    Reply
  3. Pratik Prajapati said:

    HIII
    I have creo installed in my PC.
    Where did find the cad model of this robot?

    June 28, 2019
    Reply
  4. Mohammad Alshawabkeh said:

    Just an amazing series! Thanks Dr. Terry!
    I'm exploring the tool along with different examples.
    But I have an issue with finding the best mechanical constrain to link the CAD parts. Kindly refer me to a certain source so I can overcome this.

    Thanks again.

    June 28, 2019
    Reply
  5. Chimsom Isidore Chukwuemeka said:

    Great Work Sir…
    I really appreciate this…
    I have tried some of the examples on this series, but usually get stuck when trying to import them into Simulink.
    The "GetGeometryGUI" function is not on Matlab. Is there anyway you can help sir!

    Thank you very much!

    June 28, 2019
    Reply
  6. Michael said:

    Great video Terry!

    June 28, 2019
    Reply
  7. Mohamed Ramadan said:

    Hi Terry, I just wonder if there's any link for downloading SimWise. I can't find it till now

    June 28, 2019
    Reply
  8. Leonardo Araujo said:

    Does SimMechanics still support importing the coinstraints (mate) from solidworks right? Does we need to buy an extra license (SimWise 4d)?

    June 28, 2019
    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *