c# winform to control severals servos

hi,
this my robot :
P1000711.JPG
and this is a copy of the form wich can control each motor of the left arm:
1.JPG
the picaxe program and the c# one are jointed in the folowing message

The problem :
when i start my form
i check the check box leaded to the hand and when i move the track bar it's working perfectly
after i check the check box leaded to the elbow and when i move the track bar it's working perfectly
same thing for the two shoulders
but once i have done that, if i try to control, one more time, the hand or the shoulder or the elbow all of the servos motors are moving together. The only way to make the programm work correctly it's to reload the basic programm on the picaxe
i wondering why
 

Rick100

Senior Member
From a quick look at your code, I suspect the Picaxe and PC are getting out of sync. Try using a qualifier like 255 to keep them in sync. You also might have a problem with the PC sending do much data. I would put a textbox in the PC program and add the sent data to it, in text form, whenever you send something to the serial port. That will give an indication of how much data your sending. Which Picaxe are you using?

Good luck,
Rick
 

hippy

Ex-Staff (retired)
There was nothing I could immediately see in the PICAXE or C# program which could have all servos changing at the same time; that would suggest the byte stream sent was, 0,N, 1,N, 2,N, 3,N ( in some order ) where N were the same position and would have had to come from the same slider.

The best thing to do would be to check what is actually being sent out on the serial using another PC or another serial port on the same computer.
 
thanks for your answers
rick : i have added a qualifier but it's not working better, however it was an excellent idea to synchronise the signals
thanks to your answers I'm thinking that this is much an mechanical problem than an electric one
I'm thinking that the torke of the servo is not enough strong to maintain the right position and create some oscillations
i 'll make some test tonight and will tell you tomorow
 
hello,
the two servo shoulders can't maintaiin their position because of a lack of torque
i have found a solution which consist in fixing a rest value to the shoulders servo during the use of the hand and the elbow
main:
serrxd (6), b0,b1

select case b0

case 0

servo B.3,b1
pause 20
servo B.2,250
pause 10

case 1
servo B.2,b1
pause 30
servo B.3,55
pause 10

case 2
servo B.1,b1
pause 2
servo B.2,250
pause 10
servo B.3,55
pause 10

case 3
servo B.0,b1
pause 2
servo B.2,250
pause 10
servo B.3,55
pause 10

endselect


goto main
 
Top