by AlexanderHWUK » Fri May 14, 2010 9:42 pm
by AlexanderHWUK
Fri May 14, 2010 9:42 pm
Uhm, a very interesting proposal!
To be honest, I had thought of doing a similar thing (teach a robot how to walk) for my project, but when I realised my time constraints I changed it into something more simplistic (detecting obstacles and remembering patterns).
However, keeping balance would be a very interesting problem to solve with an ANN. When comparing ANNs to anything else, you have to think if you have enough data. ANNs are awesome when you have lots and lots of input data (either because you robot can take thousands of measurings a second, or because it can stay on the surface of Mars for a whole year, with lots of rocks).
So to keep balance, you could design a simple ANN (Same structure as the one I used for this project: Sigmoidal Feed-Forward BackPropagation ANN), as they work well for this type of "data" problems. For example, you already know what is bad or good (big accelerations are bad for example, as you don't want the robot to fall, etc.), so you could use a supervised ANN.
Nevertheless, it would be very interesting as well, designing an unsupervised ANN without telling the robot what it must do to keep the balance. I recommend having it attached to a string or something, as it will fall many times this way!
To learn about coding ANNs, I may recommend that you read over the code and libraries in my project, however I would not recommend you to program them as I did. The libraries I used were
very "low level", in other words, it actually creates the matrices and everything needed to simulate the ANNs, hardcore style. At the end of the project I have learnt there are other more "high-level" approaches to designing ANNs, even though the way I chose was perfect for learning how an ANN actually works.
Both the libraries and the online course I used to learn how to code ANNs in C# was obtained from Heaton Research. The online course is a little
meh , however the libraries are pretty interesting to have a look at if you already know C#. To be fair it was a pretty crazy coincidence that your code to communicate with the Robobuilder was in C#, it saved me a lot of trouble!
Anyways, to answer your well posed question, I do recommend using an ANN, if you are planning on more complicated learning in the future (Such as combining balance with other sensors) or specially if you don't know much about GA. The BIG advantage of the ANNs in this case is if, you do not know as a programmer, what would keep the Robobuilder upright (It is easy enough to say "If you accelerate in +x, try to move to -x", however that may not be as easy to program when moving servos, or when the robot is walking for example).
So my recommendation is do a simple ANN that can run parallel to the code you send to the robot, and create 2 inputs, 2 outputs. The inputs being the positive and negative directions of an accelerometer axis (You can use one input if you want, but you will have to use an activation function like the Hyperbolic activation func.), and the two outputs being a servo in each arm, to expand & contract depending where it is being pushed from. You will see (if you run it in real time, or obtaining data every 0.2 sec or so) how the robot at the beginning does not know what to do, and will do random stuff when you push it. However, shifting the weight of the robot will affect the acceleration, which if you have supervised it correctly, will learn what arm to move depending of where you push him.
Heh, it may sound as tricky, but it only took a year for me to learn

There is just so many possibilities with learning mechanisms, that the only way to find the best one is by experimenting. I find this area very interesting, and if you need any help with research or coding I am happy to help
Alex
P.S. By the way I added you as an owner of my project so you can edit stuff if you want, don't know if it worked
Uhm, a very interesting proposal!
To be honest, I had thought of doing a similar thing (teach a robot how to walk) for my project, but when I realised my time constraints I changed it into something more simplistic (detecting obstacles and remembering patterns).
However, keeping balance would be a very interesting problem to solve with an ANN. When comparing ANNs to anything else, you have to think if you have enough data. ANNs are awesome when you have lots and lots of input data (either because you robot can take thousands of measurings a second, or because it can stay on the surface of Mars for a whole year, with lots of rocks).
So to keep balance, you could design a simple ANN (Same structure as the one I used for this project: Sigmoidal Feed-Forward BackPropagation ANN), as they work well for this type of "data" problems. For example, you already know what is bad or good (big accelerations are bad for example, as you don't want the robot to fall, etc.), so you could use a supervised ANN.
Nevertheless, it would be very interesting as well, designing an unsupervised ANN without telling the robot what it must do to keep the balance. I recommend having it attached to a string or something, as it will fall many times this way!
To learn about coding ANNs, I may recommend that you read over the code and libraries in my project, however I would not recommend you to program them as I did. The libraries I used were
very "low level", in other words, it actually creates the matrices and everything needed to simulate the ANNs, hardcore style. At the end of the project I have learnt there are other more "high-level" approaches to designing ANNs, even though the way I chose was perfect for learning how an ANN actually works.
Both the libraries and the online course I used to learn how to code ANNs in C# was obtained from Heaton Research. The online course is a little
meh , however the libraries are pretty interesting to have a look at if you already know C#. To be fair it was a pretty crazy coincidence that your code to communicate with the Robobuilder was in C#, it saved me a lot of trouble!
Anyways, to answer your well posed question, I do recommend using an ANN, if you are planning on more complicated learning in the future (Such as combining balance with other sensors) or specially if you don't know much about GA. The BIG advantage of the ANNs in this case is if, you do not know as a programmer, what would keep the Robobuilder upright (It is easy enough to say "If you accelerate in +x, try to move to -x", however that may not be as easy to program when moving servos, or when the robot is walking for example).
So my recommendation is do a simple ANN that can run parallel to the code you send to the robot, and create 2 inputs, 2 outputs. The inputs being the positive and negative directions of an accelerometer axis (You can use one input if you want, but you will have to use an activation function like the Hyperbolic activation func.), and the two outputs being a servo in each arm, to expand & contract depending where it is being pushed from. You will see (if you run it in real time, or obtaining data every 0.2 sec or so) how the robot at the beginning does not know what to do, and will do random stuff when you push it. However, shifting the weight of the robot will affect the acceleration, which if you have supervised it correctly, will learn what arm to move depending of where you push him.
Heh, it may sound as tricky, but it only took a year for me to learn

There is just so many possibilities with learning mechanisms, that the only way to find the best one is by experimenting. I find this area very interesting, and if you need any help with research or coding I am happy to help
Alex
P.S. By the way I added you as an owner of my project so you can edit stuff if you want, don't know if it worked