Compare commits
2 commits
cc4d99c218
...
c97954b815
| Author | SHA1 | Date | |
|---|---|---|---|
| c97954b815 | |||
| a15dc3d11d |
3 changed files with 3 additions and 16 deletions
BIN
cad/Drive Wheel Tolerance Test.SLDPRT
Normal file
BIN
cad/Drive Wheel Tolerance Test.SLDPRT
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -36,25 +36,12 @@ void setup() {
|
|||
// TUNE VELOCITY PID
|
||||
left_motor.tune_vel_pid(0.9, 3.7,0.3,0.0);
|
||||
delay(10);
|
||||
right_motor.tune_vel_pid(0.0, 3.7,0.3,0.0);
|
||||
right_motor.tune_vel_pid(0.9, 3.7,0.3,0.0);
|
||||
delay(10);
|
||||
right_motor.set_direction(PIDDirection::DIRECT);
|
||||
|
||||
uint16_t ratio = right_motor.get_gear_ratio();
|
||||
Serial.print("ratio: ");
|
||||
Serial.println(ratio);
|
||||
ratio = left_motor.get_gear_ratio();
|
||||
Serial.print("ratio: ");
|
||||
Serial.println(ratio);
|
||||
|
||||
//right_motor.set_direction(PIDDirection::DIRECT);
|
||||
|
||||
delay(1000);
|
||||
|
||||
// SET MOTOR POSITION
|
||||
//int32_t angle=360;
|
||||
//uint8_t status= left_motor.write_angle(angle);
|
||||
//delay(1000);
|
||||
|
||||
// READ MOTOR POSITION
|
||||
int32_t pos = left_motor.read_angle();
|
||||
Serial.print("Pos: ");
|
||||
|
|
@ -81,7 +68,7 @@ void loop() {
|
|||
|
||||
left_motor.write_rpm(setpoint.velocity * CMS_RPM);
|
||||
delay(10);
|
||||
right_motor.write_rpm(robot_state == TURN ? -velocity : velocity);
|
||||
right_motor.write_rpm((robot_state == TURN ? velocity : -velocity) * CMS_RPM);
|
||||
delay(10);
|
||||
|
||||
// READ MOTOR POSITION
|
||||
|
|
|
|||
Loading…
Reference in a new issue