PiCar-X Calibrations

21 views
Skip to first unread message

Anthony Malary

unread,
Jun 13, 2026, 12:43:33 AMJun 13
to RSSC-List
How's it going y'all I have been working on my robot, and I was able to get past basic set up and loading the software on to the pi correctly only trouble I'm having now is calibrations. Do any of you have any tips in that area? I'm able to get my steering calibration to work finally but the panning and tilt for some reason are not working correctly.  

Bob Huss

unread,
Jun 13, 2026, 12:20:30 PMJun 13
to Anthony Malary, RSSC-List
Hi Anthony,
There are 2 ways that I found to work for calibration of motor position.
If the robot has hard stops, then of course you can count digital pulses with a shaft encoder on the motor.
Or another way is to use an inclinometer chip mounted on the moving surface and that surface can be calibrated with a constant value that you determine. Some of these IC's output analog or I2C Digital signals, and can meaure 2 axis positions.
Hope this helps.
Bob Huss


On Fri, Jun 12, 2026, 9:43 PM 'Anthony Malary' via RSSC-List <rssc...@googlegroups.com> wrote:
How's it going y'all I have been working on my robot, and I was able to get past basic set up and loading the software on to the pi correctly only trouble I'm having now is calibrations. Do any of you have any tips in that area? I'm able to get my steering calibration to work finally but the panning and tilt for some reason are not working correctly.  

--
You received this message because you are subscribed to the Google Groups "RSSC-List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rssc-list+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/rssc-list/b8545f8f-481b-4d68-bf08-9bbefbe6d748n%40googlegroups.com.

Alan Timm

unread,
Jun 15, 2026, 9:24:56 PMJun 15
to RSSC-List
So the trick is understanding that standard servos were never meant to be precision devices, and how to work with how each one is set up.

These almost always use a standard potentiometer internally, and the good news is that they're response by position is pretty linear.

So lets say you have a 180 degree servo, meaning it can turn 180 degrees end to end.

the trick is to discover what the minimum pulse value is for your 0 degree position, and the maximum pulse value for your 180 degree position.

Then you're going to map() your 0,180 range to whatever that pulse range is.  

Depending on what you're coding on the specifics look a little different, but that's more or less what you're going to do.

Unless you're talking about the raspberry pi pico, pi's don't do a great job of driving servos.  are you using a servo driver board?  What's your setup look like?

Alan

Anthony Malary

unread,
Jun 30, 2026, 7:56:47 PMJun 30
to Alan Timm, RSSC-List
How's it going y'all here is what I am working with. I have been trying to do as you instructed Alan and when it comes to those two servos I'm still have trouble calibrating I'll keep trying this weekend and give you all updates from there. 

Best Regards, AM

--
You received this message because you are subscribed to the Google Groups "RSSC-List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rssc-list+...@googlegroups.com.
unnamed.jpg

Chris Albertson

unread,
Jul 1, 2026, 6:33:44 PMJul 1
to Anthony Malary, Alan Timm, RSSC-List
I had to solve this same issue with a quadruped robot.   These were two issues, (1) generating the PWM signal accurately is harder than you might think.   You can see this if you have a logic analyser to measure the signal. and (2) calibrating the servo.

I wrote some software in Micro Python that can control up to 16 servos.   It has a test mode and a run mode.    In test mode, you enter angles in degrees and then measure the actual angles with a protractor.  You can measure as many points as you like.   Then the software computes a correction function using a least-squares fit. 

The test mode also allows you to change the direction and set angle limits for safety and also to define a “zero”.

One big thing it does is the driver allows you to set a rate and acceleration and then the driver computes all the small positions and updates the PWM.   It all runs on ESP32 and uses hardware-generated PWM.   Micro Python makes this easy.   “Mico” is not like normal Python and can produce compiled code if you ask and can do true multitasking.

This is the only good solution I could come up with, basically impose a least-squares calibration function and offload the hard real-time control.  The ESP32-S3 has no trouble generating 16 channels of near perfect  PWM using only one of its CPU cores and then the other core to handle the data interface to the Raspberry Pi.  There is some shared data in RAM that both cores look at.

All that said, while this driver does extract every last bit of performance from a hobby servo, my problem was that servos are at least an order of magnitude underperforming for my application.   You need three-phase BLDC for anything that walks.

The code is on GitHub (someplace)
Reply all
Reply to author
Forward
0 new messages