Page 1 of 1
More information on Servo macro?
Posted: Tue Sep 17, 2013 5:42 pm
by hyperion007
I am having trouble using the servo macro.
The pic is a PIC18F26K80 and the servo is this one:
http://www.airyear.com/6009-9kg-metal-g ... 18825.html
The help file for the servo macro isn't really that good. doesn't explain in detail how the macro works etc.
The only thing that happens when I apply power to the PIC is that the servo moves a few degrees CW and stops. It does this no matter what servo functions I use.
Any ideas?
Re: More information on Servo macro?
Posted: Tue Sep 17, 2013 6:10 pm
by medelec35
Hi hyperion007,
If you can post your flow chart, then we can give you further advice to where the problem is.
what part/command of the help file, did you want additional help on?
Re: More information on Servo macro?
Posted: Tue Sep 17, 2013 7:32 pm
by hyperion007
I made a small test file that I have uploaded here now.
It simulates just fine, but behaves as described earlier.
For instance, what does "Trim" actually do? What does "SetPosition" do? does it define the current position of the servo or does it move the servo to that set point as an initial starting point?
Re: More information on Servo macro?
Posted: Tue Sep 17, 2013 7:39 pm
by dazz
hi
have a quick look at this thread i posted a flowchart using ser pos
http://www.matrixmultimedia.com/mmforum ... azz#p48599
Regards
Dazz
Re: More information on Servo macro?
Posted: Tue Sep 17, 2013 8:31 pm
by hyperion007
Yes, I am well aware of that thread but it doesn't help me. doing it that way still makes the servo act as previously described.
Re: More information on Servo macro?
Posted: Tue Sep 17, 2013 10:28 pm
by medelec35
Although Your Flowchart does not look correct.
E,g you have step time of 1 second, yet delay is 10ms so by the time a step has been completed N would have looped from start to finish 100 times
However I'm not convinced that Automove function is even working correctly.
To test your servo, I have modified your flowchart in the way I know that drives my servo.
As for automove and trim, a similar question was asked here:
http://www.matrixmultimedia.com/mmforum ... 43&#p22284
Martin
Re: More information on Servo macro?
Posted: Sat Sep 21, 2013 12:48 pm
by hyperion007
Hi all.
I have had some success on my own but I changed to a PIC18F4550 instead.
However, I do have a followup question. The servo I am using seem to be working just fine moving back and forth and between position 0 and 255, without drifting for instance, and position 127 is just about in the middle. But the servo seems to have quite a bit larger range of motion than what I am getting with positions 0-255. With no power applied to it I can move it a lot more. Is this normal? Maybe the servo is only meant to move 160 degrees in each direction from it's middle position?
Re: More information on Servo macro?
Posted: Wed Sep 25, 2013 4:10 pm
by Benj
Hello,
There is normally only a limited range of the servo movement which runs from around 1ms (0) to around 2.5ms (255). Around 160 degrees of controlled movement is fairly standard. You can use the Trim setting to adjust where the range of movement is by slightly tweaking the initial minimum delay.
In v6 I added a feature to override the timings so it may be possible to get full 180 degree movement out of a motor. Hitting an end stop will likely break the motor or at least grind down the gears so be careful if you try and attempt this.
Re: More information on Servo macro?
Posted: Sun Jan 12, 2014 3:07 pm
by Jay Dee
Hi guys,
Am I right in assuming that Servo Controller component 'bit bangs' the control pulse?
An internal timer is use to hold the pin high for a period between the minimum and maximum pulse times. 1ms to 2.5ms, relating to min and max servo positions.
The positional resolution would be related to the specific PIC's timer resolution ? and I can use most of the I/O pins not just the hardware PWM channel?
Thanks, J.
Ah yeah, also this component uses an interrupt? , which one is it... I dont think you can use an interrupt twice for different timings and want to make sure I don't use the one in the Servo component.
J.