420 likes | 560 Views
AS-116.2120 (ATJ). Specifications and testing requirements for passing iterations 1A, 1B, 2, 3A and 3B. Project: develop control software for the person lift according to specifications. Purpose of this document.
E N D
AS-116.2120 (ATJ) Specifications and testing requirements for passing iterations 1A, 1B, 2, 3A and 3B
Project: develop control software for the person lift according to specifications
Purpose of this document Lecture slides have extensive information about how the control software is developed This document has a subset of that information needed for passing the project: • Specifications for each iteration • Testing requirements for each iteration Lecture slides explain the process of moving from machine-level requirements to the tested product (required for exam) Thisdocumentassumesthatyouhavegonethrough the tutorial in Noppa
How creative can you be in the design? Lecture slides provide the architecture design and leave the detailed design to you However, you can do totally your own architecture based on the specifications is this document as long as you present the tests listed in this document • Recommended only for experienced developers who want to do things their own way Teachersareavailable to help in problemsituationsonlyifyoufollow the main architecturaldecisionspresented in the lectureslides
Demo interviews When you demonstrate each iteration, we interview you about the maintainability, scalability and reusability implications of your design decisions If you did not follow the architecture in the lecture slides, that is fine, but be ready for this discussion Even if you followed the lecture slides, there is no one correct solution
Test coverage Test coverage is a measure of the degree to which the source code of a program has been tested Good test design gives maximum coverage with minimum number of tests You do not need to use the exact test inputs as presented here, but you must provide similar coverage!
Example of coverage Pressing button for automatic movement drives platform to stored height If current height is less than stored height, platform is driven up • Else, platform is driven down Driving up and driving down involve different sections of code If our test involves driving up once and driving down once, but you present a test that just drives down twice, we will ask you to update the test
Iterations 1A and 1B- Moving the platform manually from the platform- Control place selection- Joystick mode selection
Iterations 1A and 1B Functions: • Moving the platform manually from the platform • Control place selection • Joystick mode selection Tests for iteration 1A require only movement in vertical direction Tests for 1B require that you have both vertical and horizontal movement working
Control place selection • Description: The function either enables the controls on the platform or the chassis (e.g. joystick is on platform). This status information is used to enable or disable other functions (e.g. functions using joystick are disabled if chassis has been selected.) • Triggering event: Value of “Control_place_selection” signal changes • States in which enabled: All
Joystick mode selection • Description: The function toggles the system state between “moving_platform” or “transfer” (driving with wheels) as described in the table. This status information is used to enable or disable other functions (e.g. Moving platform is disabled in transfer mode) • Triggering event: Change in value of Joystick_mode signal • States in which enabled: control place is platform
Moving the platform manually from the platform • Use double in Simulink for 16-bit signals
Moving the platform manually from the platform (In terms of scaled signal values) • Description: see tables • Safe state: DA = 0; UA = 0; LA = 0; RA = 0 • Triggering event: JUD != 0 OR JLR != 0 • States in which enabled: control place is platform and joystick mode is moving platform. If disabled, go to safe state.
Testsignal • Youneed to create the ”Joystick_up_down” and ”Joystick_center_position” signals for testing • Latter is truewhenformer is withinsometolerance of the center value
Behavior when place=platform and mode=moving Curving is due to joystick being gradually pushed up Zoomed in version on next slide
Observe behavior close to center position • Center value of Joystick_up_down=32768 • Joystick_center_positionactivates at a reasonable time (test block works) • Height does not change when center_position is true (note the zoom: Platform_heightx10^-4) • Height starts increasing immediately when center_position=0 (correct: simulator does not model inertia)
First, testhorizontalmovement just likeverticalmovementwastested in 1A
Further testing • To improve coverage, we try: • Movement with different tempo • Moving joystick into both directions, and • Crossing center position several times from both directions
Using a sine wave as the test input Here the stick passes below the center position of the Y-direction and platform starts moving down. Stick is now above center of Y-direction and platform starts moving up. What if joystick movement is reversed before platform reaches extreme position? Next slide.
Previous test with a lower sine amplitude: platform does not reach extreme position Movement of platform is reversedimmediatelywhenjoystickcrosses center. Correct, becausesimulatordoesnotmodel inertia.
Iteraatio 1B demo exercise (scenario) • System engineer wants to distribute the software: • Joystick signal processing • Forming cylinder actuation signals • For safety reasons, center_position signal should be sent separately over the network. This guards against corruption of network messages.
1B demo task Modify the software sothatJoystick_center_position is processed in the module that creates the Up/Down/Left/Right_actuate signals Then rerun all the earlier tests Check the nextslidebeforestarting
Hint for demo exercise Create a block “Forced_Off_Interlock” : Inputs: • Signal_In (double) • Forced_off (boolean) Output: • Signal_Out (double) Behavior: • Forced_off TRUE => Signal_Out:=0 • Forced_off FALSE => Signal_Out:=Signal_In This block will be needed in the later iterations
Cylinderlimitprotection • Description: IfLeft_limit = 0, functiondoesnotactivate • IfLeft_limit = 1, Left_actuate is forced to zeroevenifanotherfunctiongivesotheractuationsignals. This is a saftyfunction and hashighestpriority. • Safestate: Left_actuate = 0 • Triggeringevent: Left_limit = 1 • States in which enabled: All • Specifications for othersignals: replace ”Left” with ”Right”, ”Down”, ”Up”
Samejoystickramp input as in iteration1 At upperlimitup_actuateforced to zero At lowerlimitdown_actuateforced to zero
Samelow-amplitudesine input as in iteration 1B Testshowsthatlimitprotectiondoesnotactivatewhenitshouldnotactivate – important to testthis!
Iteration 3A- Prevention of unintentionalmovement- Automaticdriving to stored position
Automaticdriving to stored position • Description: Current height can be stored by pressing the quick button A or B for longer than sys_param: quick_position_register_time (hardcode this parameter into your application). Each button can store a separate height. After this, the platform is driven to the stored height by pressing the button shortly and keeping the enabling switch pressed down. If enabling switch is released, manual control is resumed. Horizontal cylinder is not moved. • Safe state: cylinders are stopped • Triggering event: Button A or B is pressed • States in which enabled: control place is platform and joystick mode is moving platform
Prevention of unintentionalmovement • Description: Cylinders are not driven if enabling switch is not pressed, regardless of joystick position. • Safe state: Cylinders are stopped • Triggering event: Enabling switch is pressed • States in which enabled: All
Joystick is moved gradually from down to up while pressing quick buttons Reached A but enabling switch is pressed: Stay in auto mode Drive to height A Enabling switch released: start moving under manual control Store height A
Zoomed version of previous slideFocus on button B First press takes 100 time steps Height is stored after pressing longer than the value in parameter “quick_position_register_time”. Here the value is 50. Reached stored position B Short press of button B interrupts Manual movement and starts automatic driving, which is done at maximum speed. When automatic driving is started, actuation signal goes to maximum (65535)
This time, the joystick is pulled down • Here we test upward driving with button A and downward driving with button B • Opposite directions were tested in the previous test. This test increases coverage of the automatic movement logic
This time, we use the button A twice • E.g. there might be a bug that keeps using the first stored position • Previous tests would not catch that
Iteration 3B- No new functionality- Update the design to groupseveralsignals to a single port and wirewithbuses- Thenmake sure thatyour the sametests as in iteration 3B stillwork
Before you begin Technical assistance on using bus objects is in the document Iter3B_Vinkkeja Lecture slides describe the design rationale in this iteration
New interface specification Use the following interfaces Lecture slides have one solution, but yours may be different, as long as you are ready to discuss its maintainability, scalability and reusability