Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: problem on servo mechanism
LucaMlns
Newbie
Posts: 4
Permalink
Post problem on servo mechanism
on: January 2, 2018, 17:43
Quote

Hello everybody,
my name is Luca and i am a college student.
I am working on a polargraph, i am using an arduino UNO and an adafruit motorshield v1.
I am using the latest version of polargraph on both firmware and controller (2017-11-01).
Everything is working fine except for my "pen lift" and "pen drop" mechanism. I am using a "kookye" mini servo. My problem is that the servo only goes clockwise instead of work both clockwise and counterclockwise.
I looked at the arduino code and the only values i've got are 90 for pen_down and 180 for pen_up.
I also tried to give 90 for pen_down and 270 for pen_up, but still nothing good.
Maybe someone can illuminate me why i have got so many problems with this mechanism.
Thanks, Luca

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: problem on servo mechanism
on: January 2, 2018, 21:45
Quote

Is it possible your servo is the "continuous rotation" type? You don't want that.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: problem on servo mechanism
on: January 2, 2018, 22:20
Quote

That's a good question - Luca, do you mean it just goes round and round the whole time? Or do you mean it only ever goes the correct distance in one direction? So I mean it moves 90 degrees clockwise, but you've got to turn it back counter-clockwise with your finger?

Have you tested the motor with a non-polargraph sketch? There's one called "sweep" in the standard Arduino examples.

sn

LucaMlns
Newbie
Posts: 4
Permalink
Post Re: problem on servo mechanism
on: January 3, 2018, 09:57
Quote

Hi and thank you for be so quick ! This mean a lot for me!
Kongorilla i've checked the model, actually is a 360 degree servo but is not a "continuous rotation" type.
Sandy my servo keep goes the correct distance in one direction, but i would never turn it back with my finger.
Yes i've tested the motor with the sweep example and everything goes fine.
I still don't understand why the two parameters are set on 90 and 180.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: problem on servo mechanism
on: January 3, 2018, 10:39
Quote

So how do you get it back to the start position once it's moved?

What's confusing you about the 90/180 degree setting for the servo? One is "pen up", the other is turned 90 degrees and "pen down". It's in the middle of the range of motion because the ends of the range tend to be a bit "twitchy" and non-linear.

Remember you can change the parameters on the "setup" tab of the controller -
"pen up position", "pen down position" will change those up and down positions. "Test lift range" does a few strokes through the range, and "upload lift range" writes the new range to the arduino - it replaces the 90/180 that you see in the code.

sn

kongorilla
Pro
Posts: 362
Permalink
kongorilla
Post Re: problem on servo mechanism
on: January 3, 2018, 11:17
Quote

What's the model # of the servo?

LucaMlns
Newbie
Posts: 4
Permalink
Post Re: problem on servo mechanism
on: January 3, 2018, 15:42
Quote

I cannot return it to the start position because my servo is keep adding 90 +180 everytime a pen_up or pen_down is call.
For me is confusing 90/180 because i imagine that the movement should be 0/90.
If i set 90/270 the servo doesn't act correctly and tries to go counterclocwise.

Shorn
Beginner
Posts: 33
Permalink
Post Re: problem on servo mechanism
on: January 3, 2018, 17:58
Quote

Hey Luca,

I am using a cheap micro servo as well and I had some issues with my servo initially too. I had to play with the up and down values to find a pair that moved the servo correctly for me.

I am using 110 and 20.

Here are my settings:

// Pen raising servo
Servo penHeight;
const int DEFAULT_DOWN_POSITION = 110;
const int DEFAULT_UP_POSITION = 20;
static int upPosition = DEFAULT_UP_POSITION; // defaults
static int downPosition = DEFAULT_DOWN_POSITION;
static int penLiftSpeed = 7; // ms between steps of moving motor
const byte PEN_HEIGHT_SERVO_PIN = 12; //UNL2003 driver uses pin 9
boolean isPenUp = false;

Hardware:
*Running an Arduino Nano reflashed with an Uno bootloader
*Modified knockoff GRBL CNC shield with knockoff DRV8825 step drivers
*400mA -200 step motors set to 16x microstepping
*2mm belt with 36 tooth drive gears
*Machine set to 1500 Max speed and 5000 motor acceleration

Software:
*Stock Polargraph Controller to make command queues
*D2S version 2
*Send.py on remote Raspberry Pi

LucaMlns
Newbie
Posts: 4
Permalink
Post Re: problem on servo mechanism
on: January 3, 2018, 18:03
Quote

Hello again everybody, i have good news.
I discover a tiny potenziometer on my servo, i turned it and my motor started going clockwise and counterclockwise!
now i've another problem because my servo rotate fine but it's jittering so it never return to the exact position. How can i adjust it ? do i need do change some variables in the arduino IDE ?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: problem on servo mechanism
on: January 3, 2018, 20:18
Quote

Some servos are good, some are bad. There's no settings in the Arduino IDE that will make any difference. Cheap ones are more variable.

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.022 seconds.