Library | Building | Programming | Quick Guides Home | Quick Guides to Building | Quick Guides to Programming | LVLM | WeDo
Motors

DocumentsDate added

Order by : Name | Date | Hits | [ Ascendant ]
file icon PI Position ControlTooltip 10/26/2009 Hits: 591
This example illustrates how to write a proportional, integral controller for the NXT. On the front panel, the user inputs the desired position (in degrees) of the motor. The user can also adjust the control gains, Kp and Ki which affects the input power of the motor. Kp is a proportional gain, it scales the difference between the motor's current position and the desired position--this difference is known as the error. Ki is an integral gain, it scales the total accumulated error during the program. Play around with the gains to see what works the best.


file icon Straight Line SteeringTooltip 10/26/2009 Hits: 528

You may notice that a NXT car with a steering value of 0 does not drive in a straight line. This problem can be resolved by implementing proportional control, where the motor steering input is a function of the difference between the motor rotation readings.


file icon Write a ProgramTooltip 10/26/2009 Hits: 515
This program turns the motor on until the touch sensor is pressed, then displays "Hello, World!" on the NXT screen.


file icon Drive DistanceTooltip 11/03/2009 Hits: 512

In this program, motors A and B rotate 720 degrees (two revolutions), the NXT brick plays the note C for 1 second, and then motor A rotates 90 degrees.

 


file icon Table CarTooltip 10/26/2009 Hits: 497

This example enables a NXT car with a light sensor to detect when it has reached the edge of a table, back up, and turn in a random direction, this continues until the program is stopped.

file icon Multiple Inputs and OutputsTooltip 10/26/2009 Hits: 495
This program uses multiple motors and multiple touch sensors. When it begins motor A runs forward until touch sensor 1 is pressed, motor B then begins to run until touch sensor 2 is pressed.


file icon Front Panel Steering ControlTooltip 10/26/2009 Hits: 483
This program turns the car for a set amount of time. The turning time, steering, power, and ports are all controls rather than constants, which means that they can be adjusted on the front panel of the program.


file icon While Loop Motor ControlTooltip 10/26/2009 Hits: 470
This program runs the motor until the touch sensor is pressed and stops the while loop causing the motor to brake.


file icon Straight Line PControlTooltip 10/26/2009 Hits: 470
You may notice that a NXT car with independently controlled wheels might not be able drive in a straight line even though the power setting on the motors are the same. Slight differences in the motors and wheels cause them to rotate at different rates. This problem can be resolved by implementing proportional control, where the power setting of the motors is a function of the difference between the motor rotation readings.

                           motor A power = constant + gain*(encoder A - encoder C)
                           motor C power = constant - gain*(encoder A - encoder C)


file icon Basic Steering ControlTooltip 10/26/2009 Hits: 464
This program makes the car turn until the touch sensor is pressed. To control the degree and direction of steering, input a number between 100 and -100.


«StartPrev12NextEnd»
Page 1 of 2
Home | About Us | Contact Us
© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.