A LOT OF QUESTIONS on How to implement motion profile?

Hey guys! Any help would be greatly appreciated!

My Current Dillema:

  • I am using pathfinder to generate csvs of paths beforehand and I am in need of a implementation of the algorithm in Labview. The csv provides encoder information as well as heading information. I built my structure off of Talon SRX’s Motion Profile Example (not designed for differential systems.) I am running two separate profiles for the left and right sides of the wheel and am able to implement driving fairly well.

The Problem:

  • The robot drives in a straight line to a desired distance, but things gets messed up once I add a turn. The encoders both eventually reach the final setpoint, but because of the variations in the process, the angle gets messed up.

My proposed solution(s):

  • Solution 1: If I find a way to implement angular control to my existing code (have heading setpoint in addition to velocity and position setpoints for each timestep), I think that can fix the problem.

    • problem with this solution:

    • I cannot find a good way to incorporate gyro feedback into my current implementation. I successfully added auxillary position and velocity to my trajectory points, but I don’t know how exactly to implement them in the code… Questions like, Can I run two profiles that are both trying to correct the 1 gyro sensor? Do I stay in motion profile mode or do I need to go to motion profile arc? (when I changed control mode to motion profile arc, the motors do not get turned on :frowning: )

  • Solution 2: CTRE’s remote closed loop example code has an implementation of motion profile incorporated with gyro.

    • problems/my confusions: Their structure is to set both sides of the robot following each other, and using the gyro to control the angular position.

      • Problem 1) I don’t know if this would do what I want it to do ? (feeding it a spliny 2d path and just having it implement my path with gyro feedback) The example did not have a dynamic change in heading. It specified a final turning angle (turn 90 degrees over the course of the path), but my path would not have that uniforn turnings and the heading will change on the fly.

      • Problem 2) I’m still having some trouble implementing it to our robot, but I’ll keep working on it and update if I get it to work.

  • Solution 3: I keep my existing code. No gyro feedback. I somehow tune a perfect PID that works every time.

    • questions: Is this recommended/doable? Can I end up with good angular results with no gyro feedback? Whats the best way to tune PID better?

Current main question: spend more time on solution 1, solution 2, or solution 3?
Robot is not even done yet so I have hecka time to play around with stuff.


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.