Advanced Servo Controller Min/Max

Comments & issues
Totoila
Fresh meat
Posts: 2
Joined: Sat Nov 10, 2012 12:43 pm
Contact:

Advanced Servo Controller Min/Max

Postby Totoila » Sat Nov 10, 2012 12:58 pm

Hello there!

I have been searching trough the web to find my answer, but you can guess I didn't find anything due to the fact I'm posting this right now.

It's all about setting the Maximum and Minimum positions for an Advanced Servo Controller to a specific motor. For instance :
CPhidgetAdvancedServo_setPositionMax() and CPhidgetAdvancedServo_setPositionMin().
For testing purpose, I set the max position to 50, then I genuinely tell it to go to a higher position (180), and it goes to 180 no problem. :?: That's weird, I thought 180 was higher than 50. ( :wink: )
EDIT : When I use CPhidgetAdvancedServo_getPositionMax(), it returns 50, which is good.

What's the purpose of setting the Min/Max if it ignores it? Well, it seems to ignore it since it goes to 180 without any warning, error or exception. Weird!
Do I have to deal with the Min/Max validation myself?

Many thanks, you geek!

Language used : C++

Totoila
Fresh meat
Posts: 2
Joined: Sat Nov 10, 2012 12:43 pm
Contact:

Re: Advanced Servo Controller Min/Max

Postby Totoila » Sat Nov 10, 2012 1:41 pm

Hi myself,

I solved my problem. Looks like I had to create this thread to find the answer myself, finally.
If you are interested, I used this line for all my servos :

Code: Select all

CPhidgetAdvancedServo_setServoType(servo, m_port, PHIDGET_SERVO_HITEC_HS322HD);

where servo and m_port are the controller and a port.
I removed this line to get it to work.

It is working perfectly now. The motor will refuse to go the the specified position if it's out of the bounds.

Thank you!

User avatar
Patrick
Lead Developer
Posts: 3157
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Advanced Servo Controller Min/Max

Postby Patrick » Tue Nov 13, 2012 10:05 am

You need to set the motor type before setting min/max because each motor type resets min/max/velocity limit to specific values.

-Patrick


Return to “General”

Who is online

Users browsing this forum: JasonStoxy, luneart and 2 guests