Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Ok. new question.

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
6 postsPage 1 of 1
6 postsPage 1 of 1

Ok. new question.

Post by kevdemed » Sat Apr 21, 2007 11:15 am

Post by kevdemed
Sat Apr 21, 2007 11:15 am

So far Im having fun with my robonova, but now I want to program it.
So I look at the robobasic manual.
WOW!

How do I teach myself all of this mathimatical stuff?

F=A*B/C*D+E?

What the hell does that mean?

Did all of you learn this stuff just by studying the guide?

If so, please tell me how.

Thanks!
So far Im having fun with my robonova, but now I want to program it.
So I look at the robobasic manual.
WOW!

How do I teach myself all of this mathimatical stuff?

F=A*B/C*D+E?

What the hell does that mean?

Did all of you learn this stuff just by studying the guide?

If so, please tell me how.

Thanks!
kevdemed
Savvy Roboteer
Savvy Roboteer
Posts: 63
Joined: Sat Apr 21, 2007 3:00 am
Location: california

Post by bauermech » Sat Apr 21, 2007 12:25 pm

Post by bauermech
Sat Apr 21, 2007 12:25 pm

How do I teach myself all of this mathematical stuff?
Whoa, lets not get too far ahead of ourselves...
You'll find it is not necessary to jump into using mathematics to create motions. RoboBASIC has a wonderful Catch-n-Play feature you can use to make your robot transition from one pose to the other. I would recommend starting there, and getting the feel for coding
Click Here for a basic rundown of what the code in your "Overall_Template.bas" file looks like and what each chunk means.

F=A*B/C*D+E?
What the hell does that mean?

Each letter may be represented by a value... you can use variables or constants to set/change these values
DIM E AS BYTE
E = 128

remember the laws of math order...
(Do First - Parentheses, Exponents, Multiplication, Division, Addition, Subtraction - Do Last)...for instance, in the above equation:

1. F = is "F" equals the result of... (This is the final answer you're looking for)
2. Take the value of A, multiply it by the value of B
3. Take the value of C, multiply it by the value of D
4. Take both results from steps 2 and 3 - divide the values
5. Take the result from step 4 and add the value of E
6. The resulting value is equal to F

Did all of you learn this stuff just by studying the guide?

Many of us have had previous programming experience in BASIC and/or C++ etc., but al lot of us too have had no previous experience, and were forced to learn by asking questions and studying.

Hope this helps w/ some of your questions... :)
How do I teach myself all of this mathematical stuff?
Whoa, lets not get too far ahead of ourselves...
You'll find it is not necessary to jump into using mathematics to create motions. RoboBASIC has a wonderful Catch-n-Play feature you can use to make your robot transition from one pose to the other. I would recommend starting there, and getting the feel for coding
Click Here for a basic rundown of what the code in your "Overall_Template.bas" file looks like and what each chunk means.

F=A*B/C*D+E?
What the hell does that mean?

Each letter may be represented by a value... you can use variables or constants to set/change these values
DIM E AS BYTE
E = 128

remember the laws of math order...
(Do First - Parentheses, Exponents, Multiplication, Division, Addition, Subtraction - Do Last)...for instance, in the above equation:

1. F = is "F" equals the result of... (This is the final answer you're looking for)
2. Take the value of A, multiply it by the value of B
3. Take the value of C, multiply it by the value of D
4. Take both results from steps 2 and 3 - divide the values
5. Take the result from step 4 and add the value of E
6. The resulting value is equal to F

Did all of you learn this stuff just by studying the guide?

Many of us have had previous programming experience in BASIC and/or C++ etc., but al lot of us too have had no previous experience, and were forced to learn by asking questions and studying.

Hope this helps w/ some of your questions... :)
bauermech
Site Admin
Site Admin
User avatar
Posts: 318
Joined: Sat Feb 04, 2006 1:00 am
Location: Defiance, Ohio, USA

Post by bauermech » Sat Apr 21, 2007 1:04 pm

Post by bauermech
Sat Apr 21, 2007 1:04 pm

...oops

Did all of you learn this stuff just by studying the guide?


Many of us have had previous programming experience in BASIC and/or C++ etc., but al lot of us too have had no previous experience, and were forced to learn by asking questions and studying.

Hope this helps w/ some of your questions... :)
...oops

Did all of you learn this stuff just by studying the guide?


