Robot and neural networks

AI Thread Summary
The discussion centers on using a neural network to control a 4-DOF SCARA robot by training it with direct kinematics data to predict servo motor angles based on desired x, y, z coordinates. While the initial premise is that the network can learn to output the necessary angles for a given position, concerns arise regarding the network's ability to handle multiple solutions and optimize movements for efficiency and stability. The conversation highlights the importance of additional control mechanisms, such as PID controllers, to manage velocity and stress on the robot's joints. Participants emphasize that while the approach may work in theory, practical implementation requires addressing potential instabilities and ensuring the network can handle the complexities of robotic motion. Overall, the viability of the proposed neural network solution remains uncertain without further exploration of these challenges.
zoltrix
Messages
85
Reaction score
7
hello

Take a 4 dof scara robot
Calculate the x-y-z coordinates of the robot head , given the rotation angles of the 4 servo motors
You can use the direct kinematics method
Repeat this exercise a suitable number of times
Train a neural net works of 3 neuron inputs (x,y,z) and 4 neurons outputs (the servo motors rotations) using the previously calculated sets of values
Do you think it can work ?
 
Engineering news on Phys.org
Work for what? And there is a lot more to optimizing robot arm motion than just "moving from one point to another". Can you say what some of those optimizations might be?
 
The network needs a goal but all you have is positional information. What would the network's goal be?
 
moving from one point to another
 
I mean the nn should return the rotation angles of the 4 servo motors in order to reach the wished position (x,y,z) for the robot head , always starting from the home position of the robot
this to avoid the much more complicated inverse kinematics
 
What you are trying to describe would typically be accomplished using Reinforcement Learning or Deep Reinforcement Learning using methods like Actor-Critic or others depending on the type of State information that the network receives and the well defined goals ("the wished position" is not well defined).

The x, y, z and servo positions that you've described would be part of the State information that the Agent (your robot) receives along with other information that was received from the Environment via the Interpreter (i.e. position of objects in the Environment). Along with the State information, the Agent receives a Reward which would be something like whether or not the Agent reached the well defined goal. The Agent takes this information and then performs an Action like actuate servo 1 left, servo 2 down, etc. The Agent's action causes a change in the Environment and the cycle repeats. As the Agent receives new information, it stores a history of how its Actions impact its Rewards and uses that history, the current State and current Reward to determine what its next move should be.

What the Agent learns is what Action(s) it should perform given the inputs from the State and Reward - it would not 'learn' positional information because those would be part of the State. This is a very high-level overview and would require the study of topics in Linear Algebra, Markov Decision Processes, and others if you wanted to actually implement something.

1741679899140.png
 
Last edited:
Probably my targets are not that ambition
Given the 4 angles of the servo motors the xyz coordinates of the head or, better, the xyz coords of a selected point of the head, are perfectly defined, assuming of course that the robot is made of rigid bodies only
There is only one final state of the robot , given the rotations of its motors and the initial state.
 
Last edited:
zoltrix said:
Probably my targets are not that ambition
Given the 4 angles of the servo motors the xyz coordinates of the head or, better, the xyz coords of a selected point of the head, are perfectly defined, assuming of course that the robot is made of rigid bodies only
zoltrix said:
Do you think it can work ?
Then no.
 
Do you mind to support your answer with an explanation ?
what's wrong in my last post ?
 
  • #10
I already explained everything in detail for how a network would have to be designed in order to function. The problem with your last post is that you're just repeating your original question and it isn't describing a viable network.
 
  • Like
Likes russ_watters and berkeman
  • #11
since you quoted my last post followed by
"then no"
I simply asked you , ist wrong that :

"Given the 4 angles of the servo motors the xyz coordinates of the head or, better, the xyz coords of a selected point of the head, are perfectly defined, assuming of course that the robot is made of rigid bodies only"

I think that those kind of top/down answers should be avoided
 
  • #12
Sorry, I can't help you any further.
 
  • Like
Likes russ_watters
  • #13
ok I dont insist, you dont know the answer
anyway I think that my claim is right
if you know the servo motors angles, the geometry of the robot and its initial position
it should be enough to build up the rotation matrices and multiply them
the result of the multiplication is a vector [x,y,z,1]

if I am wrong please explain why

