Help with servomotor !!!

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

Moderator: Benj

Post Reply
kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Help with servomotor !!!

Post by kalmar79 »

Hello from Costa Rica, central america.
I'm trying to program a servomotor with a pic 1F877A working with a 4Mhz xtal and a potenciometer, I see a example (controlling a servo with an anologue input) but it work with 90 degrees, so I need move the servomotor 180 degrees.

Please help me.

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

Re: Help with servomotor !!!

Post by Docara »

Hi,

Please post your chat

When I run the following example "Servo Example 1" from here https://www.matrixtsl.com/wikiv7/index. ... 37e9b979a2 it turns 180deg.

Matt

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

Re: Help with servomotor !!!

Post by medelec35 »

Hi kalmar79,
Matt is correct.
The V6 example found here
Default pulse width is from 1280us to 2500 us (1.280ms to 2.5ms):
Servo Control.png
(82.41 KiB) Downloaded 7144 times
If your servo pulse width is different then just select the Servo Controller on 3D System Panel, right click and select properties.
There you can change the pulse Width to give full 180 of your servomotor.
Just bear in mind that you can purchase servo motors that only span 90 deg.
Best not to work outside the PWM parameters stated within the data sheet of your servo.

Martin
Martin

kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Re: Help with servomotor !!!

Post by kalmar79 »

error1.png
(58.96 KiB) Downloaded 7117 times
Thank you, I solved this problem. Now I have another question, in my arduino UNO R3, only compiled one servo motor, but 2, 3 or 4 servomotor give me error 1 and error in vector 11 and 12.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help with servomotor !!!

Post by Benj »

Hello,

Are you using multiple servo controller components in your program? A single servo controller component can be used to control up to 8 individual servo motors.

kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Re: Help with servomotor !!!

Post by kalmar79 »

Thanks for response. I send a picture, can you explain me better, with a picture please.
Attachments
servos.png
(17.19 KiB) Downloaded 7089 times

kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Re: Help with servomotor !!!

Post by kalmar79 »

I compiled the 4 servo motors with the 16F877A and only work the analogue 1, maybe I am programming something bad.
Attachments
3.jpg
3.jpg (296.46 KiB) Viewed 11172 times
2.png
(19.12 KiB) Downloaded 7089 times
1.png
(18.79 KiB) Downloaded 7089 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help with servomotor !!!

Post by Benj »

Hello,

Please can you attach the Flowcode fcfx project file and I will have a look for you. As I say serveral servo components can be connected to a single servo controller component. Having multiple servo controller components won't work because they need dedicated access to resources on the micro.

kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Re: Help with servomotor !!!

Post by kalmar79 »

Proyecto CUC.fcfx
(19.98 KiB) Downloaded 344 times

thanks !!!

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

Re: Help with servomotor !!!

Post by medelec35 »

Hi kalmar79,
I have modified your flowchart for you.

Martin
Attachments
Proyecto CUC1.fcfx
(17.92 KiB) Downloaded 315 times
Martin

kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Re: Help with servomotor !!!

Post by kalmar79 »

I am very grateful to you and Benj, I going to try and comment. So this can work in arduino too??

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help with servomotor !!!

Post by Benj »

So this can work in arduino too??
AVR based Arduino - Yes.

kalmar79
Posts: 45
Joined: Sun Aug 20, 2017 8:18 pm
Been thanked: 4 times
Contact:

Re: Help with servomotor !!!

Post by kalmar79 »

I am very happy, my project is working good. Now I want to control my project with RC transmition with joysticks.
I going to upload the components that I want to use.
Attachments
Screenshot_2017-08-25-22-03-31.jpg
Screenshot_2017-08-25-22-03-31.jpg (57.21 KiB) Viewed 11132 times
Screenshot_2017-08-25-22-01-45.jpg
Screenshot_2017-08-25-22-01-45.jpg (65.87 KiB) Viewed 11132 times
Screenshot_2017-08-25-21-03-08.jpg
Screenshot_2017-08-25-21-03-08.jpg (53.3 KiB) Viewed 11132 times

Post Reply