Many of us have had previous programming experience in BASIC and/or C++ etc., but al lot of us too have had no previous experience, and were forced to learn by asking questions and studying.

Hope this helps w/ some of your questions... :)
bauermech
Site Admin
Site Admin
User avatar
Posts: 318
Joined: Sat Feb 04, 2006 1:00 am
Location: Defiance, Ohio, USA

Post by Humanoido » Sat Apr 21, 2007 5:11 pm

Post by Humanoido
Sat Apr 21, 2007 5:11 pm

The issues with subset languages, i.e. integer (without the decimal point) Basic, RoboBasic, Tiny Basic, is that they do not follow the math flow order that we were taught in school, because there is no precedence in the operator. Math is solved in the order it is written, left to right.

In RoboBasic math, a parenthesis () cannot be used. This is best illustrated by example. If A=1, B=2, C=3 then consider the real flow followed by RoboBasic. A + B * C = 1 + 2 * 3 = 3 * 3 = 9. Therefore, multiplication does not iterate first.

However, this is generally not a deterrent to higher ordered math, as math as high as Calculus has been implemented. Many of such routines were implemented for various integer-only 4 and 8 bit microcontrollers which had limited memory for Basic and programs. These have been popular ever since the 1970s when they were introduced.

Some of the best information can be found at Tracey Allen's web site. While the information was written in regard to the integer Basic Stamp 1 and BS2, it nevertheless applies to RoboBasic and integer Basic as a whole.

http://www.emesystems.com/BS2index.htm
http://www.silab.it/frox/stamp/bs2_math.htm
http://www.piclist.com/techref/microchip/math/index.htm

Also in RoboBasic, worth mentioning, calculations are limited to 2 or 3 calculations per line, to retain accuracy. There is a brief treatise in the RoboBasic English Command Instruction Manual on pages 13 and 14.

humanoido
The issues with subset languages, i.e. integer (without the decimal point) Basic, RoboBasic, Tiny Basic, is that they do not follow the math flow order that we were taught in school, because there is no precedence in the operator. Math is solved in the order it is written, left to right.

In RoboBasic math, a parenthesis () cannot be used. This is best illustrated by example. If A=1, B=2, C=3 then consider the real flow followed by RoboBasic. A + B * C = 1 + 2 * 3 = 3 * 3 = 9. Therefore, multiplication does not iterate first.

However, this is generally not a deterrent to higher ordered math, as math as high as Calculus has been implemented. Many of such routines were implemented for various integer-only 4 and 8 bit microcontrollers which had limited memory for Basic and programs. These have been popular ever since the 1970s when they were introduced.

Some of the best information can be found at Tracey Allen's web site. While the information was written in regard to the integer Basic Stamp 1 and BS2, it nevertheless applies to RoboBasic and integer Basic as a whole.

http://www.emesystems.com/BS2index.htm
http://www.silab.it/frox/stamp/bs2_math.htm
http://www.piclist.com/techref/microchip/math/index.htm

Also in RoboBasic, worth mentioning, calculations are limited to 2 or 3 calculations per line, to retain accuracy. There is a brief treatise in the RoboBasic English Command Instruction Manual on pages 13 and 14.

humanoido
Humanoido
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 574
Joined: Tue Dec 05, 2006 1:00 am
Location: Deep in the Heart of Asia

Post by bauermech » Sat Apr 21, 2007 8:14 pm

Post by bauermech
Sat Apr 21, 2007 8:14 pm

:oops: oops, Humanoido is correct - math is done sequentially in BASIC. Sorry for leading you astray.
:oops: oops, Humanoido is correct - math is done sequentially in BASIC. Sorry for leading you astray.
bauermech
Site Admin
Site Admin
User avatar
Posts: 318
Joined: Sat Feb 04, 2006 1:00 am
Location: Defiance, Ohio, USA

Post by kevdemed » Sun Apr 22, 2007 7:24 am

Post by kevdemed
Sun Apr 22, 2007 7:24 am

Hmmm...
Well I will give it a shot.
Thanks for the help!
Hmmm...
Well I will give it a shot.
Thanks for the help!
kevdemed
Savvy Roboteer
Savvy Roboteer
Posts: 63
Joined: Sat Apr 21, 2007 3:00 am
Location: california


6 postsPage 1 of 1
6 postsPage 1 of 1