this is not the point,in my opinion, the point is :
Does a neural network, trained with sets of values previously calculated, deliver reliable and accurate results ?
 
  • #14
zoltrix said:
ok I dont insist, you dont know the answer
Wrong. @Borg is a subject matter expert in this field. You should be able to tell that by his reply #6.

What research have you done so far on this question/project of yours? Please post links to that reading and ask specific questions about that reading. Thank you.
 
  • Like
Likes russ_watters
  • #15
I think Borg did not read my post
I guess he was talking about a humanoid moving robot
have a look at the pic, there is a maze, he mentioned agents and all that stuff
I was talking about a much simpler fixed intallation, a Scara robot
That's why I replied:
"my targets are not that ambitious

What research ?
direct kinematics is the first thing you must learn in robotics

the use of a trained neural networks in order to make a point of the head reaching a wished xyz position in space , is my personal idea
that's why I wonder whether it can work
 
  • #16
Yes, I read your post. The picture comes from the article on Reinforcement Learning. The 'maze' is just meant to represent a generic environment. The Agent is a generic term for whatever it is that you're attempting to train. The same design principals would apply to a robot arm as a moving robot. Reading books on robotics isn't going to help you to understand how to build neural networks.
 
  • Like
Likes russ_watters and berkeman
  • #17
I think the OP wants to enter inputs and outputs into a neural network and get the matrices he needs to define the system, something like how ChatGPT can write programming code based on a description of what is expected. The OP probably doesn't even care about the matrices, just that the AI controls the robot by itself, like AI could just run the code it wrote based on a task that was asked.

Maybe I'm wrong, though.
 
  • #18
ok , I got it
The first part of my idea is correct,fine
with direct kinematics you can build up a number of training sets :

a11,a21,a31,a41 -> x1,y1,z1
a12,a22,a32,a42 -> x2,y2,z2
......................................................
a1n,a2n,a3n,a4n -> xn,yn,zn

whereas a1n,a2n,a3n,a4n are the rotation angles of the 4 servo motors and xn,yn,zn, the relevant positioning of the head
Why a neural networks, trained with the above sets should not work ?
The input neurons are the wished x,y,z position of the head and the output neurons the four a1,a2,a3,a4 angles of the servo motors

I am not saying it works , I mean that my question is still un-answered
 
  • #19
How do you avoid instabilities and oscillations?

How do you train for optimized movements (fastest and most energy efficient and acceptable stress on the joints and members)?
 
  • #20
If all you want to do is have a network determine the values of one based on the values of the other, then yes, it can theoretically be done with a simpler network.

You originally stated that you wanted to calculate the x,y,z position but now you want to know where to set the servos based on a given x,y,z position that you want to get to. If the latest one is what you really want, there could be multiple solutions for the servo angles to achieve the same postion. This many-to-one relationship means the network must learn which solution to output—or you must constrain the system to yield a unique solution.
 
  • #21
Please ,might you stick to the point
may I have an answer to my simple and clear question ?

I did not ask how to build a a state of art robot

anyway, how to avoid instabilities and oscillations
how optimized movement , energy efficiency acceptable stress on the joints etc

Given a wished position of the head ,the rotation of servo motors angles are also given
There are no alternative unless you change the geometry of robots

to cope with a/m problems you need controllers
Servo motors have already a built in controller for position
you must add a PID controller for velocity
as well as to carry out a FEM analysis for stresses
All this stuff are very important but nothing to do with my question
 
  • #22
@Borg

Yes I want to know how to set the servos based on a given x,y,z postition
I key_in the 4 outputs returned by the network and the head move to the wished position

I accept that there is not an unique solution
The solution proposed by the nn might not be the optimal one
or it might be even not acceptable
For example in case an arm collide with the surrounding objects
I just asked whether my idea somehow works
 
  • #23
hello

my system is quite simple but does it really work , regardless of its weak points ?
suppose you want to move the head from the home position to a point P1 and then to a point P2
the sequence :
home-P1-home- P2
it should work since the networks returns the parameters to move the head from home position to a generic position in space and viceversa
however you expect to move the head directly from P1 to P2
can you key_in the parameters : P2-P1 ?
P1 and P2 being vectors, whose elements are the the outputs of the net
neural networks are not linear
 
Last edited:
Back
Top