Hi Glena!
After a long break from programming I built a small servo controller with your code using the tiny2313 and an xbee module. I sending commands from my pc using a delphi program. I experimenting with a rc helicopter and when i try to control the pitch, (120 deg CCPM) I have to move all the 3 servos controlling the swashplate. For this my delphi program send out 3 commands to the 2313 like this:
[code:1:b96eaf279f]
delphi sourcecode:
koll_1_p:='$01'+inttostr(koll_1)+#13;
koll_2_p:='$02'+inttostr(koll_2)+#13;
koll_3_p:='$03'+inttostr(koll_3)+#13;
if dm1.Com1.Open=true then begin
dm1.Com1.Output:=koll_1_p;
dm1.Com1.Output:=koll_2_p;
dm1.Com1.Output:=koll_3_p;[/code:1:b96eaf279f]
When i do this the servo movement is kinda laggy... If i control only one servo the movement is smooth. I communicating at 19200 baud. What do you think what causing the lag? There is a terminal in my delphi test prog. and there i see some !bad_value responses from the SC. The servo position setting occurs when i move the trackbar in my program. Maybe the data rate is to high? (the trackbar change event triggers quick) Or it is irrelevant because the baudrate is defining the flow?
Thanks in advance!
Zsolti
↧