SmallFish-Dev MDD Controller V2.2

 


Features:

Power and Jumpers:

Servo Controlling:

Set Servo Status Command Format:

Query Servo Status Command Format:

About asynchronous moving:

Motor Controlling:

DC Motor:

Set DC Motor Status Command Format:

Query DC Motor Status Command Format:

Stepping Motor:

Set Stepping Motor Status Command Format:

Query Stepping Motor Status Command Format:

Input Analog Voltage Digital Converting:

Query Input Voltage Command Format:

RS232 or TTL UART Signal:

LED Indicator:

Power Jumper:

UART Commands Format:

Set Servo Status Command Format:

Query Servo Status Command Format:

Set DC Motor Status Command Format:

Query DC Motor Status Command Format:

Set Stepping Motor Status Command Format:

Query Stepping Motor Status Command Format:

Query Input Analog Command Format:

Query Firmware Version:

Contact Information:

Software Download:


Features:

 

MCU Atmel Mega16 running at 16MHz.

Support 32 channel servos with asynchronous moving at 1us accuracy.

Support either 2 pairs of 2 channels (total 4 channels) DC motors or 2 channels of stepping motor.

Support 8 channels analog input voltage to digital converting.

Communicate via R232 or TTL UART signal.

One LED indicator.

PCB size mm x mm x mm and Outer size mm x mm x mm

Picture 1. SmallFish-Dev MDD Controller V2.2


Power and Jumpers:

 

The board power input voltage is between 7V – 12V.

Servos input voltage is up to 16V.

DC motor/Stepping motor input voltage up to 36V and total current up to 4A.

Pictures below give the positions of power input/output and position of jumpers.

Picture 2. Interface


Servo Controlling:

 

Support up to 32 channels servos with asynchronous moving at 1us accuracy.

Servos input voltage is up to 16V.

Set Servo Status Command Format:

“#[Channel number: (0~31)]P[Absolute Position: (500~2500)]S[Speed: (1~9999)]\n”

“#[Channel number: (0~31)]P[Absolute Position: (500~2500)]T[Time: (10~5000)]\n”

“#[Channel number: (0~31)][Offset: (+/-)][Offset Position: (0~2500)]S[Speed: (1~9999)]\n”

“#[Channel number: (0~31)][Offset: (+/-)][Offset Position: (0~2500)]T[Time: (10~5000)]\n”

“#[Channel number: (0~31)][OnOff: (H/L)]\n”

 

[Channel number: (0~31)]:

The value is corresponded to servo channel 0~31.

0 -> channel 0

31-> channel 31

 

[Absolute Position: (500~2500)]

The value is corresponded to servo position.

500-> position at 500us

2500-> position at 2500us

 

[Speed: (1~9999)]

The value indicates changing speed of position per second.

1-> position change 1us per second

9999-> position change 9999us per second

 

[Time: (10~5000)]

The value indicates how many time (ms) used on moving to target position.

10 -> 10ms

5000-> 5000ms

 

[Offset: (+/-)]

It indicates servo will move to higher or lower position.

+ -> move to higher us position

- -> move to lower us position

 

[Offset Position: (0~2500)]

The value indicates the target offset position.

0 -> there will be no moving happen

1 -> 1us difference

2500 -> 2500us difference

 

[OnOff: (H/L)]

It switch channel on or off.

H -> channel on

L -> channel off

 

 

For example, let channel 4 moves to position 2300us immediately, let channel 6 moves to 600us at speed 600us/S, let channel 11 moves to position 1800us in 2000ms, let channel 21 move to offset +500us immediately, let channel 24 moves to offset -1000 us at speed 500us/S, let channel 27 moves to offset +1000us in 800ms, switch channel 28 off.

“#4P2300#6P600S600#11P1800T2000#21+500#24-1000S500#27+1000T800#28L\n”

Query Servo Status Command Format:

“Q#[channel number: (0-31)]\n”

[Channel number: (0~31)]:

The value is corresponded to servo channel 0~31.

0 -> channel 0

31-> channel 31

 

For example, to query channel 4, 6,11,21,24 and 27:

“Q#4#6#11#21#24#27\n”

 

Return command is same format as “Set Servo Status”.

For example, “#4P2300#6P600#11P2000#21P500#24P1000#27P700#28P800L\n”

