servo not working

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

Moderators: Benj, Mods

servo not working

Postby achillis1 » Mon Dec 27, 2010 5:58 am

Hello,

I have the servo board and attached a 60 degree servo. I did a simple flowcode routine to move the servo to right and left continuously. After a gazillion tries ( I do not know why it did not work from the first tries) the servo motor moved! After I left the laptop and e-blocks board untouched for a week or two and when I powered up the board again then it could not work! I resent the routine again but nothing. After I got a 360 degree servo and tried to send the precompiled test file from flowcode and nothing happens.
I checked with a multimeter the voltages accross the servo board and seem to be OK. I run the routines in flowcode and the simulation is working but real life not!
note: I installed flowcode in another PC and sometimes the simulation on both PCs could not behave as expected( servos not moving)
Is there something else I have to do to work with servos? Any patch? ANy trick?

Now I got errors such as ECIO not installed, ECIO continuously blinking, the eb006 board with 16f877a cannot connect(usb cable not connected).

I send simple routines such as write on LCD and the chips are working but with servos not.

Any ideas?

Thank you in advance,

Best Regards,

Achillis
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Advertisement

Re: servo not working

Postby Jan Lichtenbelt » Fri Dec 31, 2010 10:26 am

Dear Archillis,

Try this flowcode with 1 msec pulses for 1 sec and 2 msec pulses for 1 sec etc. etc. The repetition frequency of the pulses is 50 Hz.

Kind regards

Jan Lichtenbelt
Attachments
Test_servo.fcf
(5 KiB) Downloaded 311 times

For this message the author Jan Lichtenbelt has received thanks:
achillis1(Fri Mar 18, 2011 8:13 am)
Rating:6.25%
 
User avatar
Jan Lichtenbelt
Valued Contributor
Valued Contributor
 
Posts: 505
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 29 times
Have thanks: 131 times

Re: servo not working

Postby achillis1 » Sun Jan 02, 2011 5:48 pm

Hello Jan,

I appreciate that you uploaded the file.
I will try it as soon as I manage to upgrade flowcode from v3 to v4 because I have some registration issues.
I will let you know if it worked.

Thank you,

Best regards,
Achillis
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby achillis1 » Wed Jan 19, 2011 12:58 pm

Hello Jan,

Nothing happended running your programme!
A note though, I connected the servo on the servo board and not directly to the PIC.

Thank you.
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby achillis1 » Fri Mar 18, 2011 8:15 am

Hello Jan,

I tested your program againand it worked fine!
Already thanked the post.
Tell me, how can you achieve the servo to change its direction?

By the way do you have any idea how to make the servo rotate to a specific angle and freeze there? I do not need it to continuously rotate.

Thank you in advance,

Best Regards
Andreas Achilleos
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby Spanish_dude » Fri Mar 18, 2011 1:15 pm

Hi,

A servo motor uses a PWM to set it's position.
A period of 20ms and a Ton not exceeding the 2ms is the basic PWM to drive the servo.

"Playing" with the value of Ton will move the servo to an angle, and it will stay there, unless you change the Ton value.

Hope this helps.

Regards,

Nicolas L. F.

