Introduction
Veyron serial Motor Driver is the latest intelligent motor driver devices produced by DFRobot,including Brush DC motor driver,Brushless DC Motor Driver and stepper motor drives. The Veyron 2x25A is Brush DC motor driver which contains intelligent interface mode:Analog,PPM as well as UART(TTL) interfaces; Under-voltage,over-voltage,under-current,over-current,over-heating,shorted, reverse voltage protection; Easy to use: Interface choose with one button, open/closed loop system auto recognition, PID parameter self-tuning, etc. It simplify the manufacture to the user.
Serial port here means Arduino Serial which only accept TTL data instead of RS232/RS485. To use the Serial communication feature, you need to have an Arduino card or a FTDI adapetr.
Electrical specification
- Input voltage range : DC 6~36V, limit voltage is 40V
- Use nickel - hydride or nickel - cadmium battery : 5 - 30 BTs(batteries)
- Use lithium polymer battery : 2 - 8 BTs
- Single maximum permissible continuous current : 25A(2x25A)/12A(2x12A)
- Single channel the maximum allowable: 30A(2x25A)/20(2x12A)
Power terminal definition
- M1A: motor1 wire a
- M1B: motor1 wire b
- B+: external DC power input +
- B-: external DC power input-
- M2A: motor2 wire a
- M2B: motor2 wire b
Encoder terminal definition
on the same side as MxA/MxB of the encoder terminals is Mx motor encoder interface
- A: encoder A-phase pulse signal input
- B: encoder B-phase pulse signal input
- GND: driver’s logical ground
- VCC: driver’s DC-5V power output
- Communication terminal definitions
- GND: driver’s logical groundv
- 5 V: driver’s DC-5V/1A power outputv
- S1:
In Analog interface mode,is the M1 analog voltage input In PPM interface mode ,is the M1 PWM signal input In UART interface mode, is the drive Rx
- S2:
In Analog interface mode ,is the M2 analog voltage input In PPM interface mode ,is the M2 input signal pulse width In UART interface mode, is the drive Tx
Radiator fan terminal definitions
Radiator fan contains 2 PIN, they are 5V power output and driver’s controllable connected logical ground. Cooling fan can be directly connected to 5V ( max current 500mA ), or high-power fun controlindicator through Relay.
Indicator definitions
- Reverse: reverse power protection indicator (red)
- Set: set the mode indicator (green)
- Analog: analog mode indicator (green)
- PPM: PWM mode indicator (green)
- UART:UART mode indicator (green)
- Status1: (yellow)
- In PPM and Analog mode, the brightness of the indicator indicate the speed of M1
- In UART mode, the indicator is On when the drive receive data , Off when not
- Status2: (yellow)
- In PPM and Analog mode, the brightness of the indicator indicate the speed of M2
- In UART mode, the indicator is On when the drive receive data , Off when not
- Error: fault indicator (red), not only indicate the fault, discussed as follow in the application specific analysis
KEY button description
Drive mode can be adjusted by pressing the key, choosing between Set, Analog, PPM, UART( four modes ), the lighting LED indicates corresponding operating mode. In the process of Mode switch ,the drive will reset to new mode only if the internal saved mode doesn’t match the current mode .
Interface type
- Analog (two-channel analog voltage signal input): voltage range 0-5V (usually connected with an external potentiometer, if possible , it is recommended that user could add a voltage follower at teh analog voltage output ; or use the PWM+ filter circuit for voltage output).
- PPM (two PWM signal input): signal sources can be generated directly by a model remote control receiver , or using what generated by the single-chip microcomputer itself.
- UART: supports 10 commonly used baud rate, compatible with both 3.3V and 5V systems.
Control mode
- Open-loop speed control mode: this mode applies to motor control without encoder, motor speed is based on qualitative control .
- Closed-loop speed control mode: this mode applies to the encoder motor control, by setting the UART interface encoder and reducer parameters to achieve closed-loop speed control.
Protection function
- In UART interface mode, the original fault source can be got through the "GER" instruction, please refer to the drive's instruction set. In PPM and Analog interface mode, the original fault source can be checked through the combination of Set, Analog, PPM, UART led, as shown in the following table (Note: any kind of failure occurs, the motor will stop working, enter fault mode, in which case the user will not be able to control the motor. In UART interface mode, through the "CER" , clear all fault information directive to return to normal mode, in PPM and Analog mode , only by resetting the drive to eliminate the fault information):
Set | Analog | PPM | UART | Error | BaudRate(bps) |
---|---|---|---|---|---|
style="background: green" | |||||
style="background: green" | |||||
style="background: green" | |||||
style="background: green" | |||||
style="background: green" | |||||
style="background: green" | |||||
style="background: green" | |||||
38400 | |||||
57600 | |||||
115200 |
- Reverse power protection, when power is reversal connected, power supply reverse polarity indicator light up(Reverse), indicating source of failure.
- Undervoltage and overvoltage protection for Settable threshold, if the input voltage exceeds the set range, the fault led (Error) is on, the drive goes into fault mode.
- Settable the maximum permissible continuous current protection. Actual current is greater than the maximum permissible continuous current, and less than the maximum permissible peak current, allowing for 2s, if more than 2s, fault led (Error) is on, the drive will go into fault mode.
- Settable the maximum permissible peak current protection. Actual current is greater than the maximum permissible peak current, allowing for 400ms, if over 400ms, fault led (Error) is on, the drive goes into fault mode.
- Settable the maximum allowable temperature protection. Monitor drive’s temperature, if it was less than the limit temperature when temperature is above 40 ℃, the drive automatically output 5V power to thermal interface until the temperature dropped below 35 ℃. When the internal temperature exceeds the set limit temperature, fault led (Error) is on, the drive goes into fault mode.
- In PPM and UART mode, through the "SSM" directive, setting the control signal mode,to set the drive in discontinuous mode, if within the specified time without a valid control signal, fault led (Error) is on, the drive will go into fault mode.
Drive can run in one-way or two-way control mode. In single direction control mode, through "SSD" ,the 0-signal detection instruction,to start zero signal detection of the drive, after restarting the drive, if the original signal is not zero (that is, zero speed signal), the drive will stop,it cannot enter into normal mode until the control signal turns into zero.
How To Use
Here, some examples are showed for users to start to use the Veyron 2*25A step by step. You can do more than this with checking the 3rd part: Directive.
In Analog Mode
It is the easiest way to run the motor in Analog Mode. Even you haven't connect the analog signal to Veyron, the motor could run once you set the Veyron in Analog Mode, actually, it regard this situation as input votage signal as 0V.And if need to control the speed, the only step needed to do is to connect a 0-5V analog signal to S1/S2 as controlling signal, the speed is adjusted according to the absolute value of input Voltage, and it would stop if the valtage is 2.5V.
If you need to set some paramenters to contorl the motor more precisely, you could do as follow.
1). Preparation
- 6-36V External DC Power Supply x 1
- 0-5V voltage signal x 1
- Bluno Nano x 1 other type is ok as long as it contains serial port(TX/RX)
- 12V DC geared motor with Ecoder x 1
- Veyron 2x25A Brush DC Motor Driver x 1
- screw driver x 1
- Jumper wire/ Dupont Line x some
- USB cable x 1
2). Wiring
Wire up all devices as follow picture.
NOTE:The Arrow in the picture(Bluno nano) is available when you need to set some paramenters, but when you need to control the motors(M1/M2), the S1/S2 interfaces are for the signal input.
3). Auto-Set PID in SET mode
On Veyron, there is a button named KEY.Use something to press it, so you can switch the working mode from UART to SET Mode. After that, Veyron will set PID paramenters automatically.If you want to set the PID paramenters by yourself, you can set them with Instructions in UART mode.
4). Set Other Paramenters
Power on, open Arduino IDE, choose the correspond "Board" and "Serial Port", then open the Serial Monitor and set Newline/ Both NL&CR and 57600 bps.
Send “1,RCONFIG”,all the paramenters about Veyron will display in the window in a seconds.If not, please check all the steps.(you could try to exchange the sequence of TX/RX)
Send “1,SER,13,1”,to set the Ecoder Resolution of M1/M2 as 13/1; Send “1,SGR,51.00,1.00”,to set the Gear Ratio of M1/M2 as 51.00 and 1.00; Send “1,RCONFIG” again, to confirm the modified paramenters.
5). Run in Analog mode
Connect the 0-5V control signal to interface S1, and go into Analog Mode.The motor will run according to the input signal.
The relationship between speed and voltage:
- 0-2.5V: co-rotating
- 2.5V: stop
- 2.5V-5V: reverse
In PPM Mode
PPM interface, a very important parameter is PPM extreme, there are two species way to set it.First, send instruction through UART interface; second, it is in Set set mode, while led Status1 and Status2 flashing, user using remote control model put the corresponding bar in its extreme location respectively stays about 3 seconds, the drive will automatically recognize threshold value. In this process, if S1 and S2 have already hold right PWM input, Drive will calculate reliable limits according to the signals, if there is only one correct PWM input, then the drive will use this signal as an final limit values. Certainly, you can also send PWM signals of the two limit positions through AVR, regardless of which method you use, PPM limit value shall not exceed the scope 500us-2500us. Since the use of PPM interface, any other configuration parameters can be set directly apart from PPM extreme, if you do need to set up the relevant parameters, you must configure them using UART interface. All the fault messages, it should be checked with above 1.10 table in Protection. In addition, both in open-loop or closed-loop control mode, the relationship between PPM signal and motor speed are described as the figure below (Note: when the signal is below the minimum limit value or above the maximum limit value, the drive will not respond).
In this example, the PPM signal is created by a program, you could copy that from this passage below into Arduino IDE.
Note: If you need to set or read some parameters, please refer to the “In Analog Mode”.
Preparation
- 6-36V External DC Power Supply x 1
- Romeo V2 x 1 other type is OK as long as it contains serial port(TX1/RX1), if you do not have a Romeo, other Controller is OK with a step to modify the program: “ Serial1 ” to “ Serial ”
- 12V DC geared motor with Encoder x 1
- Veyron 2x25A Brush DC Motor Driver x 1
- screw driver x 1
- Jumper wire, DuPont Line some
- USB cable x 1
Wire Wire all devices up like in the picture below:
Auto-Set PID in SET mode
On Veyron, there is a button named KEY. Use something to press it, so you can switch the working mode into SET Mode. After that, wait for a while. Veyron will set PID parameters automatically.If you want to set the PID parameters by yourself, you can set them with Directives in UART mode.
Sample Code Open Arduino IDE, copy the code blow, then Upload it. (Note: Pin9 connected with S1). Press KEY to enter PPM mode. The motor will run in this way:
co-rotating for 5 seconds ---stop for 5 seconds---reverse running for 5 seconds.
It will loop this.Try to change some parameters to contorl the motor.
//Name: VEYRON 2x25A DC brush deceleration motor code in PPM Mode
//Version: v0.1;
//Author: Barry from DFrobot;
//modified by Leff
// This code can be used to control the brushless motor driver in the PPM Mode;
// Details in User manual;
// make sure the working mode on the driver are in PPM Mode;
<nowiki>#include <Servo.h> </nowiki>
Servo mymotor;
void setup()
{
mymotor.attach(9);
}
void loop()
{
mymotor.writeMicroseconds(2500); //motors rotating in clockwise direction with the highest speed;
delay(5000); //the motors running for 5 seconds.
mymotor.writeMicroseconds(1000); //motors stop;
delay(5000);
mymotor.writeMicroseconds(500); //motors rotating in counter-clockwise direction with the highest speed;
delay(5000);
}
In UART Mode
Here, in UART mode. There are two things you can do. First one is very useful: to set some parameters and read what’s inside of Veyron. Second, you could control the motor by a program in the interface. Ready? So, let’s get start.
Preparation
- 6-36V External DC Power Supply x 1
- Romeo V2 x 1 other type is OK as long as it contains serial port(TX1/RX1), if you do not have a Romeo, other Controller is OK with a step to modify the program: “ Serial1 ” to “ Serial ”
- 12V DC geared motor with Encoder x 1
- Veyron 2x25A Brush DC Motor Driver x 1
- screw driver x 1
- Jumper wire, DuPont Line some
- USB cable x 1
Wire Wire all devices up like in the picture below:
Download needed program Please go to Github, download the needed program, unzip the file-Zip and put them in the folder of Arduino IDE library. As showed below:
Then, open Arduino IDE, you could find the needed program.
Auto-Set PID in SET mode
On Veyron, there is a button named KEY. Use something to press it, so you can switch the working mode into SET Mode. After that, wait for a while. Veyron will set PID parameters automatically.If you want to set the PID parameters by yourself, you can set them with Directives in UART mode.
![Veyron_2x25A_drivertoset.jpg](https://dfimg.dfrobot.com/nobody/wiki/fb76a25f6e128999eb026a8e47ea3c46.jpg "Veyron_2x25A_drivertoset.jpg")
Check Serial connected
Once you power on, the indicator will light up, what dose it mean? Please take a look at “1.5 Indicator definitions” . Press the KEY to go into UART mode, then checking some basic info like”Serial Port”, “Board”(here, it’s Leonardo), “Baud rate”(57600).
Open the “C_CheckSerial”, and upload it to the Leonardo.
Then open the Port Window. If you receive the “BDC, Connection Good! ”, then you can go on. If not, check the wire or other steps.
Upload the “A_Configuration ” This step is to set some parameters ”encoder line” and ”gear ratio”, you can find them in the program.
Upload the“B_RunMotor” Once you upload the example, the motor will run in this way: co-rotating for 2 seconds ---stop for 2 seconds---reverse running for 2 seconds--- stop for 2 seconds. It will loop this.
Instruction
NOTE: How to send these commands to Veyron? Read on Forum. |
This version's instruction set system, a total of 44 instructions, does not distinguish between uppercase and lowercase, all instructions, whether were sent or returned, there will be "Enter + line feed (\r\n)" as a command terminator. All system parameters can be grouped into the Immediate variable parameter and non-immediate parameters, these parameters will be saved (EEPROM) when return in response to "read drive configuration parameters" command even if off power, the remaining parameters will lost (RAM).
- Immediate variable parameter is that user setting takes effect immediately (Note: need to perform "EEPSAV" to saves all present configuration parameters in order to ensure those will not lost if power off), including each motor’s acceleration/deceleration, PID parameters asynchronously and synchronous speed (Note: asynchronous and synchronous speed are in detail below).
- Non-Immediate variable parameter refers to what have set to be only saved in the EEPROM ,after the system was reset, it can take effect.
To allows user’s program easily interpreting the return directive package, overview the whole set of instructions throughout the drive, in addition to directives"RCONFIG"(read drive configuration parameter), all configuration parameters are read in the one-argument form. Follow passage will analyze each instruction meticulously start with the address1 of drive :
Query drive type (ID,PING\r\n) The type of Veyron motor drive series can be accessed through this command, such as: send the order to brush DC motor drive, returns "BDC\r\n".
- Send: 1,PING\r\n
- Return: BDC\r\n
Read the drive configuration parameters (ID,RCONFIG\r\n) Through this directive, will get all the configuration parameters of the drive, after you set the parameters, you can query parameters whether have been changed according to the requirements with this directive, if it has been changed, and it had to be saved in the EEPROM, it’s available to use "save all current configuration parameter" command mentioned bellow, then the parameters can be saved.
- Send: 1,RCONFIG\r\n
- Returns: (drive all configuration parameters)
Restore factory settings (ID,FCONFIG\r\n) All configuration parameters restore to factory settings with this command, drive will automatically reset once receiving the instruction and allow the configure to factory parameters.
- Send: 1,FCONFIG\r\n
- Returns: none
Query Help (ID,HELP\r\n) The instruction help you get the wiki address of DFRobot products, user can search the drive models on this page, then can get corresponding document.
- Send: 1,HELP\r\n
- Returns: (wiki addresses of the DFRobot products)
Save all the configuration parameters (ID,EEPSAV\r\n) By the instructions to save the current configuration parameters, before saving, it’s better to use the "read drive configuration parameter" command to confirm whether the current configuration parameters are setting values, drive will automatically reset once receiving the instruction and allow the configure to factory parameters.
- Send: 1,EEPSAV\r\n
- Returns: none
Set the baud rate (ID,SBR,******\r\n) This drive supports 10 commonly used baud rate, respectively, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200, the factory default value is 57600. For example, set the baud rate to 115200
- Send: 1,SBR,115200\r\n
- Returns: none
Set the drive addresses (ID,SNA,***\r\n) Drive’s range of addresses is 1~126, the factory default value is 1. When multiple drives running in parallel, two of the same bus address are not allowed. Different address drive, as receiving instructions from host at the same time, response only if the address is identical with itself, or 0 (broadcasts) . For example, the drive address is set to 8
- Send: 1,SNA,8\r\n
- Returns: none
Get the number of cumulative pulse encoder (ID,GEP,*\r\n) This command allows to gets the encoder's pulse numbers accumulated, the range is: -2147483648~2147483647, drive will quadruple the signal of encoder PWM if phase difference of 90 °, if the actual encoder has 200 lines, the drive will turn it into a 200x4=800 line through the internal hardware, so far the drive only supports incremental encoder. For example, to get the number of cumulative pulse encoder of M1
- Send: 1,GEP,1\r\n
- Returns: (actual accumulated pulse number, notice that there are positive and negative, symbols for
directions)
Reset encoder cumulative number of pulses (ID,CEP,*\r\n) The instruction specifies a way to reset encoder cumulative number of pulses to zero of one motor. For example, to reset encoder cumulative number of pulses to zero of M1
- Send: 1,CEP,1\r\n
- Returns: none
Set encoder line (ID,SER,****,####\r\n) By setting this directive, it can be applied to two motors (M1/M2) encoder line, note: when you set the encoder lines, both must be set, you cannot set a certain route alone. The factory default value is 1. For example,set M1 encoder line to 100, M2 to 200
- Send: 1,SER,100,200\r\n
- Returns: none
Set reduction ratio (ID,SGR,****,####\r\n) Two motors’ gearbox reduction ratio can be set with the instruction (M1/M2), actual controlling and output speed is the actual load speed. Users may set this to 1 to get the really true speed of motor. In addition, the drive supports decimal reduction ratio, accurate to 2 decimal digits. The factory default value is 1.
For example, to set the reduction ratio of the M1 to 12.34 and set reduction ratio of M2 to 23.45
- Send: 1,SGR,12.34,23.45
- Returns: none
Set direction mode (ID,SDIR,*\r\n) In most applications, the motor is sometimes required to run in clockwise, but sometimes counterclockwise, we call it as bidirectional control mode. However, in a number of engineering applications, it only rotates in one direction, we call it one-way control mode. In fact these modes are same in the UART interface, but in PPM and Analog mode is rather different, on the one hand it is prone to human manipulation errors, on the other hand the precision of the input signal is reduced by half. This drive can be easily set to one type of orientation mode: configuration parameter of 0 indicates a one-way mode, 1 indicates a two-way control mode. The configuration parameters are valid only in Analog mode and PPM, the factory default value is 1.
For example, direction of the drive mode is set to one-way mode
- Send: 1,SDIR,0\r\n
- Returns: none
Set the PWM signal generating method (ID,SPWM,*\r\n) There are two independent N-Mosfet full bridge driver circuits, Mosfet gate drive signals of most drives cannot be set by user, in order to meet the needs of some users, we set three modes which can be selected, corresponding relationship between PWM generation and configuration parameters are as follows: 0:Hpwm-Lon 1:Hpwm-Lpwm (on-off) 2:Hpwm-Lpwm (on-off-on, the factory default value) For example, Mosfet driver signal is set to Hpwm-Lpwm (on-off) (Note: the pattern is completely complementary mode)
- Send: 1,SPWM,1\r\n
- Returns: none
Set zero signal detection or not when start (ID,SSD,*\r\n) Only in the PPM or Analog interface mode, and the direction mode is one-way,the zero signal detection when start is available to set. For most of one-way control mode applications, there are more stringent security requirements, such as in PPM or Analog interface mode, because these modes without acceleration/deceleration feature are servo-controlled, System suddenly reset causes violent impact to load, when the motor holds dangerous loads, it will be a threat to personal safety. In this case, you can start the zero signal detection to enhance security. When system suddenly reset motor at rest, only after the control signals is near to stop before they can engage in normal controls. Configuration parameter of 0 indicates to disable the zero signal detection, of 1 means enable zero-signal detection, the factory default value is 0.
For example, to enable zero-signal detection
- Send: 1,SSD,1\r\n
- Returns: none
Gets the current rotation speed (ID,GVC,*\r\n) Note: in a closed-loop control mode, return speed value is the current output speed after deceleration, the unit is r/min; in open loop control mode, the return parameter is the quantification speed set last time. For example, to get the M1 's current speed
- Send: 1,GVC,1\r\n
- Returns: (current actual output speed)
Get the maximum rotation speed (ID,GVM,*\r\n) In closed-loop control mode, the maximum speed of the motor is detected automatically in SET mode after a deceleration maximum speed, the unit is r/min, when the user's configuration speed is higher than the value, the directive will not respond; in open loop control mode, the maximum speed for quantifying is fixed at 1000. Such as accessing to M1 of maximum speed
- Send: 1,GVM,1\r\n
- Returns: (the maximum speed of the motor, the road)
Set synchronous speed (ID,SVS,*,*****\r\n) Synchronous speed refers to the speed once you have set, the drive will immediately regulate motor speed according to the parameters, aware that synchronous speed should not exceed the maximum speed, otherwise the drive will not respond to this command. For example, to set the synchronous speed of the M1 to 100r/min
- Send: 1,SVS,1,100\r\n
- Returns: none
Set asynchronous speed (ID,SVR,*,*****\r\n) Synchronous speed refers to the speed once you have set, the drive will Not immediately regulate motor speed according to the parameters, only when it receives command-Perform asynchronous speed before it can take effect. If need simultaneous control of multiple motors, by setting asynchronous motor speed to each motor, and then sent by radio to perform asynchronous speed commands.
For example, to set the asynchronous rotational speed M1 to 100r/min
- Send: 1,SVR,1,100\r\n
- Returns: none
Perform asynchronous speed (ID,AVR,*,#\r\n) The directive should perform with "set asynchronous speed" instruction to realize strict synchronization of multiple motors. The two parameters which are not corresponding to the mentioned above corresponding to the M1,M2 (1, 2), both values can only be 0 or 1, 0 signifies that the motor is not performing an asynchronous speed, 1 indicates that the road to perform asynchronous speed. *- the parameter to M1,#- the parameter to M2. For example, performing asynchronous speed to M1, M2 does not perform asynchronous speed
- Send: 1,AVR,1,0\r\n
- Returns: none
Get Acceleration (ID,GACC,*\r\n) In a closed-loop control mode, acceleration is r/min/s; in open-loop mode, is a quantitative parameter, no matter the open-loop or closed-loop control, acceleration acts on motor speed. To this drive, when speed’s absolute value increased or the speed is in opposite direction, the absolute value of the rate of velocity changing is the acceleration values, but not like other regular drives which changes the absolute value of the rate of deceleration slowing to 0, then accelerate up to the value of target velocity when the direction changes. For example, to access to the M1 acceleration
- Send: 1,GACC,1\r\n
- Returns: (the motor acceleration)
Get reduced speed (ID,GDEC,*\r\n) In closed-loop control mode, the speed reduction unit is r/min/s; in open-loop mode, is a quantitative parameter, no matter the open-loop or closed-loop control, acceleration acts on motor speed. When the direction of the motor is consistent, and absolute value decline,the rate of change of velocity are deceleration values. For example, to get the deceleration value of M1
- Send: 1,GDEC,1\r\n
- Returns: (the road motor deceleration values)
Set increase or decrease speed (ID,SAD,*,*****,#####\r\n) The directive sets motor acceleration/deceleration values at the same time. In closed-loop control mode, the speed reduction unit is r/min/s; in open-loop mode, is a quantitative parameter. Such as acceleration of M1 is set to 50, the deceleration is set to 100
- Send: 1,SAD,1,50,100\r\n
- Returns: none
Get the PPM Max (ID,GPA\r\n) PPM Max factory default value is 2500us.
- Send: 1,GPA\r\n
- Returns: (PPM maximum)
Get the minimum PPM (ID,GPI\r\n) PPM minimum factory default value is 500us.
- Send: 1,GPI\r\n
- Returns: (PPM minimum)
Set PPM extreme (ID,SPPM,****,####\r\n) Drive PPM maximum can be set in two ways, one is in SET mode, the automatic recognition of PPM maximum, the specific method will be introduced in PPM interface. Second: user can reset PPM maximum in UART interface. Regardless of which method, all PPM minimum value must be guaranteed not less than 500us,the maximum PPM value is less than 2500us. For example, to set PPM control signals of the drive the minimum and maximum value respectively for 1000us and 2000us
- Send: 1,SPPM,1000,2000\r\n
- Returns: none
Get the control signal mode (ID,GSM\r\n) Drive control signal patterns into the sustainable mode and discontinuous mode, sustainable mode refers to drive will keep the parameters set before once it received a valid control signal,it will changed until it receives new parameters. Discontinuous mode is that the drive will stop working once valid control signal is not received within a stipulated time, and indicates a failure of losing signal(a specific time, please refer to "set a break mode time limit" directive). In addition, the control signal mode is valid only for PPM and UART interfaces. Return parameter of 0 indicates that continuous mode and 1 indicates a break mode, the factory default value is 0.
- Send: 1,GSM\r\n
- Returns: (current control signal mode)
Set the control signal mode (ID,SSM,*\r\n) For example, the control signal mode is set to continuous mode
- Send: 1,SSM,1\r\n
- Returns: none
Set time limit of break mode (ID,SDCT,****\r\n) Discontinuous mode time limit, the maximum can be set to 10s, its timebase is 10ms. For example, to set the discontinuous mode time to 1s
- Send: 1,SDCT,100\r\n
- Returns: none
Get the PID parameter- Kp (ID,GKP,*\r\n) For example, to get the parameter of M1 velocity loop PID- Kp
- Send: 1,GKP,1\r\n
- Returns: (the current Kp values M1)
Get the PID parameter- Ti (ID,GTI,*\r\n) For example, to get the parameter of M1 velocity loop PID- Ti
- Send: 1,GTI,1\r\n
- Returns: (current Ti values M1)
Get the PID parameter- Td (ID,GTD,*\r\n) For example, to get the parameter of M1 velocity loop PID- Td
- Send: 1,GTD,1\r\n
- Returns: (the current Td values M1)
Set the PID parameters (ID,SPID,*,*******,##,&&\r\n) M1 and M2 velocity loop PID parameters of the drive is completely independent, including scale parameter, integral, differential parameter. These three parameters can be used in SET mode, the drives will auto-tune based on the load on the motor, draw the ideal parameter values, which greatly facilitates the use. Of course, the drive did not deny user configuring on their own, the three parameters can be set up through the directive, user can observe practical effects of speed servo combined with "real-time output motor speed" instruction and related software. For example, to set PID parameters of M1, Kp, Ti, Td is respectively to 0.2, 4, 1
- Send: 1,SPID,1,0.2,4,1\r\n
- Returns: none
To get the maximum permissible continuous current (ID,GMCC\r\n) Actual current is greater than the maximum permissible continuous current, and less than the maximum permissible peak current, allowing time for 2s, larger than the 2s, the motor will stop automatically and indicates overcurrent fault, factory default is 25000, unit- mA.
- Send: 1,GMCC\r\n
- Returns: (maximum permissible continuous current)
To get the maximum permissible peak current (ID,GMPC\r\n) Actual current is greater than the maximum permissible peak current, allowing over 400ms, greater than 400ms, the motor will stop automatically, and indicating over current fault, the factory default value is 30000, mA.
- Send: 1,GMPC\r\n
- Returns: (maximum permissible peak current)
To get the current current (ID,GCC,*\r\n) Such as access to M1 current current
- Send: 1,GCC,1\r\n
- Returns: (M1 current, unit is mA)
To set the maximum permissible continuous current and maximum permissible peak current (ID,SMLC,*****,#####\r\n) The maximum permissible continuous current should not exceed 25000, maximum permissible peak current shall not exceed 30000. Noteworthy is that the two motors share the same parameter. For example,to set the maximum permissible continuous current and maximum permissible peak current, respectively to 12000mA and 15000mA
- Send: 1,SMLC,12000,15000\r\n
- Returns: none
To get the maximum allowed temperature (ID,GMT\r\n) Drive temperature measuring range:-10~100℃, resolution of 1 degree Celsius.
- Send: 1,GMT\r\n
- Returns: (maximum allowable temperature unit: ℃)
To get the current temperature (ID,GCT\r\n) If the current temperature is greater than 40 ° c, fan drive interface will output 5V/500mA power, user can add-in a 5V fan or relay control power fan, to cool the drive off, when the temperature drops below 35 degrees Celsius, power supply will be disconnected. If there is no cooling measures or do not work, when the internal temperature is higher than the maximum allowable temperature, the motor stops, and also indicates over- temperature fault.
- Send: 1,GCT\r\n
- Returns: (drive temperature near the current power driver IC ,unit: ℃)
To set the maximum allowable temperature (ID,SMT,***,\r\n) Maximum allowable temperature value cannot be greater than 100 ℃, if it dose, the drive will not respond to the Setup instructions. For example, to set the maximum allowable temperature at 50 degrees Celsius
- Send: 1,SMT,50\r\n
- Returns: none
To get the system voltage (ID,GSV\r\n) If when the system voltage exceeds the limit voltage range, the motor will stop and then indicates the undervoltage or overvoltage fault.
- Send: 1,GSV\r\n
- Returns: (the current *10 system voltage at a resolution of 0.1V)
To set the limit voltage (ID,SLV,***,###\r\n) The recommended voltage DC drive range 12~36V, limit setting value should not be less than 6V, upper limit value is not greater than 40V, otherwise the drive will not respond. For example, to set respectively the driver's lower and upper voltage threshold to 10V and 24V
- Send: 1,SLV,100,240\r\n
- Returns: none
To get the fault information (ID,GER\r\n) Fault messages should be converted to a hexadecimal number, querying about origin fault in the following table:
Bit | Error Sources |
---|---|
0 | Reserved |
1 | Lower Voltage |
2 | Over Voltage |
3 | Over Temperature |
4 | M1 Over Current |
5 | M2 Over Current |
6 | Control Signal Lost |
7 | Reserved |
8 | Reserved |
9 | Reserved |
10 | Reserved |
11 | Reserved |
12 | Reserved |
13 | Reserved |
14 | Reserved |
15 | Reserved |
Control Signal Lost: (1,GER\r\n) when the control mode is a break mode, the host controller is required to send control commands within a set time, if there is no control signal for a set time, drive will consider control signals as lost.
- Send: 1,GER\r\n
- Returns: (fault information, such as return of 2, then indicates the undervoltage protection)
Clear all fault messages (ID,CER\r\n) After the failure, the drive goes into protection mode, the motor will not be able to drive. In the UART interface, it can be in normal mode by clearing the fault information; in the PPM and Analog interfaces, resupply power, reset drive, shall enter into the normal mode.
- Send: 1,CER\r\n
- Returns: none
Output real-time speed (ID,OUT,* \r\n) Real-time speed of motor output is mainly to regulate PID parameters, if needed, to stop exporting, simply enter an empty instruction "\r\n". Worth noting is that in order to monitor the PID parameter tuning results in a better way, the command will call a return of motor speed in real time. For example, to get the M1 real-time speed
- Send: 1,OUT,1\r\n
- Returns: X,Y,Z\r\n (x, y, z are for the abstract representation of the actual data, x means the x time drive speed measurement, value range: 0~4294967295;Y said the actual speed of motor; z is motor target speed.)
FAQ
'''Q1. ''' Comman wiring mistakes might cause unexpected problem, like: The motor is not response to the command or signal, or the motor can not rotate continuously. You can check if you made some mistake in the list below. |
- '''A1. ''' Please check:
- Bad/ loose connection. That is some bad wire or wrong connection. One possible wrong connection is happened on the connecter, showing as the picture at right.
- Tx and Rx connected wrong. Generally, the connection should be Tx-Rx, Rx-Tx (Device A - Device B), but some product is designed for special purpose that the lable Tx on PCB is Rx actually, if so, you would better check its schematic to see if it's ture and exchange the Tx, Rx connection.
- If you connect the wires + and - of power supply in reverse way.
'''Q2. ''' I sent command by Arduino serial monitor through serial port (TTL 5V), but nothing happened, how should I do? |
- '''A2. ''' Make sure all the details below are ok:
- Basic
- Wires are good
- Your Adapetr(USB/ RS485/ RS232 - TTL) is good
- No loose connection
- Command format
- Caps Lock, "1,RCONFIG"
- Both Newline & Return, 57600 bps
- Only one green LED for UART is ON which means you are in UART mode.
- Wiring between the Adapter and Veyron
Adapeter | Veyron | Note |
5V | 5V | If Veyron has been powered by B+ & B-, this is not needed any more. |
GND | GND | |
Tx | Rx | |
Rx | Tx | Some adapter should be connected in: TX-TX, RX-RX |