Line following l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 19

Line Following PowerPoint PPT Presentation


  • 71 Views
  • Uploaded on
  • Presentation posted in: General

Line Following. Let’s review portions of Line Following Exercise. First we used “bang-bang” control to follow a line’s edge (right side and left side). Then we got both motors going by using hysteresis (transition overlap).

Download Presentation

Line Following

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Line following l.jpg

Line Following

  • Let’s review portions of Line Following Exercise.

  • First we used “bang-bang” control to follow a line’s edge (right side and left side).

  • Then we got both motors going by using hysteresis (transition overlap).

  • Let’s introduce proportional control by using the motor() function. motor (motor # ,percent full power); We might achieve smoother transitions.


Follow left edge of line l.jpg

Follow Left Edge of Line

Definitions

White = 25

Black = 125

port_motor = 1

starboard_motor = 3

Buggy


Control strategy plot l.jpg

Control Strategy Plot


Pseudo code l.jpg

Pseudo-code

sensor = analog(3);/*read the sensor*/

If (sensor < 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);


Follow right edge of line l.jpg

Follow Right Edge of Line

Definitions

White = 25

Black = 125

port_motor = 1

starboard_motor = 3

Buggy


Control strategy plot6 l.jpg

Control Strategy Plot


Pseudo code7 l.jpg

Pseudo-code

sensor = analog(3);/*read the sensor*/

If (sensor < 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);


Follow left edge of line get both motors going with hysteresis l.jpg

Follow Left Edge of Line(Get both motors going with hysteresis)

Definitions

White = 25

Black = 125

port_motor = 1

starboard_motor = 3

Buggy


Control strategy plot9 l.jpg

Control Strategy Plot


Pseudo code10 l.jpg

Pseudo-code

sensor = analog(3);/*read the sensor*/

If (sensor < 50) {

pmp = 100; /*set port motor power*/

smp = 0; } /*set starboard motor power*/

else if (sensor > 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);


Follow left edge of line use proportional control for smooth transitions l.jpg

Follow Left Edge of Line(Use proportional control for smooth transitions)

Definitions

White = 25

Black = 125

port_motor = 1

starboard_motor = 3

Buggy


Control strategy plot12 l.jpg

Control Strategy Plot


Pseudo code13 l.jpg

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);


Slide14 l.jpg

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


Control strategy plot15 l.jpg

Control Strategy Plot


Pseudo code16 l.jpg

Pseudo-code

sensor = analog(3);/*read the sensor*/

If (sensor < 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);


Proportional control careful algebra can avoid floats save the divide for last l.jpg

Proportional Control(Careful algebra can avoid floats. Save the divide for last.)

Definitions

White = 25

Black = 100

port_motor = 1

starboard_motor = 3

Buggy


Slide18 l.jpg

Use Careful Algebra (y = mx+b) to Avoid Floats

Inside parentheses executes first – save the divide for last


Pseudo code19 l.jpg

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);


  • Login