72.5 full rotation of servomotor

Hi everyone

I need to program my servomotor to rotate 72.5 full rotation with step angle 73 degree, and when that is done the motor should stop. can you help me with the code please?

thank you in advance for any help

Have you got a 26100° servo?

Jomana_A:
I have this one

Jx pdi-6221mg 20kg large torque digital standard servo 360 degree cw Sale - Banggood.com sold out-arrival notice-arrival notice

Probably time to rethink your solution.

What confusing specs. Clockwise only 360 servo, then in red a note on pulse spec for reverse rotation BUT is the +360 a different model?

Jomana_A:
rotate 72.5 full rotation with step angle 73 degree

Servo limitations aside, that maths doesn't work. You want to do 26100, but once you've done 357 steps of 73 (26,061) you still have 39 degrees to go.

elvon_blunden:
Servo limitations aside, that maths doesn't work. You want to do 26100, but once you've done 357 steps of 73 (26,061) you still have 39 degrees to go.

oh yes, but it does not matter if it is exactly or not. I need the idea of the code

Since that is not really a servo (because the positional feedback element is removed) you will need to have some sort of position feedback to be able to turn the "servo" to any position or number of turns with any kind of accuracy. You need to sort out the hardware before any code.

What you have is a geared motor that is speed and direction controlled by a servo signal, not a servo.

[pedant_mode]
A ‘servo motor’ runs infinitely... is not restricted in its angular displacement...
A ‘servo’ is a closed loop control system.
There is a servo motor as a component inside virtually every mechanical displacement servo. (Like an RC servo, or ‘linear positioner’ servo.)
There are other non-mechanical servos that implement closed-loop control in other mediums with other driven elements- e.g water, hydraulics, pneumatics etc.
[/pedant_mode]

  • or in Australian colloquial expression... a ‘service station’ (gas station)

Can you help me with the code please?

I need the idea of the code

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

There you go, just fill in the gaps.

I suspect that's probably not what you were hoping for.

If you want someone to write the code for you please post in gigs and collaborations and expect to pay for someone to do it for you.

If you want help writing the code yourself then please work through the various examples on this site and elsewhere, make an attempt at writing your own code then come here for help, taking care to follow the instruction at the top of every forum.

The 3rd option, that someone writes the code for you for free, while logically possible is practically unlikely, although you never know your luck.

Check here