Use the following template to help create your post:
-
I am using DYNAMIXEL AX-18A & U2D2 & RPI 4
-
MATLAB & MATLAB Simulink
-
Wirless connect with RPI - MATLAB / USB connect with RPI - U2D2 / 3pin cable connect with U2D2 - AX-18A(1.0)
-
Hello, guys
I want to control my AX-18A(1.0) without dynamixel sdk library.
Here is current code.
mypi = raspi(‘192.168.0.13’,‘pi’,‘11111111’);
ser = serialdev(mypi,‘/dev/ttyUSB0’,115200);
% DYNAMIXEL AX-18A 모터 ID 설정
motorID = 3; % 사용하는 모터의 ID로 변경해야 합니다.
% LED 상태 (0x00: 끈 상태, 0x01: 켠 상태)
LEDStatus = 0;
% LED 상태 변경 명령 생성
command = [255, 255, motorID, 4, 3, 25, LEDStatus, 0];
checksum = calculateChecksum(command);
command(end) = checksum;
for i=0:10
% 명령 전송
if rem(i,2) == 0
LEDStatus = 0;
else
LEDStatus = 1;
end
disp(i);
disp(LEDStatus)
pause(1); % 1초 대기
write(ser, command);
end
% 명령의 체크섬 계산 함수
function checksum = calculateChecksum(packet)
checksum = bitcmp(sum(packet(3:end-1)), ‘uint8’);
end
=====================================
This code is just the code that makes the LED behind the AX-18A blink. but not work.
I think that ‘command = [255, 255, motorID, 4, 3, 25, LEDStatus, 0];’ is wrong.
First, so I already check by ‘RoboPlus’ turn on/off LED.
and, RPI - USB port - U2D2 - AX-18A are maybe connect by that code because U2D2’s RX&TX LED are blinking.
Anyway, I want to make some code without any library for DYNAMIXEL.
I want to control just using command packet or some array.
I check the e-manual, and I also check the LED address (25).
Please tell me anyting about that.
If I solve LED blink, next step is position, speed etc… control.
thanks alot.