4
$\begingroup$

I am currently working on a project for a Lego Mindstorms EV3 autopilot using Matlab/Simulink. Basically, I am using a closed loop control system with a PID controller for the control of the control surfaces. I'm using Simulink to construct the autopilot block diagram. The feedback loop consists of the gyro sensor. Now the gyro sensor is not accurate in the sense that it has some offset. It does not have any bias or noise. I need to get rid of the offset to give me the actual angle of the device. How could I solve this problem? I could use a low pass filter but how do I know what transfer function to use in Simulink?

$\endgroup$
0
$\begingroup$

Not sure about matlab/simulink, but siply substracting the offset is not possible? I would solve it in code, just

...
dx=readDx();
dx=dx-offsetdx;
...
$\endgroup$
  • $\begingroup$ Hi gilhad, Thanks for you reply. This project is required to use simulink. I just don't know how to achieve this in simulink. $\endgroup$ – Mason Apr 30 '17 at 14:37
  • $\begingroup$ I do not know simulink, but from fast googling there should be possible to use TransferFnc ctms.engin.umich.edu/CTMS/Content/Basics/figures/… with numerator [1 -offsetdx] and numerator [1] $\endgroup$ – gilhad Apr 30 '17 at 21:21
  • $\begingroup$ You can use the addition operator in simulink. If you already know the offset value. Else, you must get some external sensor or input to compute or receive the offset value. $\endgroup$ – Gürkan Çetin May 10 '17 at 17:23
0
$\begingroup$

One reason is that the gyro is not being software reset. A hardware reset(unplugging and plugging in gyro) might help too

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.