Friday, 21 February 2014

Week 4 - Week activities and Lab Day

At the beginning of week 4, we planed to modify the codes for better controlling of the stepper motor. On the website of the mbed, which is mbed.org, we can use the online compiler to write the codes for the mbed and then compile it. If the code is compiling without any errors, we can compile the code to run the mbed processor and then controlling the motor. 
At the start none of the group members had any thoughts on how to write the codes for the stepper motor. Therefore, we used the online compiler library to get some ideas. We found that there is a simple program called stepper_motor_control. This is a very simple codes, it can just run the four steps of the motor without any control of the speed, direction, and the display on the LCD screen.


Figure 1: codes for the example in the online compiler
figure1 displays the code we got from the mbed library. We can only use the part that includes the steps in our codes as the controlling process is far more advanced.
Then, we tried this program to check whether it can work for our project. However, it was the first time for us to use the mbed, we didn't know how to use the compile file. Therefore, we asked to meet with our supervisor to ask for help. Our supervisor told us that we should copy the successful file into the file of the mbed. And then, we pressed the reset on the board to run the new input codes. To make us more familiar to the pot on the board, he gave us an example codes of using two pots from the mbed website. Then, for our codes, we got an idea of how to design the code using two pots for controlling the speeds and the direction of the stepper motor.



Figure 2: The codes for example of how to use the pot on mbed
Figure 2 was the codes from our supervisor for us to get the knowledge of how to use the pots on the mbed.

No comments:

Post a Comment