Using simulink to drive jrk21v3

Hi all,
I want to drive the jrk21v3 with simulink.
Simulink has the function to send the serial out and I set the COM with “pololu 21v3 command port”.
I sent a array: 0xAA, 0x0B, 0x61, 0x7F at the same time to this COM.
I saw the LED flashing frequently but there is no response to my motor.
Is my set up wrong or the command I sent wrong?
Thanks
Austin

Hello, Austin.

That command looks fine. Does the jrk work when you try to control the motor with the jrk configuration utility? If not, can you post any errors you get?

Can you also post your jrk settings file? (To generate the file, you can open the Pololu Jrk Configuration Utility and click File > Save settings file.)

-Jon

Hi Joe
There is only one single usb wire to the jrk21v3 from my pc. Using jrk configuration utility works fine.
I use the serial function of the simulink and pass 0xAA, 0x0B, 0x61, 0x7F to the COM port:21v3 command port
It still doesn’t work.
I have a question:
since I use only one wire to drive the jrk21v3, do I need to send two bytes command instead of four bytes?
Here is my motor setting:
//---------------
INITIALIZED 0
INPUT_MODE ANALOG
INPUT_MINIMUM 0
INPUT_MAXIMUM 4095
OUTPUT_MINIMUM 0
OUTPUT_NEUTRAL 2048
OUTPUT_MAXIMUM 4095
INPUT_INVERT 0
INPUT_SCALING_DEGREE 0
INPUT_POWER_WITH_AUX 0
INPUT_ANALOG_SAMPLES_EXPONENT 5
INPUT_DISCONNECT_MINIMUM 44
INPUT_DISCONNECT_MAXIMUM 4093
INPUT_NEUTRAL_MAXIMUM 2048
INPUT_NEUTRAL_MINIMUM 2048
SERIAL_MODE USB_DUAL_PORT
SERIAL_FIXED_BAUD_RATE 9600
SERIAL_TIMEOUT 0
SERIAL_ENABLE_CRC 0
SERIAL_NEVER_SUSPEND 0
SERIAL_DEVICE_NUMBER 11
FEEDBACK_MODE NONE
FEEDBACK_MINIMUM 0
FEEDBACK_MAXIMUM 4095
FEEDBACK_INVERT 0
FEEDBACK_POWER_WITH_AUX 0
FEEDBACK_DEAD_ZONE 0
FEEDBACK_ANALOG_SAMPLES_EXPONENT 5
FEEDBACK_DISCONNECT_MINIMUM 0
FEEDBACK_DISCONNECT_MAXIMUM 4095
PROPORTIONAL_MULTIPLIER 0
PROPORTIONAL_EXPONENT 0
INTEGRAL_MULTIPLIER 0
INTEGRAL_EXPONENT 0
DERIVATIVE_MULTIPLIER 0
DERIVATIVE_EXPONENT 0
PID_PERIOD 10
PID_INTEGRAL_LIMIT 1000
PID_RESET_INTEGRAL 0
MOTOR_PWM_FREQUENCY 1
MOTOR_INVERT 0
MOTOR_MAX_DUTY_CYCLE_WHILE_FEEDBACK_OUT_OF_RANGE 200
MOTOR_MAX_ACCELERATION_FORWARD 600
MOTOR_MAX_ACCELERATION_REVERSE 600
MOTOR_MAX_DUTY_CYCLE_FORWARD 0
MOTOR_MAX_DUTY_CYCLE_REVERSE 600
MOTOR_MAX_CURRENT_FORWARD 0
MOTOR_MAX_CURRENT_REVERSE 0
MOTOR_CURRENT_CALIBRATION_FORWARD 37
MOTOR_CURRENT_CALIBRATION_REVERSE 37
MOTOR_BRAKE_DURATION_FORWARD 0
MOTOR_BRAKE_DURATION_REVERSE 0
MOTOR_COAST_WHEN_OFF 0
ERROR_ENABLE 70
ERROR_LATCH 70
Thanks
Austin

It looks like your jrk’s input mode is set to “Analog voltage”. To communicate over serial, the Input mode should be set to “Serial”. Can you try changing this and see what happens?

I am not sure I understand what you mean by “send two bytes command instead of four bytes”. You should only need to connect a single USB cable to your jrk motor controller.

-Jon

Thank you.It works!
Yes, I sent 4 bytes with single usb cable.
Right now, I can command the motor from simulink interface.
Thank a again
Austin