Friday

A Bit Of Programming, I

      The next few days were spent exploring ways of programming the NXTs and MatLab. There were a number of project we did during this time. The first was getting our motor to move to exactly 90 degrees. I think we might have done this before we made the ramp climber. In any case, here is what we did: We wrote a program in LabView that said go forward, wait for 90 degrees and brake. We also had a program that allowed us to read the rotation from the NXT's screen. We observed that, due to the time it takes for the NXT to realize it has gone 90 degrees and put the stop command into action, it always moved more than 90 degrees. Therefore, we changed our program so it would move back when it overshot.

Our code for moving exactly 90 degrees

      Next, we were to build a program that modelled the NXT motor controller. We used the NXT's data logging feature to collect data. Then, we put this data into Excell and got line that predicted the motor,s motion.

The data from the NXT


Here is our program for the NXT motor controller:

Here is the final graph we arrived at:

No comments:

Post a Comment