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
Arduino Uno Stepper turns max 90°
Moderator: Benj
Re: Arduino Uno Stepper turns max 90°
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
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°
That's not how I believe servo component will work.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
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