1 / 5

Design of Control Strategy

Design of Control Strategy. Environmental Disturbances. Control Strategy. System Dynamics. Goal. Output. Sensors. Feedback. Linebot. Goal Follow the path defined by the black line Strategy Drive left and right treads at same speed

rory
Download Presentation

Design of Control Strategy

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design of Control Strategy Environmental Disturbances Control Strategy System Dynamics Goal Output Sensors Feedback

  2. Linebot • Goal • Follow the path defined by the black line • Strategy • Drive left and right treads at same speed • If left light sensor drops below threshold turn right. • If right light sensor drops below threshold turn left.

  3. //define motor outputs #define LEFT OUT_A #define RIGHT OUT_B #define THRESH int dir=0; task main() { // configure the sensor SetSensor(LEYE, SENSOR_LIGHT); SetSensor(REYE, SENSOR_LIGHT); start decision; start motion_control; } We will introduce a global variable dir. If dir = 0 we will travel straight. A negative value for dir will cause us to turn left and a positive value of dir will cause us to turn right. Two sensors LEYE and REYE are defined. Two parallel tasks are started. Task decision will read the sensors and decide if we should go straight, turn left, or turn right. It will set the global variable dir to 0, -1, 1 depending on the readings of the sensors. Task motion_control will have access to the global variable dir and based on the value actuate the motors. Linebot Implementation

  4. task decision() { // write the statements for this task } task motion_control() { // write the statements for this task } Task decision must continuously monitor the sensors (forever). It sets the global variable dir to -1,0,1 depending upon the sensor readings. This will depend on the value of the defined constant THRESH. Task motion_control has a fast loop which cycles forever. It accesses the global variable dir and adjusts the motor signals. Linebot Implementation

  5. LEFT_EYE RIGHT_EYE x L W High value Threshold value Low value X -W/2 W/2 The Decision RIGHT_EYE AND LEFT_EYE both below threshold go straight RIGHT_EYE below threshold turn right LEFT_EYE below threshold turn left

More Related