RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Any hardware type questions or problems for all other Phidget devices.
Rhybot
Phidgetly
Posts: 18
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Postby Rhybot » Fri Feb 14, 2020 3:44 pm

I have a RC Servo Phidget, PN RCC1000_0.
https://www.phidgets.com/?tier=3&catid=21&pcid=18&prodid=1015

I first attach the Phidget, no problem. Then, when I call rc_servo.getPosition(), I get

Code: Select all

PhidgetException 0x33 (Unknown or Invalid Value)

Code Run (after attachment)

Code: Select all

rc_servo.setTargetPosition(0.0)
rc_servo.setEngaged(True)
rc_servo.getPosition()

Code is based on this code sample: https://www.phidgets.com/?view=code_samples&product_id=RCC1000

I am using Python 3.6, Phidget22==1.5.20191113, and Phidget firmware version 110.

Stack Trace

Code: Select all

File "/some_path/rc_servo_driver.py", line 68, in angle_deg
    return self.getPosition()
  File "/usr/local/lib/python3.7/site-packages/Phidget22/Devices/RCServo.py", line 284, in getPosition
    raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException: PhidgetException 0x33 (Unknown or Invalid Value)
The value is unknown. This can happen right after attach, when the value has not yet been recieved from the Phidget. This can also happen if a device has not yet been configured / enabled. Some properties can only be read back after being set.

Any ideas on what I am doing wrong? Is there some property I need to set first?

jdecoux
Labview Developer
Posts: 100
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Postby jdecoux » Fri Feb 14, 2020 3:54 pm

Try putting a small delay (10-100ms) between setEngaged and getPosition to give the servo controller a bit of time to report its position to your program.

Rhybot
Phidgetly
Posts: 18
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

Re: RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Postby Rhybot » Fri Feb 14, 2020 4:16 pm

I added a 10 ms delay after completion of the attach handler. It worked, thank you @jdecoux!


Return to “All Other Phidgets”

Who is online

Users browsing this forum: No registered users and 2 guests