R/C Tech Forums - View Single Post - RC Car Running Pacer
View Single Post
Old 08-16-2020 | 09:00 PM
  #2  
Bry195
Tech Master
 
Joined: Jul 2018
Posts: 1,011
From: Florida
Default

you have 2 curves at least that will need adjustment.

the ratio the chassis turns in relation to steering angle, velocity, and traction’s (surface and tires).

as the tires wear the diameter shrinks so you will need some math to create a constant velocity model.

you might get lucky and write a program that can figure out how much steering angle to add and how often by using a known distance between white lines but I think you will need actual velocity feedback from a brushed motor with sensors. and if you are going to do that you might as well get your pi connected to the actual steering feedback by tapping into the pot in the servo because if you are going to do the work to adjust velocity from actual sensor feedback you might as well do 10% more work and grab the actual steering angle.

the servo command represents a position but it does not represent how much the chassis turns.
The esc command does not represent velocity it represents torque.

the scrub angle of the front tires is highly variable.
torque represents a combination of friction, velocity, work, acceleration, ...

it sounds fun and can be done. it possible to expand and contract the end point of the steering rack with dual rate. this might be a manual setup to adjust the chassis turn to the steering angle. you will need to have a mathematical model of where the line is at always so that you can use a 5th order polynomial to blend the chassis angle to the predicted line angle because if the car breaks traction or steps outside your variables from a jerky movement you’ll need a method to recover the hypothetical line angle.

if you write enough code you will need less sensors. you could even cheat and create a teach program that records the motions and then you can expand and contract variables based on the new pace. That is all good until something unpredictable happens. You can spend a bunch of time predicting and refining or you can add more data but either way something unpredictable will happen. But that is what it takes over and over again. that is how you go from student to teacher is by those iterations and refinements.
Bry195 is offline