It means channel 4 comes to 2300us position, channel 6 come to 600us position, channel 11 come to 2000us position that means channel 11 is still on the way to the target position 1800us, channel 21 come to 500us position, channel 27 come to 700 position and channel 28 is off and position is 800us.

About asynchronous moving:

The board support servos’ asynchronous moving.

Each servo channel moves individually and execute instruction without disturb other servos.

User can send next command to board before it finish previous command.

If two instructions have no conflict channel, servos work separately. If two instructions have conflict channel, the conflict channel will stop previous instruction and execute the latest instruction immediately.

For example, commands are send as sequence below:

Sent command at 1s: “#5P500#6P500#7P500#8P500\n”

Sent command at 2s: “Q#5#6#7\n”

Return command: “#5P500#6P500#7P500#8P500\n”. It means channel 5, 6, 7 and 8 have come to the target positions.

Sent command at 3s: “#5+1000T2000#6+1000T3000#7+1000T4000\n”

Sent command at 5s: “Q#5#6#7\n”

Return command: “#5P1500#6P1200#7P770\n”. It means channel 5 have come to target position, channel 6 come to 1200us that is still on the way to 1500us and channel 7 come to 770us that is still on the way to 1500us.

Send command at 5s: “#6P500T2000#8P1500T2000\n”

Now, channel 7 will keep moving to target position 1500us, channel 6 starts to move to 500us position and will arrive the target position in 2000ms, channel 8 starts to move to 1500us and will arrive the target position in 2000ms.

Sent command at 7s: “Q#5#6#7\n”

Return command: “#5P1500#6P500#7P1500#8P1500\n”. It means channel 5, 6, 7 and 8 have arrived the target positions.

 


Motor Controlling:

 

DC motor/Stepping motor input voltage up to 36V and total current up to 4A(each group 2A).

The board controls either DC motors or Stepping motors.

The controlling mode will be auto switched depending on controlling command.

DC Motor:

The board supports DC motor input voltage up to 36v and currency total current up to 4A (each group up-to 2A).

The board supports 2 pairs of 2 channels (total 4 channels) DC motors with 65 stages of speed.

The two pairs of motors are pair A: {A0+/A0- | A1+/A1-} and pair B: {B0+/B0- | B1+/B1-}.

[A0+/A0-] for motor 0, [B0+/B0-] for motor 1, [A1+/A1-] for motor 2, [B1+/B1-] for motor 3.

 

||Caution||

Even set four DC motors while same speed value, the output voltages in A0, B0, A1, B1 are different. Speed calibration between motors is suggested to be done. A0/B0 or A1/B1 up-to 2A.

SetDC Motor Status Command Format::

“$[Motor number: (0-3)]D[Direction: ( 0 – 2) ]P[Speed: (0 - 16)]T[Time:(0-9999)]\n”

 

[Motor number: (0-3)]:

0 -> A0+/A0-

1 -> B0+/B0-

2 -> A1+/A1-

3 -> B1+/B1-

 

[Direction: ( 0 – 2) ]:

0 -> forward

1 -> backward

2 -> brake

 

 

 

[Speed: (0 - 64)]:

0 -> stop

32-> half speed

64 -> full speed

 

[Time: (0 - 9999)]:

0 -> Stop

....

1000 --> 1 loops

....

9999 --> Keep Going

After T cycles, DC motor will stop moving.

 

For example, set motor 0 and motor 2 forward at speed 8 with 500 cycles,

“$0D0P8$2D0P8T500\n”

 

Set motor 0 and motor 1 backward at speed 12, and set motor 2 and motor 3 forward at speed 15 and time with 100 cycles,

“$0D1P12$1D1P12$2D0P15$3D0P15T100\n”

 

Set the motors brake:

“$0D2$1D2$2D2$3D2\n”

QueryDC Motor Status Command Format:

“Q$[Motor number (0-3)]\n”

[Motor number: (0-3)]:

0 -> A0+/A0-

1 -> B0+/B0-

2 -> A1+/A1-

3 -> B1+/B1-

 

For example to query DC motor 0, 1, 2 and3’s status:

“Q$0$1$2$3\n”

 

Return command is same format as “SetDC motor status”.

For example: “$0D1P12$1D1P12$2D0P15$3D0P15T70\n”. It means motor 0 and motor 1 is moving backward at speed 12, motor 2 and motor 3 is moving forward at speed 15 with 70 loops left.

 

