Motor identification and testing
This commit is contained in:
parent
3cb21d195f
commit
2e95e6afdc
@ -16,7 +16,7 @@ extern long last_p;
|
|||||||
|
|
||||||
// Loop timing
|
// Loop timing
|
||||||
// TODO TEMPORARY CHANGED TO 1000, NORMAL 50
|
// TODO TEMPORARY CHANGED TO 1000, NORMAL 50
|
||||||
#define LOOP_DELAY_MS_CORE_0 5000 // Minimum milliseconds between the start of each loop, accounting for processing time during each loop
|
#define LOOP_DELAY_MS_CORE_0 500 // Minimum milliseconds between the start of each loop, accounting for processing time during each loop
|
||||||
#define LOOP_DELAY_SECONDS_CORE_0 ((float)LOOP_DELAY_MS_CORE_0 / 1000.0f) // Previous number expressed in seconds
|
#define LOOP_DELAY_SECONDS_CORE_0 ((float)LOOP_DELAY_MS_CORE_0 / 1000.0f) // Previous number expressed in seconds
|
||||||
|
|
||||||
#define LOOP_DELAY_MS_CORE_1 50 // Minimum milliseconds between the start of each loop, accounting for processing time during each loop
|
#define LOOP_DELAY_MS_CORE_1 50 // Minimum milliseconds between the start of each loop, accounting for processing time during each loop
|
||||||
|
20
src/main.cpp
20
src/main.cpp
@ -983,18 +983,22 @@ void loop() {
|
|||||||
set_motor(FRDRIVE, swrv.front_right_power);
|
set_motor(FRDRIVE, swrv.front_right_power);
|
||||||
set_motor(BLDRIVE, swrv.back_left_power);
|
set_motor(BLDRIVE, swrv.back_left_power);
|
||||||
*/
|
*/
|
||||||
for(int i = 0; i < 8; i++) {
|
int loop_motor_change_interval = 8;
|
||||||
if(i == loop_counter_core_0 % 8) {
|
if(loop_counter_core_0 % loop_motor_change_interval == 0) { // Only change motors every 20 loops, or 2 seconds
|
||||||
set_motor(i + 1, 127);
|
int target_active_motor = ((loop_counter_core_0 / loop_motor_change_interval) % 4) + 5;
|
||||||
Serial.print("Powering motor");
|
|
||||||
Serial.println(i + 1);
|
for(int i = 5; i <= 8; i++) {
|
||||||
} else {
|
// 20 for drive motors, 120 for steering motors
|
||||||
set_motor(i + 1, 0);
|
set_motor(i, (20 + (100 * (i < 4))) * (i == target_active_motor));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Serial.print("Powering motor");
|
||||||
|
Serial.println(target_active_motor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update stepper motors
|
// update stepper motors
|
||||||
set_motor(LIFTALL, clawarm.arm_set_motor_int);
|
// TESTING temporarily disabled for motor testing above on 20230929
|
||||||
|
//set_motor(LIFTALL, clawarm.arm_set_motor_int);
|
||||||
|
|
||||||
// update servos
|
// update servos
|
||||||
/*
|
/*
|
||||||
|
@ -81,7 +81,8 @@ void comm_parse() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TESTING: temporarily disabled for motor testing on 20230929
|
||||||
|
/*
|
||||||
if(millis()-ptime > FAILTIME){
|
if(millis()-ptime > FAILTIME){
|
||||||
//digitalWrite(13,LOW);
|
//digitalWrite(13,LOW);
|
||||||
SerCommDbg.println("No input recieved, sending safe inputs");
|
SerCommDbg.println("No input recieved, sending safe inputs");
|
||||||
@ -89,4 +90,5 @@ void comm_parse() {
|
|||||||
memcpy(astate,&safe,sizeof(packet_t));
|
memcpy(astate,&safe,sizeof(packet_t));
|
||||||
comm_ok=0;
|
comm_ok=0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user