Home › Forums › EasyTransfer Library Support Forum › Servo twitch issue
Tagged: arduino, bug, servo, SoftEasyTransfer.h
- This topic has 3 replies, 2 voices, and was last updated 13 years ago by Anonymous.
-
AuthorPosts
-
September 24, 2013 at 8:43 am #2942AnonymousInactive
Hi!
I’m happy to use your library. It works great for my last 48RGB LED progect.
But last two days I try to use your library together with
2 APC220 modules (transparent serial modems) connected to arduino RX/TX and servo-motor.
Servo controlled with default Servo.h library.From TX side we have:
Arduino Mega2560 + potentiometer;From RX side:
Arduino Duemilanove (AtMega328PU) + 1 green LED + Turnigy 9g servo motor connected to PWM9.The problem is that when I connect a LED it works fine and changes brightness accordingly to send data.
But when I connect Servo it starts twitch (work around set position for 10 degree left right with ~16Hz frequency).I tested all possible methods. Started program on different arduino controllers (mega1280, mega2560, duemilanove),
started serial on default port and used newsoftserial library to start it on non-default ports. changed loop delay on RX and
TX side, changed delay to millis() timer. But it didn’t solve my problem.Now my APC220 serial and radio speed set to 19200 b/s. It’s pretty fast and works like in realtime (when I drive LED).
I tested code with other different combinations like before:
serial speed: 57600; radio speed: 9600 (from many quadcopter community recommendations)
serial speed: 9600; radio speed: 9600
But it still twitches.
I can make servo work correct (and don’t walk around it’s position) only if I disable easytransfer in my sketch at all.Explain me please can this problem be caused by Serial interrupts or smth like this because I worked for 20 hours and still not able to make servo react smoothly.
here’s my code example:
TX:
https://docs.google.com/file/d/0BxK8soZDxXtneFlZMTVIUHBrSjA/edit?usp=sharing
RX:
https://docs.google.com/file/d/0BxK8soZDxXtnd1ZLcllwcC1WaFk/edit?usp=sharingWith best regards
Vitaliy
Odessa, UkraineSeptember 24, 2013 at 4:03 pm #2944AnonymousInactiveThe problem have place for <SoftEasyTransfer.h> only.
Please fix the library.P.S. if I have enough time I can help you on weekend.
September 28, 2013 at 2:19 pm #2947BillMemberThe issue is not the library, it’s you trying to use a software serial port at the same times as creating a servo signal. Switch to using the hardware serial port on the Duemilanove (pins 0 and 1) and the problem should go away.
Running a servo requires precise timing. Using a software serial port interrupts timing on the Arduino. You can’t use both.
October 7, 2013 at 4:24 am #2953AnonymousInactiveMaybe you are right. btw. thanks for good library.
-
AuthorPosts
- You must be logged in to reply to this topic.






