Arduino Uno Stepper turns max 90°

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
nicmaes
Posts: 7
Joined: Mon Mar 24, 2014 9:58 pm
Has thanked: 2 times
Been thanked: 1 time

Arduino Uno Stepper turns max 90°

Post by nicmaes »

I've programming Arduino Uno with flowcode V7. I try to control a micro servo, SG90. I'm programming the component macro. It works, but not 100%
I send 'Move to Position(0,x), x is adjustable from 0 to 255.
Normally the servo has to turn 180°, but with de V7 software he turns only 90°.
What did I wrong? I programmed the Uno also with Arduino software and then he's turning 180°. Conclusion: the hardware is ok. thanks

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times

Re: Arduino Uno Stepper turns max 90°

Post by Docara »

Hi Nicmaes,

I think this is correct, arent servos referenced form the middle of there travel.
I think your thinking the 0to255 is from start to end not middle to ONE end

Matt

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Arduino Uno Stepper turns max 90°

Post by medelec35 »

Docara wrote:I think this is correct, arent servos referenced form the middle of there travel.
I think your thinking the 0to255 is from start to end not middle to ONE end
That's not how I believe servo component will work.
It's something like 1ms fully clockwise (View from the top) = 0 = -90deg , 1.5ms centre = 127 = 0deg and 2ms = fully counter-clockwise = 255 = +90deg.

I have just had a look at the servo properties and as a default, pulse width minimum is set at 1280uS = 1.28ms
Therefore servo will not be fully clockwise.
My guess with the current defaults the maximum angle will only be approximate 130 deg.

Try changing the pulse width minimum to say 1000 = 1.0ms

Just bear in mind that if the pulse width minimum or maximum is set out of servo range, then damage to servo could occur.
So it might be worth changing the maximum from 2500 to 2000 as a starting point.

Martin
Martin

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times

Re: Arduino Uno Stepper turns max 90°

Post by Docara »

Thanks Martin

Brain Fart!!! :oops: :oops: :oops: :oops:

Post Reply