필터 지우기
필터 지우기

Creating a position sensor for hydraulic actuator

조회 수: 3 (최근 30일)
James
James 2015년 4월 1일
댓글: A Jenkins 2015년 4월 2일
I have created a system in SimHydraulics to simulate a landing gear of an aircraft, I would like a sensor that would constantly monitor the position of the aircraft and notify me when it has fully retracted
Does anyone have any thoughts as to how I would go about this?

답변 (2개)

Sebastian Castro
Sebastian Castro 2015년 4월 2일
I'm assuming you have a cylinder block somewhere in there, right? You can connect an Ideal Translational Motion Sensor block between the R and C ports of the cylinder to get its position.
Just make sure the initial position in that block is the same as the initial piston displacement in your cylinder block. The easiest way is to create a MATLAB variable out of that position and refer to that in both places.
- Sebastian

James
James 2015년 4월 2일
Yeah I already have one of those, but i need something to physically tell me, in the matlab command window, then the actuator has reached 0.5, im currently using a matlab function block with and if statement and a disp('') command to display in matlab command window when it has reached full position.
However I am having trouble with the fact the display is repeating hundreds of times when i only want it to once.
this is my code
function y = fcn(u)
if u >= 0.5
disp('Nose LG Door 2 Deployed')
end
y = u;
  댓글 수: 2
Sebastian Castro
Sebastian Castro 2015년 4월 2일
편집: Sebastian Castro 2015년 4월 2일
Oh, I see! I can think of 2 solutions:
1. Use a Triggered Subsystem using the logical condition as "u >= 0.5". This way, the MATLAB Function will display only when your logical signal has crossed over from false to true.
2. Create a persistent variable in your MATLAB Function so that it "remembers" when you did your first display. Then, you can use this memory state to not display on subsequent time-steps.
Hope this helps.
- Sebastian
A Jenkins
A Jenkins 2015년 4월 2일
I answered similarly to #2 in your other post.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by