jsimpso81 / WPIlibMathLabVIEW

WPILib LabVIEW Math Library
Other
16 stars 3 forks source link

Swerve Skew Issue #174

Open WinstonHChou opened 11 months ago

WinstonHChou commented 11 months ago

A problem I've got, when developing swerve drive, is that swerve drive skew leads to undesired route moving. Is there any known method to tackle the skew problem?

FYI, this is the discussion thread of swerve skew issue on chief delphi. https://www.chiefdelphi.com/t/whitepaper-swerve-drive-skew-and-second-order-kinematics/416964/8

jsimpso81 commented 11 months ago

I haven't looked at the Chief delphi thread yet. One can feedback the swerve module position errors and decide to minimize or stop the linear drive motor until the modules are in position. However this is a trade off between accuracy of direction and delaying moving forward.

jsimpso81 commented 11 months ago

See the new release library and examples. https://github.com/jsimpso81/WPIlibMathLabVIEW/releases/latest

jsimpso81 commented 11 months ago

Take a look at the swerve drive odometry example. It has a crude implementation of logic to try and minimize swerve skew. Good tuning of the swerve module position control is also essential. In the simulation and example, I show three different types of control --- PID with characterized error, profiled PID, and Position control. For the simulation position control seemed to work the best. However I didn't spend much time tuning.

WinstonHChou commented 11 months ago

Take a look at the swerve drive odometry example. It has a crude implementation of logic to try and minimize swerve skew. Good tuning of the swerve module position control is also essential. In the simulation and example, I show three different types of control --- PID with characterized error, profiled PID, and Position control. For the simulation position control seemed to work the best. However I didn't spend much time tuning.

Is the example within the release library package? or should I git clone the repository? And also, during teleop, how exactly should I do position control? Different from trajectory, I don't have Pose_Ref during teleop.

jsimpso81 commented 11 months ago

The release has 2 install files. One contains the library. The other contains the examples. ( There are actually 4 files in the release - a set for LabVIEW 2020 and another set for LabVIEW 2023. Make certain to choose the files that match your version of LabVIEW. The examples can then be located through LabVIEW's "Find examples" menu.

jsimpso81 commented 8 months ago

Is this issue ready to be closed??

WinstonHChou commented 8 months ago

Nah still cannot resolve this issue. Is there any good way to tune steering controller? PID is not a good option.