PS: Remember that servo motors do not rotate 360° (some of them do turn 360°, I know, but I'm talking about the "most common" servos) and more, like a normal motor. Most of the servos rotates ~180°.
Spanish_dude
Valued Contributor
Valued Contributor
 
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 83 times
Have thanks: 107 times

Re: servo not working

Postby achillis1 » Fri Mar 18, 2011 1:52 pm

Hello,

Thank you for you reply.
I have searched a little bit in the Net and somehow I get the general idea.
I know that the common servos rotate 180 degrees and less but the servos I have can rotate 360 from factory.
Now the thing with driving the servo is that when I send high to my servo via the port pin for 1ms and then zero for 19ms =total 20ms required to drive the servo, the servo moves but does not have an accurate stepping. Gets the pulse and then whenever it stopps from luck of power. If you keep sending the pulse within a loop then the servo keeps rotating and does NOT keep the specific angle and freezes there. Whatever value is the pulse then the servo just rotates.
Only if I send a command via the flowcode servo component macro I can play with the speed of the servo.
Ex. if I send the value 1 then the servo rotates clockwise with full speed and if I send 118 then the servo does not move and if I send 150 it rotates anti clockwise.
In order to rotate the servo and then make it to stay there, then I must add a ''disable servo'' macro in the routine BUT I can NEVER make it to rotate from one angular position to another that I wish and make it to stay there.
Say for example if the servo is at zero point to make it go to 96 degrees and stay there.

Best Regards.
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby Spanish_dude » Fri Mar 18, 2011 3:06 pm

When the servo turns clockwise (or anti-clockwise) does it turns more than 360° ?

If it does, then I think that's a modified servo and a modified servo will stop only if you don't send a pulse to it.
Spanish_dude
Valued Contributor
Valued Contributor
 
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 83 times
Have thanks: 107 times

Re: servo not working

Postby achillis1 » Fri Mar 18, 2011 3:41 pm

Whell it turns more than 360 degrees.
I have another that rotates up to 60 degrees I will check that.
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby Jan Lichtenbelt » Sat Mar 19, 2011 9:32 pm

Dear Achillis,

A servo can move about 180 degrees. You can make a real motor of it by removing the meachnical stop in the servo. I found an arctible (in Dutch) to get that fixed. Than you can rotate 360 degrees and more.

Good luck

Jan Lichtenbelt

http://duteela.et.tudelft.nl/~elca/XilinxTutor/documents/servohack.pdf

But there also english sites. Try Google with remove stop servo, or something like that
User avatar
Jan Lichtenbelt
Valued Contributor
Valued Contributor
 
Posts: 505
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 29 times
Have thanks: 131 times

Re: servo not working

Postby achillis1 » Tue Mar 22, 2011 2:30 pm

Helo Jan,

Thanks for the link but I already got a servo that rotates at 360 degrees. Actually there are servos that rotate at 60, 180 and 360 degrees.

About your program you attached, can I make the servo rotate at different sppeds?

Thank you
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby Spanish_dude » Tue Mar 22, 2011 3:35 pm

Hi,

To make a servo rotate faster you'll need to reduce the period of the signal (I'm noth sure 100%).
Spanish_dude
Valued Contributor
Valued Contributor
 
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 83 times
Have thanks: 107 times

Re: servo not working

Postby Benj » Tue Mar 22, 2011 4:49 pm

Hello,

The servo will move as fast as it can to the position specified. Therefore to increase or decrease the speed of the servo you need to interpolate between your values.

Moving directly 0 to 255 will be full speed

Using the auto move to position hardware macro allows a fixed speed slower then direct move to speed to be used.

Using the move to position hardware macro allows you to define the speed the motor moves by how often you call the macro. Eg calling more often will move the servo faster.
User avatar
Benj
Matrix Staff
 
Posts: 8707
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix Multimedia Ltd
Has thanked: 1461 times
Have thanks: 1813 times

Re: servo not working

Postby achillis1 » Wed Mar 23, 2011 9:14 am

Hello,

Is there a value to use with the automove command in order for the servo to move at the right end and a value to move at the left end?
I use the automove with byte value 220 and the servo almost moves all the way to the left end; but if I include a macro with auto move byte value 0 or up to 50 then the servo does not move to the right end.
Right or left I am using just to explain.

Using the move to position hardware macro allows you to define the speed the motor moves by how often you call the macro. Eg calling more often will move the servo faster.


So when using once the move command the servo will not go to that position? I will have to keep calling the macro do achieve that?

Thank you.
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times

Re: servo not working

Postby achillis1 » Wed Mar 23, 2011 9:27 am

By the way, I have left aside the 360 degress servo and connected the 180 degrees one so we can talk right.
I know that is working.
So far with macros I am not doing great but with the attached fcf file if you see the servo is working as predicted. When I press 1 on keypad then it moves rightwards and stops immediately. When I press 2 then moves at the other side. I have to keep pressing the key in order for the servo to stop immediately, if I press it very quickly then it tries to move to that position but due to inertia it passes the stop point. Note that the servo is not moving exactly to the end point, it need some degrees more.

The idea for the following routine was a help from Jan Lichtenbelt and I modified it a little bit. Thanks Jan. (viewtopic.php?f=5&t=7972)
Attachments
servo repeated simple.fcf
(6 KiB) Downloaded 206 times
User avatar
achillis1
Flowcode V4 User
 
Posts: 266
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 22 times
Have thanks: 4 times


Return to Flowcode V2 & V3

Who is online

Users browsing this forum: No registered users and 2 guests