Line Following - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Line Following

Description:

Then we got both motors going by using hysteresis (transition overlap) ... (Get both motors going with hysteresis) (Use proportional control for smooth transitions) ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 20
Provided by: donho5
Learn more at: https://www.austincc.edu
Category:

less

Transcript and Presenter's Notes

Title: Line Following


1
Line Following
  • Lets review portions of Line Following Exercise.
  • First we used bang-bang control to follow a
    lines edge (right side and left side).
  • Then we got both motors going by using hysteresis
    (transition overlap).
  • Lets introduce proportional control by using the
    motor() function. motor (motor ,percent
    full power) We might achieve smoother
    transitions.

2
Follow Left Edge of Line
Definitions White 25 Black 125 port_motor
1 starboard_motor 3
Buggy
3
Control Strategy Plot
4
Pseudo-code
sensor analog(3) /read the sensor/ If
(sensor lt 75) pmp 100 /set port motor
power/ smp 0 /set starboard motor
power/ else pmp 0
/set port motor power/ smp 100 /set
starboard motor power/ motor (port_motor ,
pmp) motor (starboard_motor, smp)
5
Follow Right Edge of Line
Definitions White 25 Black 125 port_motor
1 starboard_motor 3
Buggy
6
Control Strategy Plot
7
Pseudo-code
sensor analog(3) /read the sensor/ If
(sensor lt 75) pmp 0 /set port motor
power/ smp 100 /set starboard motor
power/ else pmp
100 /set port motor power/ smp 0
/set starboard motor power/ motor (port_motor
, pmp) motor (starboard_motor, smp)
8
Follow Left Edge of Line(Get both motors going
with hysteresis)
Definitions White 25 Black 125 port_motor
1 starboard_motor 3
Buggy
9
Control Strategy Plot
10
Pseudo-code
sensor analog(3) /read the sensor/ If
(sensor lt 50) pmp 100 /set port motor
power/ smp 0 /set starboard motor
power/ else if (sensor gt 100)
pmp 0 /set port motor power/ smp
100 /set starboard motor
power/ else pmp 100 smp 100 motor
(port_motor , pmp) motor (starboard_motor, smp)
11
Follow Left Edge of Line(Use proportional
control for smooth transitions)
Definitions White 25 Black 125 port_motor
1 starboard_motor 3
Buggy
12
Control Strategy Plot
13
Pseudo-code
sensor analog(3) /read the sensor/ pmp
100 -1 (sensor 25) smp 1 (sensor
25) motor (port_motor , pmp) motor
(starboard_motor, smp)
14
Follow Left Edge of Line(Get both motors going
with hysteresis) (Use proportional control for
smooth transitions)
Definitions White 25 Black 125 port_motor
1 starboard_motor 3
Buggy
15
Control Strategy Plot
16
Pseudo-code
sensor analog(3) /read the sensor/ If
(sensor lt 75) pmp 100 /set port motor
power/ smp 2 (sensor 25) else
pmp 100 -2 (sensor -75)
smp 100 /set starboard motor
power/ motor (port_motor , pmp) motor
(starboard_motor, smp)
17
Proportional Control(Careful algebra can avoid
floats. Save the divide for last.)
Definitions White 25 Black 100 port_motor
1 starboard_motor 3
Buggy
18
Use Careful Algebra (y mxb) to Avoid Floats
Inside parentheses executes first save the
divide for last
19
Pseudo-code
sensor analog(3) /read the sensor/ pmp
(100 (sensor white)) / (black white)
smp 100 - pmp motor (port_motor ,
pmp) motor (starboard_motor, smp)
Write a Comment
User Comments (0)
About PowerShow.com