Controlling step motors is a little more difficult than that of DC motors. Moreover, the Handy Board can handle at most 2 step motors while it can handle 4 DC motors. Nevertheless, using the step motors for our project was better solution than using DC motors, because step motors gave us finer control than DC motors. I can move the step motor 1 step at a time and each step of the motor is 7.5 degrees of rotation. So if I command it to move 48 steps, then it will rotate 360 degrees.
The following set of commands moves the motor one step forward (clockwise).
float x = 0.001;
fd(0);
fd(1);
sleep(x);
bk(0);
fd(1);
sleep(x);
bk(0);
bk(1);
sleep(x);
fd(0);
bk(1);
sleep(x);
If you want to move it backward (counter-clockwise), you just need to reverse the above sequence.
I get this information from this web site:
http://www.cctc.demon.co.uk/stepper.htm
Tuesday, August 7, 2007
How to control DC motors
The first thing I needed to do was to find a DC motor that was compatible with the Handy Board. The Handy Board is designed to work with 9V DC motors. The DC motors that I found were for 3V. The default commands to move DC motors are fd() and bk(); these commands move motors clockwise or counter-clockwise. However, applying 9V to a 3V DC motor was not a good thing, so I used the following set of commands to control the motor connected to the port 0.
motor(0, 40); // use 40% of power to move the motor clockwise
sleep(0.2); // keep it on for 0.2 seconds
off(0); // then shut it off
The above set of commands did work for our system, but we needed a stopper to stop the door from opening too much.
motor(0, 40); // use 40% of power to move the motor clockwise
sleep(0.2); // keep it on for 0.2 seconds
off(0); // then shut it off
The above set of commands did work for our system, but we needed a stopper to stop the door from opening too much.
Let's get started with the Handy Board
In order to use the Handy Board, we needed a special software called the Interactive C. We can get a free copy from http://www.botball.org/educational-resources/ic.php.
Your computer must have a serial port to connect to the Handy Board unless your Handy Board comes with a USB port. Unfortunately, most laptops don't have serial ports nowadays. To get around this problem, I purchased a USB to serial adapter. The one I used was made by CP TECHNOLOGIES and its model was CP-US-03. I got it from www.newegg.com and it cost me about $14 including the shipping cost. It worked fine with my Toshiba Portege R100 laptop with WindowsXP. The only thing that I needed to do was to change the port number to COMM1. When I installed the driver software, it automatically picked COMM5. The Interactive C uses either COMM1 or COMM3 to communicate with the Handy Board. So the serial adapter didn't work with the Interactive C by default.
Your computer must have a serial port to connect to the Handy Board unless your Handy Board comes with a USB port. Unfortunately, most laptops don't have serial ports nowadays. To get around this problem, I purchased a USB to serial adapter. The one I used was made by CP TECHNOLOGIES and its model was CP-US-03. I got it from www.newegg.com and it cost me about $14 including the shipping cost. It worked fine with my Toshiba Portege R100 laptop with WindowsXP. The only thing that I needed to do was to change the port number to COMM1. When I installed the driver software, it automatically picked COMM5. The Interactive C uses either COMM1 or COMM3 to communicate with the Handy Board. So the serial adapter didn't work with the Interactive C by default.
What technology should we use?
We came up with two potential technologies for this project. One them was the Handy Board, and the other one was Lego's Mindstorms.
We decided on the Handy Board because it was cheaper and easier to customize. The Mindstorms was relatively easy to use and somewhat customizable. However, our school didn't have software for the Mindstorms and it cost $70. We didn't want to spend $70 to see if the Mindstorms work for our project.
We decided on the Handy Board because it was cheaper and easier to customize. The Mindstorms was relatively easy to use and somewhat customizable. However, our school didn't have software for the Mindstorms and it cost $70. We didn't want to spend $70 to see if the Mindstorms work for our project.
Tuesday, July 24, 2007
Assignment #3
Motivation for our design:
We wanted to create a tangible system to help kids understand the concept of multiplication. The system had to be intuitive, so the kids don't need to read a manual to use it.
Alternative designs our team has considered:
1) A system that uses dices to represent multiplication. The dices can be combined on a surface. The rows represent multiplier and the columns represent multiplicand. However, this design does not require any computation (computer) at all.
2) A system that uses a grid, marbles, and LEDs to represent multiplication. The first column controls multiplier and the first row controls multiplicand. Once marbles are places in the first row and column, some LEDs light up to represent the result of multiplication. This design is intuitive to use, but the result of multiplication represented by marbles and LEDs may make some confusions.
Rational for developing our current design:
The system looks similar to a bubble gum machine, so children won't be intimidated by the system. The system has only a slider and a button. Thus, it is easy to use, and the outcome of the system is intuitive. Children can see, hear, feel the weight, and taste the concept of multiplication.
We wanted to create a tangible system to help kids understand the concept of multiplication. The system had to be intuitive, so the kids don't need to read a manual to use it.
Alternative designs our team has considered:
1) A system that uses dices to represent multiplication. The dices can be combined on a surface. The rows represent multiplier and the columns represent multiplicand. However, this design does not require any computation (computer) at all.
2) A system that uses a grid, marbles, and LEDs to represent multiplication. The first column controls multiplier and the first row controls multiplicand. Once marbles are places in the first row and column, some LEDs light up to represent the result of multiplication. This design is intuitive to use, but the result of multiplication represented by marbles and LEDs may make some confusions.
Rational for developing our current design:
The system looks similar to a bubble gum machine, so children won't be intimidated by the system. The system has only a slider and a button. Thus, it is easy to use, and the outcome of the system is intuitive. Children can see, hear, feel the weight, and taste the concept of multiplication.
Subscribe to:
Posts (Atom)