Go Down

Topic: Servos stop working randomly - Robotic Dog Build (Read 818 times) previous topic - next topic

vinceherman

#15
Oct 18, 2018, 05:44 pm Last Edit: Oct 18, 2018, 05:44 pm by vinceherman
:)  I did look at the photo.  Impressive!


I had not seen the hobby servos though so I was confused.  With that cleared up, lets talk about other details of your project.

You have 8 of the actuators?  So you have 8 pots to read, and then adjust the motors until the pot readings are where you want them?

AaronSilas

Thanks man
Oh ok they are hidden in the black boxes at the top of the legs

You have 8 of the actuators?  So you have 8 pots to read, and then adjust the motors until the pot readings are where you want them?
Yes that is true
And my approach is indeed problematic it sometimes turns in the other direction its like the value is somehow substracted and not added to the target value.
Like I said im not a ver ggod programmer by any means so Id be very thankful for any tips how I could make that code more reliable.

Robin2

Like I said im not a ver ggod programmer by any means so Id be very thankful for any tips how I could make that code more reliable.
See Reply #8

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

AaronSilas


Robin2

I meant specifically the actuator stuff.
I do understand that you would like to avoid a complete re-write. However my sense of things is that without a re-write it is difficult or impossible to identify the code that specifically relates to the actuators. At the moment the code for inputs and outputs is all mixed together.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

AaronSilas

#20
Oct 19, 2018, 11:06 am Last Edit: Oct 19, 2018, 12:35 pm by AaronSilas
But the only code that drives the actuators is in the voids kneevl - hiphr.
So basically what would be great is an idea how to make that code more reliable.

Robin2

But the only code that drives the actuators is in the voids kneevl - hiphr.
So basically what would be great is an idea how to make that code more reliable.
Referring back to the program attached to your Original Post what I have quoted here is not actually true.

Take, for example your function kneevl(). It gets an analog reading and it calls the function kneevlin() or kneevlout().

As far as I can see it is the latter 2 functions that drive the actuators and it is hard to see how you could make a digitalWrite() more reliable.

But the bigger problem IMHO is that this reading of a potentiometer and moving of an actuator is not taking place in isolation from the rest of your program and it is with that in mind that I have suggested a different style of program in which the collection of data is separated from actions based on that data.


Quite separately it occurs to me that the simple ON/OFF control of movement that you seem to apply may be too coarse and give rise to overshoots and undershoots. Are you aware of the concept of PID control? if not, do some Googling. A regular servo uses PID internally to move the servo arm smoothly to the desired position.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

AaronSilas

The in and out functions just control the Motordriver.

But thanks for the tips ill look into that.

Robin2

The in and out functions just control the Motordriver.
I am aware of that.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

AaronSilas

Ok
Ive looked into the whole PID thing and it seems to kinda work the problem is that my motor moves so fast that I would need to include some kind of tolerance into the target value any ideas?

Robin2

Ok
Ive looked into the whole PID thing and it seems to kinda work the problem is that my motor moves so fast that I would need to include some kind of tolerance into the target value any ideas?
You seem to have started a new Thread on this which is going to make it difficult to follow. Maybe ask the Moderator to merge the Threads or to lock one one of them so we can focus our limited intelligence in one place ?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

AaronSilas

#26
Oct 21, 2018, 08:53 am Last Edit: Oct 21, 2018, 08:57 am by AaronSilas
Ok sounds good ill lock this thread
This might sound silly but where can I actually lock a thrad?

Robin2

Ok sounds good ill lock this thread
This might sound silly but where can I actually lock a thrad?

Click Report to Moderator and ask nicely :)

...R
Two or three hours spent thinking and reading documentation solves most programming problems.


Go Up