does this mean the servo is controlled from a PC?
Yes, via the arduino. Basically I'm sending a string to the Arduino COM port and when the Arduino reads the string, it rotates the servo.
All this is connected via the USB. I did a quick test with the 180 deg motor I have and it does work.
It's just to get the 360 deg to make 1 revolution now
I don't know how to draw a sketch but it's PC--->arduino-->Servo
That are the details that are important about the code.
The servo is pretty strong 30kg is 10 times stronger than a RC-plane-servo for a 60 inch RC-planes rudder.
To learn about servo-signals and how non-continuos servos work
For a continous-rotation servo you have to switch back and forth between
end-position and middle-position.
the shortest pulse-length is 1000 microseconds
the shortest pulse-length is 2000 microseconds
The 180 degree non-rotation-servo needs signal
turn to 0 degeers 1000 microseconds
turn to 180 derees 2000 microseconds
turn back to 0 1000 microseconds
the continous-rotation-servo needs
servo is stopped = not turning 1500 microseconds (1500 = middle-position)
servo rotating clockwise 1000 microseconds
servo rotating counterclockwise 2000 microseconds
servo stopped 1500 microseconds
Any other motor DC-motor with encoder
stepper-motor is much better suited than this a 360-degrees continous servo
best regards Stefan
OK thanks. I guess I'll have to look for another motor and use the 180 deg in the meantime
You still haven't provided information how your cereal dispenser looks like and what a 360-degree-turn really does and how this compares to a 180 degree-turn.
You can do a test with sweeping the signal from 1400 to 1600 microseconds at which timing the motor is standing still. And then switch between rotate / stop and see if you get satisfying results how much cereals are pouring out.
Maybe your 180-degree-servo and a 2:1 gear which translates the 180 degrees to 360 degrees is possible.
To give advice about this and to estimate what size of motor and how much torque this motor must have can be given if you post pictures how the whole think looks looks like.
best regards Stefan
Sorry. I'm really unsure what you are asking, or why my answers aren't giving you what you need
I attached the motor to the silver dial, and then everything will be mounted to the wall in reverse (the dial will be against the wall). When it spins the cereal will dispense. Whatever dispenses in the 360 degree turn is a serving.. If someone wants 2 servings, it will be another 360 deg turn and so on. I hope that helps
By the way, I removed the entire loop and replaced it with
servo.writeMicroseconds(500);
delay(1800);
servo.writeMicroseconds(1500);
It turns very close to 360 deg now and stops, so testing this way to see if it can work
Well
if you would have posted this picture in your very first posting
and if you would have explained that you need to rotate this cross-handle always clockwise 360 degrees to pour out the cereals
but just a moment! I'm still unsure if pouring out the cereals is done by turning the crosshandle always clockwise and as soon as the clockwise rotation stops pouring out stops
or
if this corsshandle is connected to a mechanism that is opened by turning the crosshandle 90 degrees or 180 degress clockwise
and to close it again the crosshandle has to be rotated into the opposite direction = counterclockwise???
And if you would have posted information about the estimated force / torque that is needed to make this crosshandle turn
- can be easily rotated by a 2 year old child
- can be easily rotated by a grown up with not too much force
- can only be rotated by a grown up person with quite some effor
or if you would have done a measuring connecting a small rope to one of the handles and then using a small bucket with a handle filling in some water and see with how much water = how much weight is needed that the crosshandle starts to rotate the torque can be calulated.
torque = weight in kg * 10 m/sec² * distance from rotating midpoint to rope
This could be used to choose a suitable motor.
best regards Stefan
Hi
To answer, anytime you turn the handle, CW or CCW cereal pours out UNTIL you stop turning the handle
It also cannot be done easily by a child, but with some (little) effort by an adult
I didn't try the bucket experiment as I did not know about that
i'm still curious .. is this a continuous servo, one that can rotate in either direction continuously?
they are used in robotics. some are programmable to be either convention over a specific angle or continuous
From my very limited knowledge and testing, I'd say it's continuous
The command
servo.writeMicroseconds(500);
Will spin it fast
servo.writeMicroseconds(1000);
will spin slow
It spins until you issue a
servo.writeMicroseconds(1500);
So I added a delay
delay(1800);
The delay added will determine how much it rotates (speed vs time)
So rotate at x rpm for y time equals how many turns it makes
Hi @omarm
OK now it is almost clear how your servo works.
Still you can improve the precision of your words
It might be that your knowledge is limited but you can describe very detailed what you observe when using a certain code.
This means posting always the actual and complete sketch that you used
by
- right-clicking the mouse inside Arduino-IDE in your code
- choosing "copy for forum"
- change to browser with forum
- pressing Ctrl-V to insert the complete sketch
and then add a very detailed description of what you observe when running this code
example
If I run this code
your actual code
And then add a very very detailed description of what you observe:
the servo rotates with medium speed for X seconds the cross-handle makes 5 complete rotations and a quarter rotation.
You are on a user-forum you are not on snapchat, WhatsApp, instagram or some other social media for pure entertaining by posting "lol" or "rolf" or
You are working on an informatic project and what is most needed in an informatic project is
information
You are in danger of loosing support if you go on wasting your time and wasting the time of your potential helpers by posting too shoort and with too less information!
When developping a microcontroller-project it is ALWAYS good invested time to give detailed information!
best regards Stefan
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.