Human-Computer Interaction Technology Lab Programs
Balance.prj
- Description:
- Input data comes from measured A/D voltages from an input
sensor connected to the National Instrument Digital AQuisition
Card (NIDAQ). The goal of this task is to "balance" a stick without
dropping it. The input represents your hand upon which the bottom of
the stick is resting. The output represents the position
of the top of the stick which you are trying to keep balanced above
your hand. You can control the sticks length -- a long stick
is easier to balance than a shorter stick.
- Zipped Project:
- balance2.zip (version 7 Oct 1998)
balance.zip (version 5 Oct 1998)
- Viewable Code:
- balance2.c (version 7 Oct 1998)
balance.c (version 5 Oct 1998)
- Code based on:
- scope.prj
- Possible Modification:
-
-
Have the computer control the length of the stick.
If you are good at balancing the stick, the computer
would shorten the stick. If you are dropping the stick too much,
then the computer would lengthen the stick.
-
Use a fuzzy/neural controller to control the input automatically
rather than a human.
- Implementation note:
- The function used to determine the output is:
stickTop += (stickTop - stickBottom) / (stickLength * scaleFactor);
Then, stickTop range is limited so that you can alwasy get under it
with the stickBottom. The scaleFactor depends on how fast you are
updating the stickTop output display and maybe other factors.
In this case it was set to 20, and the stickLength can vary between
0 and 10.
- Screen Capture of User Interface:
-
Craig Stuart Sapp, craig@ccrma.stanford.edu