RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Any hardware type questions or problems for all other Phidget devices.
Post Reply
Rhybot
Phidgeteer!
Posts: 52
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

RC Servo Phidget Returning PhidgetException 0x33 on getPosition()

Post by Rhybot »

I have a RC Servo Phidget, PN RCC1000_0.
https://www.phidgets.com/?tier=3&catid= ... rodid=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_sam ... 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: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

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

Post by jdecoux »

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
Phidgeteer!
Posts: 52
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

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

Post by Rhybot »

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

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests