Need testers for SoftPWMServo library

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Need testers for SoftPWMServo library

Post by EmbeddedMan » Fri Nov 23, 2012 5:28 am

Garrett,

Many thanks! I'll put that change into the next MPIDE build.

You must be using the library a lot to have discovered this bug. What project(s) are you using it for?

*Brian

domoarigato
Posts: 2
Joined: Thu Nov 22, 2012 4:51 pm

Re: Need testers for SoftPWMServo library

Post by domoarigato » Fri Nov 23, 2012 3:53 pm

Thanks Brian,

Your library couldn't have come at a better time for me. Thanks a lot for your contribution! I'm building a robot arm with image and distance sensors. The ChipKit PIC32 board with your library is great for this application! :mrgreen:

Garrett

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: Need testers for SoftPWMServo library

Post by Jacob Christ » Fri Nov 23, 2012 4:48 pm

Brian,

So, is your SoftPWM code in the core?

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Need testers for SoftPWMServo library

Post by EmbeddedMan » Fri Nov 23, 2012 7:37 pm

Jacob,

Well, it all depends on how you define 'core'. <grin>

The SoftPWMServo library has been distributed with MPIDE for quite some time now. However, it is simply still just a library, not inside the PIC32 folder. I don't expect that to change.

*Brian

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: Need testers for SoftPWMServo library

Post by Jacob Christ » Fri Nov 23, 2012 8:57 pm

I guess, I meant distributed with MPIDE. Its nice to know that its there. This partially address what I was talking about the other day with analogWrite not working on some pins. Only partially because if your following Arduino documentation you might now know that this soft version exists for chipKIT (As I didn't and I'm pretty tuned in).

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

PICedh
Posts: 64
Joined: Tue May 15, 2012 8:17 pm
Location: Paris
Contact:

Re: Need testers for SoftPWMServo library

Post by PICedh » Fri Dec 21, 2012 12:12 am

Hello

I want to use this lib with a servo but I can't rotate the servo more than 90°.

I would like to be able to rotate with an angle of 180°, it works with the standard servo lib but not with the SoftPWMServo lib

I think it is an issue with the min and max pulse delay but I don't know how to update them

I use an CHIPKIT UNO

thanks
RobotEdh: My first Robot is controlled by a chipKIT Max32

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Need testers for SoftPWMServo library

Post by EmbeddedMan » Fri Dec 21, 2012 5:36 pm

By default the the max is set to 2.0ms. This is the normal range for most RC servos.

To get an extended range, you need to use the SoftPWMServoSetFrameTime() function to extend the max range of all soft servo outputs. Then you can use the SoftPWMServoServoWrite() function, or the SoftPWMServoRawWrite() function to set the pin's pulse width to whatever you'd like. See SoftPWMServo.h for more complete details.

Also see the ChangeFrameTime example that comes with the library to see how do do this.

*Brian

PICedh
Posts: 64
Joined: Tue May 15, 2012 8:17 pm
Location: Paris
Contact:

Re: Need testers for SoftPWMServo library

Post by PICedh » Fri Dec 21, 2012 5:51 pm

My servo is a standard hobby servo that works fine with the Servo Lib.
So I think it needs pulse within 1 and 2 ms as usual.

I think the SoftPWMServo lib doesn't pulse within 1 and 2 ms but maybe between 1.2 and 1.8 ms

where can come the issue?
RobotEdh: My first Robot is controlled by a chipKIT Max32

EmbeddedMan
Posts: 597
Joined: Tue May 24, 2011 9:24 pm
Location: Minneapolis, MN
Contact:

Re: Need testers for SoftPWMServo library

Post by EmbeddedMan » Fri Dec 21, 2012 10:53 pm

Have you measured the output of the SoftPWM library? If you do
SoftPWMServoServoWrite(pin, 1000);
it should output 1.0ms pulse, and
SoftPWMServoServoWrite(pin, 2000);
should output 2.0ms pulse. If you have measured it and this is not the case, please let me know.

*Brian

PICedh
Posts: 64
Joined: Tue May 15, 2012 8:17 pm
Location: Paris
Contact:

Re: Need testers for SoftPWMServo library

Post by PICedh » Sat Dec 22, 2012 10:54 pm

i have no oscillo so I can't measure the pulse
RobotEdh: My first Robot is controlled by a chipKIT Max32

Post Reply