After zeroing and calibrating the servos on my Picar-x with Raspberry Pi 4, I tested its movement with the 2.move.py script. The script ran perfectly with all the expected movements. Upon running this script a second time, however, all 3 servos jerked abruptly prior to executing the expected movements. This occurred on all subsequent runs of this script until the system was rebooted. After reboot, the 2.move.py script again ran perfectly on its first run with no jerking. How do I fix this problem?
We haven’t been able to reproduce the issue on our side.
Could you please record a short video showing the jerking motion so we can see exactly what is happening? I suspect it may be caused by something outside the code itself.
Please upload the video to a cloud service (Google Drive, OneDrive, Dropbox) and share the link with us – make sure to grant access.
Once we see the video, we will be able to advise further.
The video shows that the initial jerking is better described as a judder. It occurs on all runs of 2.move.py after the Raspberry Pi is rebooted via software. The only time is does not occur is on the first run after the Robot Hat is powered on.
The video also shows that pressing the zero button on the Robot hat caused the servos to make two movements. Is that normal and which position is zero.
Thanks for your help.
During zero calibration: The double-jerk motion you see is actually intentional. The first movement is a “performance action” designed to visually confirm that the calibration has taken effect. The second movement is the one that sets the correct angle. This is normal behavior and not a defect.
Regarding the jerk when running the code a second time: We are currently looking into this issue, but we have not been able to reproduce it on our test units. Please rest assured that this does not cause any damage to the robot, and you can continue using your PiCar-X without concern.
The video below shows the judder in slow motion. It occurs whenever the picarx library is initialized (e.g. px=picarx() ), except on the first run after the Robot Hat is powered on via its on/off switch.
Thank you for the follow-up. While reviewing, we found an important detail in the Picarx library source: every time px = picarx() initializes, the library already resets the Robot HAT’s MCU automatically. Could you please run one more direct comparison test to confirm whether a hardware reset clears the judder:
- Keep the Robot HAT powered on (do not switch it off).
- Press the RST button on the Robot HAT once.
- Then run
px = picarx()and see whether the judder is still there.
If the judder is gone after pressing RST, it means the library’s built-in reset is not fully clearing the previous state, and we can improve the initialization to fix it at the source. If it still judders after pressing RST, we will look into the hardware/power path. Please share the result with us — thank you!
I ran the test you suggested and pressing the RST button does not eliminate the judder. I ran the test multiple times and the result was the same.
We would like to send you a replacement Robot HAT that has been pre-tested to ensure it works properly. We hope this will address the issue.
To proceed, please contact us directly at service@sunfounder.com with the following information:
Your shipping address (including recipient name, street address, city, state/province, postal code, and country)
Your phone number (required by the courier)
Your original order number if available
Once we receive these details, we will arrange to dispatch the replacement Robot HAT to you as soon as possible.
We apologize for the inconvenience and appreciate your patience.