• Portfolio
  • Aviation
  • Blog
  • About
Menu

David S Miller

  • Portfolio
  • Aviation
  • Blog
  • About
 Kinematics model verification

Kinematics model verification

 Overall control model

Overall control model

 This is the error I get when I try to run the simulation.

This is the error I get when I try to run the simulation.

 Kinematics model verification  Overall control model  This is the error I get when I try to run the simulation.

Learning to Use Simulink

March 23, 2016

For our senior design project, we are trying to implement a swerve drive system to achieve holonomic robot motion. None of us really know much about controls, but from the information we have gathered online, it seems advantageous to model our control system in Simulink before trying to implement it with code on our robot. Simulink seems pretty simple to use, at least for basic PID loops. If you have a block diagram for the system you want to model, you just drag and drop the blocks of the system and connect them together. You can change the parameters of the blocks simply by double clicking. 

I made a really simple one here of a basic PI loop responding to a step input. You can change the proportional and integral gains to tune the controller, if you wish. 

Here are my concerns regarding the Simulink model:

  1. I don't know how to model my inverse kinematics with the standard blocks. Will I have to make my own custom block to do all the kinematics, or make each step of the equation a separate block?

  2. How to get the angle of the robot with respect to the ground? In our robot, this will come from a gyro, but how can I model this in Simulink?

  3. Step inputs and sinusoid inputs are useful, but it would be really helpful to model the input from our actual joystick. I need to figure out how to do that. There is a joystick block, but I have no idea how to use it.

  4. We currently have no idea how to model the robot dynamics (the 'plant', in control theory lingo). This is the most important part. If your plant is inaccurate, your control will not work.

  5. Where does the plant begin/end? Should we attempt to model the motor behavior in Simulink? Or make the motor part of the plant? I've found sources online that go either way.

So after a couple hours of playing with Simulink, I think I have solved issue #1. I ended up writing a custom Simulink block from a MATLAB function. It then compiles the MATLAB code into the block. I am making a smaller system to test the kinematics independently. I will check them with the graphs I generated earlier in the semester.

I sort of found a way around #2 for now by integrating the angular rate signal. But the angle from this is before the plant, so it is not really correct. But it may work for now, just to get the system to run.

The main problem I have right now is compiling the code from the MATLAB Function Block. The Simulink-compatible C-compiler is was not installed on my computer, so I had to download the Xcode app and use the compiler. But it's still returning an error, so there is something else I have to fix evidently. 

$\setCounter{0}$
In BreakerBot, MATLAB Projects Tags Modeling, MATLAB, Simulink, Control
Comment

Blogpost Search

Blogposts by Category

Select Category
  • Academic Projects
  • Aviation
  • BreakerBot
  • Engineering Education
  • Illusionist's Locket
  • MATLAB Projects
  • Machining Projects
  • Personal Projects

Archive

  • May 2024
  • December 2019
  • November 2019
  • September 2019
  • April 2017
  • January 2017
  • August 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • November 2015
  • October 2015
  • June 2015
  • April 2015
  • February 2015
  • January 2015

Copyright © David Miller 2019