ERAU-RAER / LunaboticsBurm

ERAU-RAER - NASA RMC
https://www.nasa.gov/learning-resources/lunabotics-challenge/
7 stars 1 forks source link

Drivetrain pwm fixes #15

Closed Sgail7 closed 7 months ago

Sgail7 commented 7 months ago

Removed redundant linear y, made it so that pwm can never exceed 255, rpm can never exceed maximum set rpm, and RPMtoPWM function can only output positive PWM values.

SrMeissel commented 7 months ago

Just pondering, We could make angular Z a unit coefficient for the left motors. Ex. the speed of the left motors are equal to linear X * (Angular Z + 1) /2 ?

Sgail7 commented 7 months ago

What would be the benefit of doing that? Furthermore, would we then leave the right motors the same in terms of calculations? Would the part of the formula (Angular Z + 1) not make the calculations of angular z inaccurate to what the real input was?

jake161 commented 7 months ago

Just a few things to take care of before proceeding:

  1. Looks like there's some more redundant linear.y values in the src file (not the libraries)
  2. Let's test out the code on the drive train before finalizing
  3. Since we have some wheels to throw on the motors, lets see if we can validate the current kinematics equations a bit.
Sgail7 commented 7 months ago

Just removed the only other instance of linear y I could find. I didn't want to remove it from ParseTwistandReturn and processTwist since those are for the teleop messages and don't affect the kinematics.

Definitely agree on testing out the code. Would be really nice to verify that the speeds we input are the real life speeds as well.

jake161 commented 7 months ago

Perfect, we'll get to testing as soon as possible

Sgail7 commented 7 months ago

Code has been tested with 1 motor. PWM overflow fixes work and so do the only positive PWM values. I'm requesting for this to be merged into mainline.

SrMeissel commented 7 months ago

Updated main branch ruleset to allow updates, still requires code reviews.