Hi all
I am having a hard time trying to understand why my basic servo motor isn't working as it should.
I tried the servo example and it works fine. However, as a next step, I wanted to add a serial port where, once it detects input from the serial port, it would activate the motor once and then stop. Problem is when I enter anything from the Serial Monitor window, the motor just constantly spins.
I want to believe it's something basic I'm missing. Any help will be appreciate
This is my code. My thinking is once there is input (any input for now) just spin the motor and empty the buffer.
Thanks
OK So it seems like the problem is with the servo part of it.
I was able to get a different servo motor and it works with that one
The difference between both is one goes to 180 deg (the one that works) and the other is 360 deg.
The site says this about the 360 deg
"For the 360° servo ,1500 mhz reach the center,500Mhz is Clockwise,2500mhz is Counterclockwise."
"The high time is 1.0ms-2.0ms,when 2.0ms it is counterclockwise. When 1.5ms it is clockwise. When 1.5ms it is Stopped."
Maybe the issue is I have to change some settings on the servo side?
That referred page does not say about its type number. If you have purchased the Servo, then provide the type number or a link to its manufacturer for Technical Specs.
I am afraid if this Motor is compatible with Servo.h Library!
Thank you for providing the specs according to which the motor is similar to the traditional one of type SG-90. It swings from 00 to 1800 and not from 00 to 3600. The motor is fully compatible with Servo.h Library.
You may exercise the following Tutorial to operate the Servo using Android Phone and Bluetooth in order to give you an idea of how to operate Servo using UART /SUART Port. Servo is connected with UNO's 5V just for test purposes; its supply should be from separate 5V source.
Send FRW Command from Phone, the Servo will turn in the forward direction by 100 and will stop at 1800 position. You can send the BKW command to go back to original zero position by 100 step.
By default, the Servo will swing across 0 deg to 180 deg. (I guess) If the internal limiter is removed/unlocked, the Servo will make the whole 360 deg circle.
Thank you so much for the help.
I did connect to the Arduino just for testing and using a PC with Arduino IDE and serial output to test. I will use a separate power supply in the final install.
My final system will be a PC based one, where the PC sends a signal via the USB cable to the Arduino ... so was thinking of just using Serial.read()
All I'll be sending on the serial is a number between 1 and 9. The number determines the amount of full revolutions (so 1 is 360 deg, 2 will be 360 deg twice etc.. via a loop)
I tried to adjust your code to use the break points if 0 or 180 but it doesn't seem to work.
The Amazon website has this, so not sure if this can give any hints on where I'm going wrong
in most cases Amazon does not provide detailed technical specifcations of the products.
And in a lot of cases amazon has not the lowest price for electronics.
Anyway it seems to be a servo that can rotate contious for a inifinity number of full rotations.
A Servosignal with pulse-length 1500 microseconds (not 1500 Mhz like the amazon text says) should make the servo stop to not rotate clockwise nor rotate counterclockwise
If this is true you have the continious rotating servo.
Is a continious rotatting servo that thing that you need. Shall the servo-Axle rotate clockwise, clockwise, clockwise more than 360 degrees?
and at some other time
Shall the servo-Axle rotate counterclockwise, clounterclockwise, counterclockwise more than 360 degress?
If yes this is a suitable servo.
If you want a servo-Arm move to the left less than 360 degrees
move to the right less than 360 degeress and then the servo-horn should hold this position.
This 360-degree-servo is very bad suited.
For the operation of the continious-rotating servo:
standing still is given for a pulse-length of 1500 microseconds.
Through deviations in manufacturing it might be that the servop stands still at 1480 microseconds or 1530 microseconds
Please write about your project. Give an overvuew about your project.
Hi. Thanks for the info
My project involves rotating a shaft 360 degrees one way (doesn't matter clockwise or anti clockwise)
It can rotate once, twice, three times... etc up to maybe 6 times. For now I just want it to rotate a full 360 deg then stop. I can put that in a loop and have it rotate any amount of times after, but basically it has to rotate 360 deg once, then stop. The codes I try keep making it rotate without stopping.
Hope this helps
Thanks again
If it has to be precise 360,0 degrees not 366 degrees nor 355 degress nor 725 degrees etc.
Then this kind of servo is very hard to use because you have to catch the exact time to change the servo-pulse-length from rotating pulse-length to stop-pulse-length
The reason is this servo has no position-feedback
You still haven't described your overall application and the final purpos of rotating 360 degrees. Rotating 360 is not a self-purpose. there is something behind it.
As soon as you are willing to describe the final purpose
really good suggestions can be made.
If you prefer to play a ping-pong-game of riddling from detail to detail this has just the effect that it takes longer to finish your project.
Hi. I thought I explained what I needed, sorry.
I'm hooking this up to a cereal dispenser. The dispenser rotates to give the cereal. Usually 1 rotation is 360 degrees. If it rotates 366 or 355 it's OK. I'm controlling the dispenser from a PC. I did not decide on how many rotations as yet but I know for now I want it to just rotate more or less 360 deg then stop.
Hope I am clearer now