Close

Motor Control and Rigidity Frustation

A project log for Inexpensive 3D Printed Full Size Humanoid Robot

I'm designing a super cheap humanoid robot platform. It is going to be the same size as an adult person.

dan-dwroboticsDan DWRobotics 07/21/2017 at 18:260 Comments

So I wasn't able to get it stand on one leg reliably enough to do it in a sequence without me holding it up. I don't want to ever rely on harnesses and having people nervously standing behind it.

    There are a number of factors that need to be overcome. The problem is, they are all boring. So I designed the biceps instead.

    Problem 1:

    I keep getting oscillating of the limbs around the set point. This is because I wrote a PI control of the motors on the arduino myself and I'm no engineer/mathematician. I got it to move and couldn't be bothered to continue programming preferring instead to make it do funny moves.

     What I really need is the D (ok stop sniggering, I didn't mean that).

 I have a variable for the distance between where the joint is and where I want it to be, this is in very basic terms the Proportional. Then I have a variable for the amount of time that the distance is far(so the error over time, which accumulates) and that is the Integral part.

  I worked out today how I am going to do the Derivative part but it is difficult to keep the concept in my mind. I need a variable which tracks the rate at which the error increases or decreases.  It needs to know when to expect the error will be zero again so it can lower the power before that happens. So to get the rate at which the error increases or decreases.....(even now I am struggling to visualise how to do this in an ardunio loop) .

    The difference between the set point and the current position is called diff[x] in my loop and it is calculated for all joints. If it is a negative number I convert it to a positive (I reverse the number again when applying the power). So if you were to look at a list of the differences over a number of 10 millisecond cycles it might look like this:

millis()                                  diff[30]

millis()+10                            diff[15]

millis()+10                            diff[7]

millis()+10                            diff[1]

So the above would represent a joint position accelerating to the correct set point. So I need to track the rate of acceleration or deceleration ( not of speed but of rate at which the error changes). Then my code would need to increase or decrease the power depending on rate. I also need the code to know if it is accelerating or decelerating. Well I am going to have a think about this now (maybe a tiny crying session). Then come back and try to solve this. All I know is that it will involve maths which I am rubbish at.

I was going to write about all the problems but that will get boring so I will just summarise the next one:

Problem 2:

  The waist/hips rotators are mounted inside their 'bearings' too losely so the whole frame is unstable, which is not good for standing on one leg. I tried to be too clever with the design and should have stuck to directly mounting on skateboard bearing like I do with everything else. I won't have time now to redesign the whole hips/waist so I am going to print a load of add on pieces that will stabilise these joints enough.

Discussions