2 / 2 6 / 2 0 0 2 2 : 0 6 P M 2 / 2 6 / 2 0 0 2
1 3 9
N M I L - 7 0 5 6 S E R V O M O T O R D R I V E R
C S A M P L E P R O G R A M
l_veloc()
{
int
data_in;
commnd = LTRJ; send_cmd();
trajec2 = 0x18; trajec1 = 0x28;
dbyte2 = trajec2; dbyte1 = trajec1; send_word();
printf("\nEnter a Velocity value (0-65535): ");
scanf("%d", &data_in);
veloc4 = data_in / 256; veloc3 = data_in % 256;
veloc2 = 0x00; veloc1 = 0x00;
accel4 = 0x00; accel3 = 0x05; accel2 = 0x00; accel1 = 0x00;
dbyte2 = accel4; dbyte1 = accel3; send_word();
dbyte2 = accel2; dbyte1 = accel1; send_word();
dbyte2 = veloc4; dbyte1 = veloc3; send_word();
dbyte2 = veloc2; dbyte1 = veloc1; send_word();
commnd = STT; send_cmd();
}
/* end left velocity move */
load_filter()
{
commnd = LFIL; send_cmd();
/* send filter control word */
dbyte2 = filter2; dbyte1 = filter1; send_word();
/* send new filter settings */
dbyte2 = kp2; dbyte1 = kp1; send_word();
dbyte2 = ki2; dbyte1 = ki1; send_word();
dbyte2 = kd2; dbyte1 = kd1; send_word();
dbyte2 = il2; dbyte1 = il1; send_word();
commnd = UDF; send_cmd();
/* activate new settings */
}
/* end load filter */
load_traj()
{
commnd = LTRJ; send_cmd();
/* send trajectory control word */
dbyte2 = trajec2; dbyte1 = trajec1; send_word();
/* send new trajectory settings */
dbyte2 = accel4; dbyte1 = accel3; send_word();
dbyte2 = accel2; dbyte1 = accel1; send_word();
dbyte2 = veloc4; dbyte1 = veloc3; send_word();
dbyte2 = veloc2; dbyte1 = veloc1; send_word();
dbyte2 = posit4; dbyte1 = posit3; send_word();
dbyte2 = posit2; dbyte1 = posit1; send_word();
commnd = STT; send_cmd();
}
/* end load trajectory */
menu()
{
printf("\n 0 Absolute Move");
printf("\n 1 Load Trajectory");
printf("\n 2 Relative Move");
printf("\n 3 Left Velocity Move");
printf("\n 4 Right Velocity Move");
printf("\n 5 Jog Left");
printf("\n 6 Jog Right");
printf("\n 7 Load Filter Parameters");
printf("\n 8 Motor Power Off");
printf("\n 9 Display current setup values");
printf("\n\n Enter the number of your choice: ");
}
/* end menu */
Summary of Contents for NMIY-0031
Page 1: ...2 2 6 2 0 0 2 2 0 6 P M 1 NMIY 0031 Single Board Computer Covers NMIY 0031 V1 0 4 22 96 ...
Page 2: ...2 2 6 2 0 0 2 2 0 6 P M 2 ...
Page 6: ...2 2 6 2 0 0 2 2 0 6 P M 6 ...
Page 8: ...2 2 6 2 0 0 2 2 0 6 P M 8 ...
Page 14: ...2 2 6 2 0 0 2 2 0 6 P M 1 4 ...
Page 30: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 3 0 ...
Page 32: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 3 2 ...
Page 50: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 0 ...
Page 52: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 2 ...
Page 54: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 4 ...
Page 56: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 6 ...
Page 58: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 5 8 ...
Page 60: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 0 ...
Page 62: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 2 ...
Page 68: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 6 8 ...
Page 70: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 0 ...
Page 72: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 2 ...
Page 76: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 7 6 ...
Page 82: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 2 ...
Page 84: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 4 ...
Page 86: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 6 ...
Page 88: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 8 8 ...
Page 90: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 9 0 ...
Page 102: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 0 2 ...
Page 108: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 0 8 ...
Page 110: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 0 ...
Page 114: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 4 ...
Page 118: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 1 8 ...
Page 126: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 2 6 ...
Page 128: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 2 8 ...
Page 134: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 3 4 ...
Page 148: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 4 8 ...
Page 150: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 0 ...
Page 152: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 2 ...
Page 154: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 4 ...
Page 156: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 5 6 ...
Page 168: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 6 8 ...
Page 170: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 0 ...
Page 172: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 2 ...
Page 174: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 4 ...
Page 178: ...2 2 6 2 0 0 2 2 0 6 P M 2 2 6 2 0 0 2 1 7 8 ...