Jython1415 / Template_2021

A template for future VEX projects
0 stars 0 forks source link

motor does not move: March 3 test #9

Open Jython1415 opened 3 years ago

Jython1415 commented 3 years ago

Not quite sure what the main problem is here. It could be a problem with the motor class modifications, but I need better ways of looking into the controller inputs.

Jython1415 commented 3 years ago

Update: controller inputs can now be viewed using debug commands thanks for the enhancements from my work with #8. The issue is now narrowed down to be somewhere within the translation of controller values to target motor power. That will be the next thing to test.

Jython1415 commented 3 years ago

Update: I added a testing branch to figure out where the problem is, and it is ready for testing. Next time I can test the controller to target power to motor power connection to locate the error.

Jython1415 commented 3 years ago

Update: More set up for the test. I'm taking parts home so I can continue to test the code.

Jython1415 commented 3 years ago

Update: bruh. I'm still stuck

Chain: ctlr -> set func -> update func -> pragma -> act pwr update -> hardware probably set func for update func

Jython1415 commented 3 years ago

Update: I'm preparing tests to do tomorrow on a textfile.

Jython1415 commented 3 years ago

Update: the following code worked

void usercontrol( void )
{
  motors_rotation_reset();
  debug_print_initial();
  motors_update_brake_type();
  while (true)
  {
    debug_updateVar();
    ctlr_updateVars();
    motors_update_rotation_vars();
    tm.set_target(ctlr_axis2);
    tm.actual_power = tm.target_power;
    tm.spin(directionType::fwd, tm.actual_power, velocityUnits::pct);
    debug_print();
    vex::task::sleep(20);
  }
}
Jython1415 commented 3 years ago

Update I might've found the solution

Make the motor object an input to the functions used in the iterator-aggregator functions.

Files from the last session:

Jython1415 commented 3 years ago

Update: Moved around a lot but I'm still stuck.

I'm trying to make a list of pointers that reference back to the Motor_v2 object