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 Write a ProgramTooltip 10/26/2009 Hits: 527
This program turns the motor on until the touch sensor is pressed, then displays "Hello, World!" on the NXT screen.


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


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

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 Straight Line SteeringTooltip 10/26/2009 Hits: 535

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 Straight Line PControlTooltip 10/26/2009 Hits: 476
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 Second HandTooltip 10/26/2009 Hits: 438

This example should approximately represent the second hand of a clock as it goes around.


file icon Run For TimeTooltip 10/26/2009 Hits: 410
This program turns the motor on for five seconds, at 50 percent power, then stops the motor.


file icon Run For DistanceTooltip 10/26/2009 Hits: 433
This program turns the motor on, waits for 360 degrees of rotation and then stops the motor.


file icon PI Position ControlTooltip 10/26/2009 Hits: 597
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 Multiple Inputs and OutputsTooltip 10/26/2009 Hits: 500
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.


«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.