About the servo component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

About the servo component

Post by Mathy »

Hi !

I just try the servo component in the lastest Flowcode 4 for PIC.

I found a pulse between 1000µS to 2.280µS.

The servomotor I used permit a pulse between 600µS to 2400µS

What can I change in the PIC_Servo.c file to access to the full range of my motor ?

Thank you so much :)

Mathy

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: About the servo component

Post by Sean »

The servo duty cycle is set in the TIMER1_COMPA_vect interrupt handler.

The value is created by adding the servo position value to the trimm offset value. The result is then multiplied by a scaling factor, MX_SERVO_CLK_COUNT, before being sent to the timer registers.

Modification of the adjustment range will require changes to be made to these calculations in the C source code.

sundgau
Posts: 78
Joined: Mon Sep 26, 2011 4:18 pm
Has thanked: 5 times
Been thanked: 10 times

Re: About the servo component

Post by sundgau »

Hi all,
Almost 2 years, I raise the post for more details on this issue.
What needs to change as the code to be able to operate the servos angles larger.
My engine work equally 600US and 2400us.

Best regards

Bruno

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: About the servo component

Post by dazz »

Hi Bruno
Can you post a flowchrt and what type of servo are you using

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

sundgau
Posts: 78
Joined: Mon Sep 26, 2011 4:18 pm
Has thanked: 5 times
Been thanked: 10 times

Re: About the servo component

Post by sundgau »

Hello Diaz,

I'm using the servo on the Actuator Training Panel.
The reference is HS-311. The documentation says that the angle is 120 °, but the test shows that can have up to 180 °.

I took the example of the following resources: Worksheet 3 "Driving the servo motor" page12
http://www.matrixmultimedia.com/resourc ... S-80-2.pdf, we can control the servo with time to 600uS 2400us; also the angle of rotation is 180 °

but the following examples: http://www.matrixmultimedia.com/resourc ... php?id=532, the postion of Sevos is limited to a time of 1ms to 2ms when using the component "servo": also, the angle of rotation is limited to 120 °.

How to change these default values?

Best regards

Bruno

Post Reply