Project

General

Profile

Revision 1305

Tweaked motors and encoders test parameters

View differences:

trunk/code/projects/diagnostic_station/station/dump_robot.c
20 20
		usb_puts ("Left:  "); usb_puti (left ); usb_puts (NL);
21 21
		usb_puts ("Right: "); usb_puti (right); usb_puts (NL);
22 22
		usb_puts (NL NL);
23
		
24
		delay_ms (50);
23 25
	}
24 26
}
25 27

  
trunk/code/projects/diagnostic_station/station/test_motors.c
39 39
// ** Internal functions **
40 40
// ************************
41 41

  
42
#define velocity_steady_delay 400
42
	// One way to do it
43
//	#define vel_inc 10
44
//	#define vel_steps 12
45
//	#define vel_min 140
46
//	#define vel_max 250
47
//	#define velocity_steady_delay 400
43 48

  
49
	// More steps at smaller intervals. We don't need so much delay here.
50
	#define vel_inc 2
51
	#define vel_steps 56
52
	#define vel_min 140
53
	#define vel_max 250
54
	#define velocity_steady_delay 50
55
	
56

  
44 57
static void test_motors_direction_acceleration (uint8_t direction1, uint8_t direction2, uint8_t pwm_start, uint8_t num_steps, int8_t pwm_step, char *acceleration_string)
45 58
{
46 59
	// Allocate space for the data on the stack
......
89 102
	// vel_min is also reached twice, once at the beginning of accelerating and once at the end of decelerating, and
90 103
	// this one is important.
91 104
	
92
	#define vel_inc 10
93
	#define vel_steps 12
94
	#define vel_min 140
95
	#define vel_max 250
96
	
97 105
	test_motors_direction_acceleration (direction1, direction2, vel_min, vel_steps, vel_inc, "increasing");
98 106
	test_motors_direction_acceleration (direction1, direction2, vel_max, vel_steps, -vel_inc, "decreasing");
99 107
}
trunk/code/projects/diagnostic_station/station/test_encoders.c
60 60
		
61 61
		// Read the robot encoders
62 62
		robot_read_encoders (&(data_robot_l[m]), &(data_robot_r[m]));
63
		
64
		//usb_puts ("# I readed teh encoders: ");
65
		//usb_puti (data_robot_l[m]);
66
		//usb_puts (" ");
67
		//usb_puti (data_robot_r[m]);
68
		//usb_puts (NL);
69

  
63 70
	}
64 71

  
65 72
	send_encoder_data (0, direction1, data_station_l, data_robot_l, num_measurements);
......
76 83
// ** Public functions **
77 84
// **********************
78 85

  
79
#define NUM 4
86
// Encoder readings seem to be unreliable with these values (on too long?)
87
//#define NUM 4
88
//#define VEL 200
89
//#define ON_DELAY 500
90
//#define OFF_DELAY 800
91

  
92
// Testing values
93
#define NUM 8
80 94
#define VEL 200
81
#define ON_DELAY 500
82
#define OFF_DELAY 800
95
#define ON_DELAY 150
96
#define OFF_DELAY 400
83 97

  
84 98
void test_encoder_all (void)
85 99
{

Also available in: Unified diff