Stepping Motor:

 

The board supports stepping motor input voltage up to 36v and each motor up-to 2A. Two motors total up to 4A.

The board supports two channels of stepping motor with 3 moving modes.

The moving modes are:

Half-step working at command starts with “%”.

Full-step single-phase working at command starts with “^”.

Full-step two-phase working at command starts with “&”.

Two motors have to move as same mode.

Each time change moving mode, two motors will come to a reset position.

[A0+/A0- | B0+/B0-] is for motor 0 and [A1+/A1- | B1+/B1-] is for motor 1.

 

Set Stepping Motor Status Command Format:

“[Moving mode][Motor number: (0-1)]D[Direction: ( 0 – 2) ]S[Speed: (0 - 999)]P[Step number: (0 - 9999)]\n”

 

[Moving mode]:

“%” -> Half-step

“^” -> Full-step single-phase

“&” -> Full-step two-phase

 

[Motor number: (0-1)]:

0-> motor 0 [A0+/A0- | B0+/B0-]

1-> motor 1 [A1+/A1- | B1+/B1-]

 

[Direction: ( 0 – 2) ]:

0 -> forward

1 -> backward

2 -> brake

 

[Speed: (0 - 999)]:

The value indicate motor move to next step in how many pulses. Lower value means higher speed.

Current pulse frequency is 1kHz.

The number value can not be out of motor limitation. If the number is too small for motor, motor will be shaking without moving. The moving speed can not over motor capability.

 

0 -> one step every 1 pulse.

9 -> one step every 10 pulses,

999 -> one step every 1000 pulses.

 

[Step number: (0 - 9999)]:

It indicates the number of steps motor is going to take. After that, motor will stop.

Value 9999 will make motor keeping moving.

0 -> motor will stop immediately.

1 -> change 1 step, motor will stop after that 1 step.

1000 -> change 1000 steps, motor will stop after 1000 steps.

9998 -> change 9998 steps, motor will stop after 9998 steps.

9999 -> keep moving without stop

 

For example, let motors moving as Half-step mode, motor 0 forward 1000 steps at speed 80, motor 1 backward 2000 steps at speed 40.

“%0D0S80P1000%1D1S40P2000\n”

 

Let motors moving as Full-step single-phase mode, motor 0 keep moving forward at speed 100, motor 1 keep moving backward at speed 100.

“^0D0S100P9999^1D1S100P9999\n”

 

Let motors moving as Full-step two-phase, motor 0 keep moving forward at speed 100, motor 1 keep moving backward at speed 100.

“&0D0S100P9999&1D1S100P9999\n”

 

In Full-step two-phase mode, set motors brake.

“&0D2&1D2\n”

Query Stepping Motor Status Command Format:

“Q%[Motor number (0-1)]\n”

 

[Motor number: (0-1)]:

0-> motor 0 [A0+/A0- | B0+/B0-]

1-> motor 1 [A1+/A1- | B1+/B1-]

 

For example, to query stepping motor 0’s current status:

“Q%0\n”

Return command is same format as “Set Stepping Motor Status”.

For example, “&0D0S100P9999\n”, It means motor moving mode is Full-step two-phase, motor 0 is moving forward at speed 100 and keep moving.

Return command “^0 D0S100P100\n” means motor moving mode is Full-step single-phase, motor 0 is moving forward at speed 100 and will stop after 100 steps.

Return command “^0 D0S100P0\n” means motor moving mode is Full-step single-phase, motor 0 is moving forward at speed 100 and it already finished its steps and stopped.

 

 


Input Analog Voltage Digital Converting:

 

There are eight channels of ADC.

It measures voltage between (0V-5V). The return value is between 0 and 255.

If input voltage is lower than 0V, return value will be 0.

If input voltage is higher than 5V, return value will be 255.

Other output value can be calculated as x/255*5V.

||Caution||

While the jumper disconnected, the output value is invalid. It suggests short the unused jumpers. The final return voltage value may not be very accurate. Calibration is suggested to be done.

 

Query Input Voltage Command Format:

“QV[Channel number: (0 – 8)]\n”

 

[Channel number: (0 – 8)]:

0 -> channel 0

7 -> channel 7

 

For example, query channel 0 and channel 4’s input voltage:

