Go Down

Topic: Wireless control system problem (Read 5424 times) previous topic - next topic

njkl44


Is this different to what you said earlier?

Quote
should i just power these servos with the 5v and gnd from the arduino or something else?


Certainly you should have the grounds common. I agree with that. And from the battery I would run a wire to the Arduino's "power in" socket (so it gets voltage regulated). And also direct from the battery to the motor shield.

Sounds OK, subject to seeing a schematic.

I believe it should be something like this?

njkl44

So i fallowed this diagram and it works fine :) one thing with the code is that it is really jumpy and random. The fingers do move when i move mine but there is a weird delay and the servos are pretty much always moving no matter if i flex my hand or not. We are really close!!!

Nick Gammon

Try increasing the baud rate to 115200 on both sides.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

njkl44


Try increasing the baud rate to 115200 on both sides.

hmmm now nothing is happening. It is still receiving though. Do i need to reconfigure the xbees for 115200?

Nick Gammon

I'd forgotten about them. If you can, yes, if you are talking through them. I found with my robot car that a slow communication rate can make the response to controls a bit sluggish.

For example:

Code: [Select]
.123,100,92,42,99/

That's 18 bytes. At 9600 baud (960 characters per second) that would take 18.7 mS to send. Maybe the problem is something else.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

njkl44


I'd forgotten about them. If you can, yes, if you are talking through them. I found with my robot car that a slow communication rate can make the response to controls a bit sluggish.

For example:

Code: [Select]
.123,100,92,42,99/

That's 18 bytes. At 9600 baud (960 characters per second) that would take 18.7 mS to send. Maybe the problem is something else.

Could it be the delay? should i change that?
Code: [Select]
   Serial.print(".");
   Serial.print(servoVal1, DEC);
   Serial.print(",");
   Serial.print(servoVal2, DEC);
   Serial.print(",");
   Serial.print(servoVal3, DEC);
   Serial.print(",");
   Serial.print(servoVal4, DEC);
   Serial.print(",");
   Serial.print(RotationV1, DEC);
   Serial.print("/");
   
   delay(10);

Nick Gammon

You and your delays! Yes get rid of it unless you want a 10 mS sluggishness.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nick Gammon

Also comment-out the debugging prints in the receiving end.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

njkl44


Also comment-out the debugging prints in the receiving end.

That did it! perfect!! im going to see if the client wants the feedback system and ill do the code and post it on here

Thank you so much! I will credit you as much as i can! thank you :)

Go Up