Quote:
Originally Posted by Dunngeon
Interesting, I didn't realize that teslalab2 was referring to your video.
|
You are correct, I had made the assumption he was referring to my video based on the sequencing of the posts. So, if my tone was a bit offensive, I apologize.
Quote:
Originally Posted by Dunngeon
The reason I said yes to the PID loop is that if the end goal is to have something be held by the bot, or for the bot to be heavy, our team has had very good success using P-control in those scenarios (very little oscillation, if at all).
In your heading control are you just adding a rotation value to make it rotate in the opposite direction whenever the heading changes to something other than 0 when translating?
|
The basic code I used for Kiwi drive is:
Code:
Wheel1 = -1/2 X - sqrt(3)/2 Y + R
Wheel2 = -1/2 X + sqrt(3)/2 Y + R
Wheel3 = X + R
Where X is the x-axis input, Y is the y-axis input, and R is the Rotation input.
When I added the gyro, the code was modified as follows:
Code:
Wheel1 = -1/2 X - sqrt(3)/2 Y + (R + gyro)
Wheel2 = -1/2 X + sqrt(3)/2 Y + (R + gyro)
Wheel3 = X + (R + gyro)
Fortunately the scale of the gyro input matched the original values in the control that I really didn't need to change it's scale at all. Later experimentation's determined that a P gain of 1.2 yeilded the best overall performance, but leaving the P gain off was sufficient for prototyping and education purposes.
Quote:
Originally Posted by Ether
There's obviously some sort of closed-loop control. So if not PID, then what? TBH maybe?
|
As seen in the code blocks above, the loop is closed by adding the heading value from the gyro. A "P" gain can be implied to be 1, but for the video, no gain was actually applied. It was simply adding the heading to the rotation input.