“QV0V4\n”

Return command “V0P16V4P88\n” means the channel 0’s input voltage is 16/255*5V, channel 4’s input voltage is 88/255*5V.


RS232 or TTL UART Signal:

 

MCU communicate with external device via RS232 or TTL UART signal.

DB9 is the interface for RS232 UART signal.

Jumper pins is the interface for TTL UART signal.

There are four baud rates supported. They are 4800, 9600, 19200 and 38400.

 

Picture 3. UART rate 4800.

Picture 4. UART rate 9600

Picture 5. UART rate 19200

Picture 6. UART rate 38400

 

 


LED Indicator:

 

There is one LED indicator on board.

When controller received any UART command, LED will flash quickly for ten times. After that, if there is no UART command come in, LED will on and off for every 2 seconds.


Power Jumper:

 

There is one Power Jumper on board. This jumper provide interface for user to add own power switch.

 


UART Commands Format:

 

While board power up it will send out “SmallFish-Dev” via RS232 or TTL to external device.

In working status, it supports Servo Controlling, DC Motor/Stepping Motor Controlling and Query.

The details of command format are explained in earlier, user can refer to those chapters.

Set Servo Status Command Format:

“#[Channel number: (0~31)]P[Absolute Position: (500~2500)]S[Speed: (1~9999)]\n”

“#[Channel number: (0~31)]P[Absolute Position: (500~2500)]T[Time: (10~5000)]\n”

“#[Channel number: (0~31)][Offset: (+/-)][Offset Position: (0~2500)]S[Speed: (1~9999)]\n”

“#[Channel number: (0~31)][Offset: (+/-)][Offset Position: (0~2500)]T[Time: (10~5000)]\n”

“#[Channel number: (0~31)][OnOff: (H/L)]\n”

 

For example, let channel 4 moves to position 2300us immediately, let channel 6 moves to 600us at speed 600us/S, let channel 11 moves to position 1800us in 2000ms, let channel 21 move to offset +500us immediately, let channel 24 moves to offset -1000 us at speed 500us/S, let channel 27 moves to offset +1000us in 800ms, switch channel 28 off.

“#4P2300#6P600S600#11P1800T2000#21+500#24-1000S500#27+1000T800#28L\n”

Query Servo Status Command Format:

“Q#[channel number: (0-31)]\n”

 

For example, to query channel 4, 6,11,21,24 and 27:

“Q#4#6#11#21#24#27\n”

SetDC Motor Status Command Format:

“$[Motor number: (0-3)]D[Direction: ( 0 – 2) ]P[Speed: (0 - 16)]T[Time:(0-9999)]\n”

 

For example, to let motor 0 and motor 1 move backward at speed 12, and motor 2 and motor 3 move forward at speed 15 with 100 cycles,

“$0D1P12$1D1P12$2D0P15$3D0P15T100\n”

QueryDC Motor Status Command Format:

“Q$[Motor number (0-3)]\n”

 

For example, query DC motor 0,1,2 and3’s current status:

“Q$0$1$2$3\n”

Set Stepping Motor Status Command Format:

“[Moving mode][Motor number: (0-1)]D[Direction: ( 0 – 2) ]S[Speed: (0 - 999)]P[Step number: (0 - 9999)]\n”

 

For example, let motors moving as Half-step mode, motor 0 move forward 1000 steps at speed 80, motor 1 move backward 2000 steps at speed 40.

“%0D0S80P1000%1D1S40P2000\n”

Query Stepping Motor Status Command Format:

“Q%[Motor number (0-1)]\n”

 

For example, query stepping motor 0’s current status:

“Q%0\n”

Query Input Analog Command Format:

“QV[Channel number: (0 – 8)]\n”

 

For example, query channel 0 and channel 4’s input voltage:

“QV0V4\n”

Query Firmware Version:

“Q:\n”


Contact Information:

 

Seller On www.taobao.com:

WangWang ID: hao_de_hen

WangWang ID: dl_tonald

 

Technical Support: Tonald DL

Website: http://www.SmallFish-Dev.com

 

Software Download:

The English PDF version can be downladed here.

The Chinese PDF version can be downloaded here.

The PC side MDD Controller Mini Tester Console Application can be downloaded here.

Microsoft .NET Framework 3.5 is needed to run the SFMDDConsole.exe.