lego_rip_simulation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lego_rip_simulation [2017/02/27 10:24] – joaomatos | lego_rip_simulation [2017/02/27 10:39] (current) – joaomatos | ||
---|---|---|---|
Line 3: | Line 3: | ||
Follow this simple tutorial to learn how to export your Lego assemblies using SolidWorks to Simulink. Simulink is a powerfull tool to develop and test your controller before you go to the actual project and start coding. | Follow this simple tutorial to learn how to export your Lego assemblies using SolidWorks to Simulink. Simulink is a powerfull tool to develop and test your controller before you go to the actual project and start coding. | ||
+ | You can find a lot of useful things for this project under this kit: | ||
+ | {{:: | ||
+ | There is a **Matlab script** to run the LQR calculation and find the gains ( the derivation of the model is shown in the system modelling section). There is a folder including the **complete building** of the system . There is another folder that you will use to run the Simulink programs named **Only Sensors building**. There you will find Simulink programs to simulate only the balance , the swing-up and the balance , and a fuzzy logic controller. | ||
---- | ---- | ||
Line 10: | Line 13: | ||
==== How to export a SolidWorks Lego assembly into Simulink ==== | ==== How to export a SolidWorks Lego assembly into Simulink ==== | ||
- | You can get all the necessary .STL parts to build the RIP project on this file bellow. If you want the assembly already done, you can find inside the folder "only sensors building" | + | [[lego_rip_simulation_cad|How to export your SolidWorks model into Simulink]] |
- | + | ||
- | {{:: | + | |
- | + | ||
- | + | ||
- | | + | |
- | + | ||
- | Download the latest Simscape Multibody Link Plug-in in the following link: | + | |
- | [[ https:// | + | |
- | + | ||
- | Follow these simple instructions on how to install a Plug-in if you don’t know how to. | + | |
- | [[https:// | + | |
- | + | ||
- | + | ||
- | 1-> If you did not make your assembly , Open the “RIP only Sensors building “ and open the “PendulumAssembly” file at SolidWorks. | + | |
- | Enable the SimMechanics Link add-in in SolidWorks: (on the top toolbar , click on the gear (add-ins) , scroll down and check the SimMechanics Link box) | + | |
- | + | ||
- | {{ : | + | |
---- | ---- | ||
- | 2-> When you are done with your assembly, you can export it in the format to be used by Simulink following : (Tools > SimMechanics Link > Export > SimMechanics Second Generation ). Save the xml file with the SAME name as the assembly name! | ||
- | {{ : | + | ==== Videos |
+ | **You can use SolidWorks to build a virtual model of your project and get important data as Center of Gravity, Inertia and mass of your assembly.** | ||
- | ---- | + | {{youtube> |
- | 3-> Now open your Matlab , make sure that you are in the correct folder on the matlab path , and in the command window type: smimport (‘YourAssemblyName’) and hit enter. (change the argument to the name of your assembly). A simulink window should open and you can see the model of your system . | + | **You can test if you did the LQR calculation right , simulating only the pendulum balance:** |
- | {{ : | + | {{youtube>zrT3VJjqWLY? |
- | + | ||
- | ---- | + | |
- | + | ||
- | + | ||
- | 4-> Hit the play button and see if the dynamics and the parts of your system are all correct. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | 5-> If your model seems to be running with some lag, try to change the model parameters to the following : (decreasing the step size – set max step size to 0.001- | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | 6-> The basics that you should know to start developing | + | **You can test your swing-up algorithms and test your switch controller to see if the integration of your swing-up controller |
- | {{ : | + | {{youtube> |
- | **Under State Targets**, | + | **Also you can try new ways to control |
- | ** Under Internal Mechanics** , you can set some parameters to the joints like stiffness and damping, it will make it to be more realistic - if you set everything to 0 you will have the ideal conditional of no friction. | + | {{youtube> |
- | **Under Actuation** ,you can enable/ | ||
- | Under Sensing , is where you can enable the option to get the “real time” data from this joint . For our controlled version , we will enable position and velocity data. | ||
- | With this briefly explanation you should be able to wire some blocks and make your control scheme and see if it works. I will provide my block diagram with the controller using PD provided by the LQR calculation. There is a lot of ways to construct your block diagram , use your creativity! | ||
lego_rip_simulation.1488219843.txt.gz · Last modified: by joaomatos