Advanced Brushed and Brushless Digital Motor Controllers User Manual V1.8, August 28, 2017 visit www.roboteq.
Brushless Motor Connections and Operation Revision History Date Version Changes August 29, 2017 1.8 Added AC Induction Sections 1.7 Extended command set Added Speed Position Mode October 15, 2016 Major Additions to Brushless Motor Section Added RoboCAN protocol May 10, 2012 1.2 Miscellaneous updates Added CAN Networking Added Closed Loop Count Position mode, Closed Loop Torque mode January 8, 2011 1.2 Extended command set Added Brushless Motor Connections and Operation July 15, 2010 1.
Revision History Date Version Changes March 15, 2004 1.5 Added finer Amps limit settings Enhanced Roborun utility August 25, 2003 1.3 Added Closed Loop Speed mode Added Data Logging support Removed RC monitoring August 15, 2003 1.2 April 15, 2003 1.
Revision History.......................................................................................... 2 Introduction............................................................................................... 19 Refer to the Datasheet for Hardware-Specific Issues............................... 19 User Manual Structure and Use................................................................ 19 SECTION 1 Connecting Power and Motors to the Controller...................
Motor Deactivation in Normal Operation.................................................. 36 Motor Deactivation in Case of Output Stage Hardware Failure................ 36 Manual Emergency Power Disconnect..................................................... 38 Remote Emergency Power Disconnect.................................................... 39 Protection using Supervisory Microcomputer.......................................... 39 Self Protection against Power Stage Failure...............................
Accessing Sensor Information.................................................................. 68 Connecting Multiple Magnetic Guide Sensor........................................... 69 Accessing Multiple Sensor Information Sequentially................................ 69 Accessing Multiple Sensor Information Simultaneously........................... 70 6 SECTION 6 Command Modes.....................................................................................................
Closed Loop Position Relative Control...................................................... 87 Closed Loop Count Position...................................................................... 88 Closed Loop Position Tracking................................................................... 88 Torque Mode............................................................................................. 89 SECTION 8 Brushless Motor Connections and Operation...........................................
Closed Loop Speed Mode...................................................................... 121 Closed Loop Speed Position Control ...................................................... 121 Motor Sensors........................................................................................ 122 Tachometer or Encoder Mounting.......................................................... 122 Tachometer wiring..................................................................................
SECTION 14 Serial (RS232/USB) Operation............................................................................... 149 Use and benefits of Serial Communication............................................ 149 Serial Port Configuration......................................................................... 150 Connector RS232 Pin Assignment.......................................................... 150 Setting Different Bit Rates......................................................................
Realtime Queries.................................................................................... 169 Remote Queries restrictions................................................................... 169 Configurations Read/Writes.................................................................... 170 Remote Configurations Read restrictions............................................... 170 Remote Maintenance Commands..........................................................
Saving and Loading Scripts in Hex Format.............................................. 191 Executing MicroBasic Scripts................................................................. 191 Debugging Microbasic Scripts................................................................ 192 Script Command Priorities...................................................................... 192 MicroBasic Scripting Techniques............................................................. 193 Single Execution Scripts.....
True Literal.............................................................................................. 207 False Literal............................................................................................. 207 ++ Operator............................................................................................ 207 -- Operator............................................................................................... 208 << Operator............................................................
D0 - Reset Individual Digital Out bits...................................................... 224 D1 - Set Individual Digital Out bits.......................................................... 224 DC - Set Deceleration............................................................................. 225 DS - Set all Digital Out bits..................................................................... 226 DX - Next Decceleration..........................................................................
FC - Read FOC Angle Adjust................................................................... 252 FF - Read Fault Flags............................................................................... 253 FID - Read Firmware ID.......................................................................... 253 FM - Read Runtime Status Flag.............................................................. 254 FS - Read Status Flags............................................................................
Set/Read Configuration Commands ....................................................... 276 Setting Configurations............................................................................ 276 Reading Configurations........................................................................... 277 Configuration Read Protection................................................................ 278 General Configuration and Safety...........................................................
PMOD - Pulse Mode Select.................................................................... 309 PPOL - Pulse Input Polarity......................................................................311 Motor Configurations...............................................................................311 ALIM - Amp Limit.................................................................................... 312 ATGA - Amps Trigger Action....................................................................
BLLA - Brushless Counter Low Limit Action........................................... 342 BMOD - Brushless operating mode........................................................ 343 BPOL - Number of Pole Pairs and Speed Polarity of Brushless Motor... 344 BZPW - Brushless zero seek power level............................................... 345 HPO - Hall Sensor Position..................................................................... 345 HSM - Hall Sensor Map...............................................
Commands Parameters.......................................................................... 372 CAN Communication Parameters........................................................... 372 Encoder Parameters............................................................................... 373 Digital Input and Output Parameters...................................................... 373 Analog Input Parameters........................................................................ 374 Pulse Input Parameters....
Refer to the Datasheet for Hardware-Specific Issues Introduction Refer to the Datasheet for Hardware-Specific Issues This manual is the companion to your controller’s datasheet. All information that is specific to a particular controller model is found in the datasheet.
Introduction SECTION 4 I/O Configuration and Operation This section details the possible use of each type of Digital, Analog, Pulse or Encoder inputs, and the Digital Outputs available on the controller. It describes in detail the software configurable options available for each I/O type. SECTION 5 Magentic Sensor This section discusses how to interface one or more Roboteq’s MGS1600 Magnetic Guide Sensors to the motor controller.
User Manual Structure and Use SECTION 13 Closed Loop Torque Mode This section describes how to select, configure and operate the controller in Closed Loop Torque mode. SECTION 14 Serial (RS232/USB) Operation This section describes how to communicate to the controller via the RS232 or USB interface. SECTION 15 CAN Networking on Roboteq Controllers This section describes the RawCAN and MiniCAN operating modes available on CAN-enabled Roboteq controllers.
Introduction 22 Advanced Digital Motor Controller User Manual V1.
Power Connections SECTION 1 Connecting Power and Motors to the Controller This section describes the controller’s connections to power sources and motors. This section does not show connector pin-outs or wiring diagram. Refer to the datasheet for these. Important Warning The controller is a high power electronics device. Serious damage, including fire, may occur to the unit, motor, wiring and batteries as a result of its misuse. Please follow the instructions in this section very carefully.
Connecting Power and Motors to the Controller Controller Power The controller uses a flexible power supply scheme that is best described in Figure 1-1. In this diagram, it can be seen that the power for the Controller’s internal microcomputer is separate from this of the motor drivers. The microcomputer circuit is connected to a DC/DC converter which takes power from either the Power Control input or the VMot input.
Controller Powering Schemes increases by around 20V the low voltage threshold at which the controller will start operating when powered from VMot alone. The table below shows the state of the controller depending on the voltage applied to Power Control and VMot. TABLE 1-1. Controller Status depending on Power Control and VMot Power Control input is connected to And Main Battery Voltage is Ground Any Voltage Controller is Off. Required Off Configuration. Floating 0V Controller is Off.
Connecting Power and Motors to the Controller F2 1A SW1 Main On/Off Switch 1A PwrCtrl/Yellow Note 1 U White/U Ground/Black Motor Backup Battery Green/V Diode >20A Resistor 1K, 0.5W Note 3 V W Blue/W Note 2 VMot/Red F1 Note 4 + HA/HB/HC GND/+5V SW2 Emergency Contactor or Cut-off Switch Ground/Black - Hall Sensors Hall sensor Connector Earth Tab Note 5 I/O Connector Main Battery Note 6 Do not Connect! FIGURE 1-2.
Controller Powering Schemes Connection for Safe Operation with Discharged Batteries (note 1) The controller will stop functioning when the main battery voltage drops below 7V. To ensure motor operation with weak or discharged batteries, connect a second battery to the Power Control wire/terminal via the SW1 switch. This battery will only power the controller’s internal logic.
Connecting Power and Motors to the Controller • • • Do not connect a wire between the I/O connector ground pins and the battery minus terminal. Look for hidden connection and eliminate them. Have a very firm and secure connection of the controller ground wire and the battery minus terminal. Do not use connectors or switches on the power ground cables. Important Warning Do not rely on cutting power to the controller for it to turn Off if the Power Control is left floating.
Single Channel Operation Single Channel Operation Dual channel Brushed DC controllers may be ordered with the -S (Single Channel) suffix. The two channel outputs must be paralleled as shown in the datasheet so that they can drive a single load with twice the power. To perform in this manner, the controller’s Power Transistors that are switching in each channel must be perfectly synchronized.
Connecting Power and Motors to the Controller Important Warning Avoid long connection between the controller and power source, as the added inductance may cause damage to the controller when operating at high currents. Try extending the motor wires instead since the added inductance is not harmful on this side of the controller.
Motor On Measured and Calculated Currents Vbat Vbat Off On Motor Motor On Off FIGURE 1-3. Current flow during operation Vbat On Off I mot Avg On Motor I bat Avg Off FIGURE 1-4. Instant and average current waveforms The relation between Battery Current and Motor current is given in the formula below: On Off Motor Current = Battery Current / PWM RatioI mot Avg Example: If the controller reports 10A of battery current while at 10% PWM, the current in the motor is 10 / 0.1 = 100A.
Connecting Power and Motors to the Controller Controllers with sensors on the motor terminals provide accurate motor current sensing in all conditions, and provide a good estimate battery current value. Some controller models have sensors on the motor and on the battery terminals, and provide the most accurate current sensing as all are actually measured values.
Using the Controller with a Power Supply Using the Controller with a Power Supply Using a transformer or a switching power supply is possible but requires special care, as the current will want to flow back from the motors to the power supply during regeneration. As discussed in “Power Regeneration Considerations” above, if the supply is not able to absorb and dissipate regenerated current, the voltage will increase until the over-voltage protection circuit cuts off the motors.
Connecting Power and Motors to the Controller 34 Advanced Digital Motor Controller User Manual V1.
Possible Failure Causes SECTION 2 Safety Recommendations In many applications, Roboteq controllers drive high power motors that move parts and equipment at high speed and/or with very high force. In case of malfunction, potentially enormous forces can be applied at the wrong time and/or wrong place causing serious damage to property and/or harm to person. While Roboteq controllers operate very reliably, and failures are rare, a failure is possible as with any other electronic equipment.
Safety Recommendations • • • Faulty firmware Errors or oversights in user MicroBasic scripts Controller hardware failure Motor Deactivation in Normal Operation In normal operation, the controller is always able to turn off the motor if it detects faults or if instructed to do so from an external command.
Motor Deactivation in Case of Output Stage Hardware Failure + + The figures below show all the possible combinations of shorted MOSFETs switches in a brushed DC motor controller. + + + + 2 + 2 1 - + 5 + 4 - - 1 - 5 + + + 7 7 4 3 6 - + + 3 6 + 2 FIGURE 2-1.
Safety Recommendations Manual Emergency Power Disconnect In systems where the operator is within physical reach of the controller, the simplest safety device is the emergency disconnect switch that is shown in the wiring diagram inside all controller datasheets, and in the example diagram below.
Remote Emergency Power Disconnect Remote Emergency Power Disconnect In remote controlled systems, the emergency switch must be replaced by a high power contactor relay as shown in Figure 2-6. The relay must be normally open and be activated using an RC switch on a separate radio channel. The receiver should preferably be powered directly from the system’s battery.
Safety Recommendations Controller On/Off Switch PwrCtrl Ground PC, PLC or Microcomputer VMot Digital Output I/O Connector RS232 + Ground Main Battery FIGURE 2-7. Example of safety disconnect via supervisory system Self Protection against Power Stage Failure If the controller processor is still operational, it can self detect several, although not all, situations where a motor is running while the power stage is off. The figure below shows a protection circuit using an external contactor relay.
Self Protection against Power Stage Failure The controller must have the Power Control input wired to the battery so that it can operate and communicate independently of the power stage. The controller’s processor will then activate the contactor coil through a digital output configured to turn on when the “No MOSFET Failure” condition is true. The controller will automatically deactivate the coil if the output is expected to be off and battery current is above 500mA to 2.
Safety Recommendations 42 Advanced Digital Motor Controller User Manual V1.
Controller Connections SECTION 3 Connecting Sensors and Actuators to Input/Outputs This section describes the various inputs and outputs and provides guidance on how to connect sensors, actuators or other accessories to them. Controller Connections The controller uses a set of power connections DSub and plastic connectors for all necessary connections. The power connections are used for connecting to the batteries and motor, and will typically carry large current loads.
Connecting Sensors and Actuators to Input/Outputs Controller’s Inputs and Outputs The controller includes several inputs and outputs for various sensors and actuators. Depending on the selected operating mode, some of these I/Os provide command, feedback and/or safety information to the controller. When the controller operates in modes that do not use these I/Os, these signals are ignored or can become available via the USB/RS232 port for user application.
Connecting devices to Digital Outputs Connecting devices to Digital Outputs Depending on the controller model, 2 to 8 Digital Outputs are available for multiple purposes. The Outputs are Open Drain MOSFET outputs capable of driving over 1A at up to 24V. See datasheet for detailed specifications. Since the outputs are Open Drain, the output will be pulled to ground when activated. The load must therefore be connected to the output at one end and to a positive voltage source (e.g.
Connecting Sensors and Actuators to Input/Outputs Important Warning Overvoltage spikes induced by switching inductive loads, such as solenoids or relays, will destroy the transistor unless a protection diode is used. Connecting Switches or Devices to Inputs shared with Outputs On HDCxxxx and HBLxxxx controllers, Digital inputs DIN12 to DIN19 share the connector pins with digital outputs DOUT1 to DOUT8.
Connecting a Voltage Source to Analog Inputs A pull up resistor must be installed when using a pull down switch. 5V Out 1K to 10K Ohm 20kOhm 33kOhm DIN Ground FIGURE 3-5. Pull down (Active Low) switch wirings to DIN pins Connecting a Voltage Source to Analog Inputs Connecting sensors with variable voltage output to the controller is simply done by making a direct connection to the controller’s analog inputs. When measuring absolute voltages, configure the input in “Absolute Mode” using the PC Utility.
Connecting Sensors and Actuators to Input/Outputs +5V +/-10V 10kOhm 5kOhm Internal Resistors and Converter 20kOhm A/D 10kOhm 33kOhm Ground Figure 3-8. External resistors circuit for -10V to 10V capture range Important Notice On newer motor controllers models, activating the pulse mode on an input will also enable a pull up resistor on that input. If the input is also used for analog capture, the analog reading will be wrong. Make sure the pulse mode is disabled on that input.
Connecting a Voltage Source to Analog Inputs +5V Internal Resistors and Converter 20kOhm A/D 1K to 10K Ohm Pot 33kOhm Ground FIGURE 3-9. Potentiometer wiring Because the voltage at the potentiometer output is related to the actual voltage at the controller’s 5V output, configure the analog input in “Relative Mode”. This mode measures the actual voltage at the 5V output in order to eliminate any imprecision due to source voltage variations. Configure using the PC Utility.
Connecting Sensors and Actuators to Input/Outputs The controller’s analog channels are configured by default so that the min and max command range is from 0.25V to 4.75V. These values can be changed using the PC configuration utility. This ensures that the full travel of the pot is used to generate a command that spans from full min to full max. If the Min/Max safety is enabled for the selected analog input, the command will be considered invalid if the voltage is lower than 0.1V or higher than 4.9.
Connecting External Thermistor to Analog Inputs Important Warning The tachometer’s polarity must be such that a positive voltage is generated to the controller’s input when the motor is rotating in the forward direction. If the polarity is inverted, this will cause the motor to run away to the maximum speed as soon as the controller is powered and eventually trigger the closed loop error and stop.
Connecting Sensors and Actuators to Input/Outputs Volts 4.5 4 3.5 3 2.5 2 1.5 1 0.5 0 0 15 0 14 0 0 0 13 12 11 10 90 80 70 60 50 40 30 20 0 10 0 0 0 -1 -2 -3 -4 0 0 oC FIGURE 3-13. Voltage reading by Controller vs NTC temperature Note: The voltage values in this chart are provided for reference only and may vary based on the Thermistor model/brand and the resistor precision.
Connecting Optical Encoders Connecting Sensors to Pulse Inputs The controller has several pulse inputs capable of capturing Pulse Length, Duty Cycle or Frequency with excellent precision. Being a digital signal, pulses are also immune to noise compared to analog inputs. Important Notice On newer motor controllers models, activating the pulse mode on an input will also enable a pull up resistor on that input. If the input is also used for analog capture, the analog reading will be wrong.
Connecting Sensors and Actuators to Input/Outputs counter in the application. Quadrature encoders have dual channels, A and B, which are electrically phased 90° apart. Thus, direction of rotation can be determined by monitoring the phase relationship between the two channels. In addition, with a dual-channel encoder, a four-time multiplication of resolution is achieved by counting the rising and falling edges of each channel (A and B).
Connecting the Encoder Specifically, the controller’s encoder interface can process 1 million counts per second, unless otherwise specified in the product datasheet. Commercial encoders are rated by their numbers of “Pulses per Revolution” (also sometimes referred as “Number of Lines” or “Cycles per Revolution”).
Connecting Sensors and Actuators to Input/Outputs Cable Length and Noise Considerations Cable should not exceed one 3’ (one meter) to avoid electrical noise to be captured by the wiring. A ferrite core filter should be inserted near the controller for length beyond 2’ (60 cm). For longer cable length use an oscilloscope to verify signal integrity on each of the pulse channels and on the power supply. Ferrite Core Encoder Controller FIGURE 3-19.
Basic Operation I/O Configuration and Operation SECTION 4 This section discusses the controller’s digital and analog inputs and output and how they can be used.
Safety Recommendations Practically all operating configurations and parameters can be changed by the user to meet any specific requirement. This unique architecture leads to a very high number of possibilities. This section of the manual describes all the possible operating options. Input Selection As seen earlier in the controller’s simplified internal operating diagram on Figure 4-1, any input can be used for practically any purpose.
Analog Inputs Configurations and Use Configuring the Digital Inputs and the Action to use can be done very simply using the PC Utility. Wiring instructions for the Digital Inputs can be found in “Connecting Switches or Devices to Inputs shared with Outputs” onpage 46 Analog Inputs Configurations and Use The controller can do extensive conditioning on the analog inputs and assign them to different use. Each input can be disabled or enabled.
Safety Recommendations Analog Min/Max Detection An analog input can be configured so that an action is triggered if the captured value is above a user-defined Maximum value and/or under a user-defined Minimum value. The actions that can be selected are the same as these that can be triggered by the Digital Input. See the list and description in Table 4.1, “Digital Input Action List” on page 58.
Analog Inputs Configurations and Use Setting the center value to be the same as the min value makes the input capture only commands in the positive direction. For example if Min = Center = 200 and Max = 4500, the input will convert into 0 when 200 and below, and 1000 above 4500. The Min, Max and Center values are defined individually for each input. They can be easily entered manually using the Roborun PC Utility.
Safety Recommendations Command Correction An optional exponential or a logarithmic adjustment can then be applied to the signal. Exponential correction will make the commands change less at the beginning and become stronger at the end of the joystick movement. The logarithmic correction will have a stronger effect near the start and lesser effect near the end. The linear selection causes no change to the input. There are 3 exponential and 3 logarithmic choices: weak, medium and strong.
Digital Outputs Configurations and Triggers TABLE 4-3. (continued) Catpure Mode Description Typical use Duty Cycle Measures the On time relative to the full On/Off period Hall position sensors and joysticks with pulse output Frequency Measures the repeating frequency of pulse Encoder wheel The capture mode can be selected using the PC Configuration Utility.
Safety Recommendations Action Output activation Typical Use No action Not changed by any internal controller events. Output may be activated using Serial commands or user scripts Motor(s) is on When selected motor channel(s) has power applied to it. Brake release When selected motor channel(s) has power Motor(s) is reversed applied to it in reverse direction.
Hall and other Rotor Sensor Inputs The count information is also used to measure rotation speed. Using the Encoder Pulse Per Rotation (PPR) configuration parameter, the output is a speed measurement in actual RPM that is useful in closed loop speed modes where the desired speed is set as a numerical value, in RPM, using a serial command. The speed information is also scaled to produce a number ranging from -1000 to +1000 relative to a user-configured arbitrary Max RPM value.
Safety Recommendations 66 Advanced Digital Motor Controller User Manual V1.
Introduction to MGS1600 Magnetic Guide Sensor Magnetic Guide Sensor Connection and Operation SECTION 5 This section discusses how to interface one or more Roboteq’s MGS1600 Magnetic Guide Sensors to the motor controller. Details of the Sensor’s operation can be found in the product’s datasheet. Introduction to MGS1600 Magnetic Guide Sensor Roboteq’s Magnetic Guide Sensor is a sensor capable of detecting and reporting the position of a magnetic field along its horizontal axis.
Magnetic Guide Sensor Connection and Operation MagSensor MultiPWM interface The recommended interfacing method to Roboteq motor controller is the MagSensor MultiPWM mode. As the name implies, this proprietary method uses a succession of variable duty-cycle pulses to carry the Tracks, Tape Detect, Markers and Gyroscope information. Any of the controller’s pulse input can be configured as a MultiPWM input. The diagram below shows how simple this one-wire interfacing is.
Connecting Multiple Magnetic Guide Sensor The following Motor Controller queries are available for reading the captured sensor data. ?MGD : Read tape detect ?MGT nn : Read left track when nn= 1 or right track when nn= 2 ?MGM nn : Read left marker when nn=1 or right track when nn= 2 Details on these commands can be found in the Commands Reference section of this manual Connecting Multiple Magnetic Guide Sensor More than one sensor can be connected to a single motor controller.
Magnetic Guide Sensor Connection and Operation Accessing Multiple Sensor Information Simultaneously It is possible to have all magnetic sensors enabled at the same time by having their respective pulse input set to MagSensor MultiPWM When more than one pulse input is configured that way, the sensor data is accessible using the ?MGD, ?MGT, ?MGM and ?MGY queries as follows, where x is the pulse input number (1, 2, 3 etc.).
Connecting Multiple Magnetic Guide Sensor ?MGT 3*(x-1)+3 or GetValue(_MGT, 3*(x-1)+3) Returns the Active (Left or Right) Track Position of Sensor at input x Examples: ?MGT 1 : Returns the Left Track Position of Sensor at input 1 ?MGT 2 : Returns the Right Track Position of Sensor at input 1 ?MGT 4 : Returns the Left Track Position of Sensor at input 2 ?MGT 5 : Returns the Right Track Position of Sensor at input 2 ?MGT 7 : Returns the Left Track Position of Sensor at input 3 Advanced Digital Motor Controll
Magnetic Guide Sensor Connection and Operation 72 Advanced Digital Motor Controller User Manual V1.
Input Command Modes and Priorities SECTION 6 Command Modes This section discusses the controller’s normal operation in all its supported operating modes. Input Command Modes and Priorities The controller will accept commands from one of the following sources • Serial data (RS232, USB, MicroBasic script) • Pulse (R/C radio, PWM, Frequency) • Analog signal (0 to 5V) • Spektrum Radio (on selected models) • CAN Interface One, many or all command modes can be enabled at the same time.
Brushless Motor Connections and Operation Pulse tes eR t eS Serial/USB Analog FIGURE 6-1. Controller’s possible command modes In the Serial mode, the mode is considered as active if commands (starting with “!”) arrive within the watchdog timeout period via the RS232 or USB ports. The mode will be considered inactive, and the next lower priority level will be selected as soon as the watchdog timer expires.
Operating the Controller in RC mode Note that it is possible to set a priority level to “None”. For example, the priority table 1 - Serial 2 - RC Pulse 3 - None will only arbitrate and use Serial or RC Pulse commands. USB vs Serial Communication Arbitration On controllers equipped with a USB port, commands may arrive through the RS232 or the USB port at the same time. They are executed as they arrive in a first come first served manner. Commands that are arriving via USB are replied on USB.
Brushless Motor Connections and Operation The RC mode provides the simplest method for remotely controlling a robotic vehicle: little else is required other than connecting the controller to the RC receiver and powering it On. tes eR t eS FIGURE 6-2. R/C radio control mode The speed or position information is communicated to the controller by the width of a pulse from the RC receiver: a pulse width of 1.0 millisecond indicates the minimum joystick position and 2.
Operating the Controller in RC mode capture (one input on single channel products). Which channel and which pin on the input connector depends on the controller model and can be found in the controller’s datasheet. Changing the input assignment is done using the PC Configuration utility. Input RC Channel Configuration Internally, the measured pulse width is compared to the reference minimum, center and maximum pulse width values.
Brushless Motor Connections and Operation Important Warning Some receivers include their own supervision of the radio signals and will move their servo outputs to a safe position in case of signal loss. Using these types of receiver, the controller will always be receiving pulses even with the transmitter off. Using Sensors with PWM Outputs for Commands The controller’s Pulse inputs can be used with various types of angular sensors that use contactless Hall technology and that output a PWM signal.
Operating the Controller In Analog Mode Analog command inputs. Which channel and which pin on the input connector depends on the controller model and can be found in the controller’s datasheet. Changing the input assignment is done using the PC Configuration utility. See “Analog Inputs Configurations and Use” on page 59. Input Analog Channel Configuration An Analog input can be Enabled or Disabled.
Brushless Motor Connections and Operation Monitoring and Telemetry in RC or Analog Modes The controller can be fully monitored while it is operating in RC or Analog modes. If directly connected to a PC via USB or RS232, the controller will respond to operating queries (Amps, Volts, Temperature, Power Out, ...) without this having any effect on its response to Analog or RC commands. The PC Utility can therefore be used to visualize in real time all operating parameters as the controller runs.
Power Output Circuit Operation Motor Operating Features and Options SECTION 7 This section discusses the controller’s operating features and options relating to its motor outputs. Power Output Circuit Operation The controller’s power stage is composed of high-current MOSFET transistors that are rapidly pulsed on and off using Pulse Width Modulation (PWM) technique in order to deliver more or less power to the motors.
Motor Operating Features and Options Global Power Configuration Parameters PWM Frequency The power MOSFETs are switched at 16kHz by default. This frequency can set to another value ranging from 10 kHz to 50 kHz. Increasing the frequency reduces the efficiency due to switching losses. Lowering the frequency eventually creates audible noise and can be inefficient on low inductance motors. Changing the PWM frequency typically results in no visible change in the motor operation and should be left untouched.
Global Power Configuration Parameters The time it takes for the heat sink’s temperature to rise depends on the current output, ambient temperature, and available air flow (natural or forced). Short Circuit Protection The controller includes a circuit that will detect very high current surges that are consistent with short circuits conditions. When such a condition occurs, the power transistor for the related motor channel are cut off within a few microseconds. Conduction is restored at 1ms intervals.
Motor Operating Features and Options The controller supports 3 mixing algorithms with different driving characteristics. The table below shows how each motor output responds to the two commands in each of these modes. TABLE 7-1.
Motor Channel Parameters The current limit may be set using the supplied PC utility. The maximum limit is dependent on the controller model and can be found on the product datasheet. The limitation is performed on the Motor current and not on the Battery current. See “Battery Current vs. Motor Current” on page 30 for a discussion of the differences.
Motor Operating Features and Options Forward and Reverse Power Adjustment Gain This parameter lets you select the scaling factor for the power output as a percentage value. This feature is used to connect motors with voltage rating that is less than the battery voltage. For example, using a factor of 50% it is possible to connect a 12V motor onto a 24V system, in which case the motor will never see more than 12V at its input even when the maximum power is applied.
Selecting the Motor Control Modes Closed Loop Speed Position Control In this mode, the controller computes the position at which the motor must be at every 1ms. Then a position loop compares that expected position with the current position and applies the necessary power level in order for the motor to reach that position. This mode is especially effective for accurate control at very slow speeds.
Motor Operating Features and Options Closed Loop Count Position In this mode, an encoder is attached to the motor as for the Speed Mode of Figure 7-8. Then, the controller can be instructed to move the motor to a specific number of counts, using a user-defined acceleration, velocity, and deceleration profile. Details on how to configure and use this mode can be found in “Closed Loop Count Position Mode” on page 131. On brushless motors, the hall sensors can be also be used for position measurement.
Torque Mode Torque Mode In this closed loop mode, the motor is driven in a manner that it produces a desired amount of torque regardless of speed. This is achieved by using the motor current as the feedback. Torque mode does not require any specific wiring. Detail on this operating mode can be found in “Closed Loop Torque Mode” on page 137.
Motor Operating Features and Options 90 Advanced Digital Motor Controller User Manual V1.
Introduction to Brushless Motors SECTION 8 Brushless Motor Connections and Operation This section addresses installation an operating issues specific to brushless motors. It is applicable only to brushless motor controller models. Introduction to Brushless Motors Brushless motors, or more accurately Brushless DC Permanent Magnet Synchronous motors (since there are other types of motors without brushes) contain permanent magnets and electromagnets.
Brushless Motor Connections and Operation As the name implies, Brushless motors differ from traditional DC motors in that they do not use brushes for commutating the electromagnets. Instead, it is up to the motor controller to apply, in sequence, current to each of the 3 motor windings in order to cause the rotor to spin.
Trapezoidal Switching Trapezoidal Switching In trapezoidal switching, the controller applies current to two of the 3 motor wires, in turn and in alternating direction. A total of 6 combination of current flow are possible, resulting in the rotor getting a changing magnetic field every 30 degrees of electrical rotation. The controller must therefore know where the rotor is in relation to the electromagnets so that current can be applied to the correct winding at any given point in time.
Brushless Motor Connections and Operation Figure 8-3. Hall sensor inputs equivalent circuit Both 60 degrees and 120 degrees Hall sensors spacing, are supported (see “HPO” in the command reference section). Hall sensors can typically be powered over a wide voltage range. The controller supplies 5V for powering the Hall sensors. Unless specified otherwise in the datasheet, Hall sensor connection to the controller is done using Molex Microfit 3.0 connectors.
Trapezoidal Switching The reply is one or two numbers depending whether the controller is a single or dual channel. The values is between 0 and 7 with each bit representing the state of each of the HA, HB and HC sensors. Turn the motor slowly by hand while sending frequent ?HS queries. Verify that all valid combinations appear at one time or the other and that none of the invalid combination ever show.
Brushless Motor Connections and Operation Rotate shaft clockwise Probe W V U Motor Vw-u GND Clip +5V HA Probe HB Va HC GND GND Clip 2-10k 5V 2-10k 2-10k Hall Sensor Power and Pull-ups Figure 8-5. Use an oscilloscope and the circuit in figure to place the probes and generate these signals Determining the Wiring Order Empirically While probing with an oscilloscope gives the definite order, a simpler and quicker way may be to try all valid combination by trial and error.
Trapezoidal Switching Important Notice Beware that while only one combination is valid, there may be other combinations that will cause the motor to spin. When the motor spins with the wrong wiring combination, it will do so very inefficiently. Make sure that the motor spins equally smoothly in both directions. Try all 6 combinations and select the best. Sensorless Trapezoidal Commutation Some Roboteq controller models support sensorless trapezoidal commutation.
Brushless Motor Connections and Operation Sensorless Configuration and Calibration The controller’s default configuration will typically work with any motor. However, faster and more consistent motor startup will be achieved by performing these setup and calibration steps: 1. M ake sure the battery volts and if possible the maximum load on the motor is set. If either changes the procedure will need to be repeated. 2. Configure motor channels as sensorless. 3.
Sinusoidal Commutation Sinusoidal Commutation In sinusoidal commutation, all three wires are permanently energized with a sinusoidal current that is 120 degrees apart on each phase as shown in figure 8-7. V 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221 231 241 251 261 271 281 291 301 311 321 331 341 351 361 371 381 391 401 411 421 431 441 451 461 471 481 491 501 511 521 531 541 551 561 571 581 591 601 611 621 631 641 651 661 671 681 691 701 711 U W Figure 8-7.
Brushless Motor Connections and Operation Important Notice The number of poles is a very important configuration parameter in sinusoidal mode. Using the wrong value will produce erratic behavior and possibly damage. Incremental Encoder Feedback A quadrature encoder can be used to determine the rotor position. Since encoders do not give an absolute position, a reference search sequence is necessary before any power is applied to the motor.
Sinusoidal Commutation a 0.1uF ceramic capacitor between the input pin and ground pin on the controller’s connector Synchro Resolver Sensor Feedback Synchro Resolvers are a form of Sine/Cosine sensor based on transformer technology. It is composed of a fixed primary coil, and two secondary coils that rotate with the rotor. The two secondaries are 90o from each other. A fixed frequency excitation voltage is fed in the primary.
Brushless Motor Connections and Operation 2: Hall+Encoder 3: SPI Sensor 4: Sin/Cos Sensor 5: Resolver Each mode requires a various amount of additional setup and/or calibration as described in the following sections. In sinusoidal mode, on some models the controller automatically operates in Field Oriented Control mode (see “Field Oriented Control (FOC)” on page 108) and requires additional settings for this.
Sinusoidal Commutation Setup and Test the SPI Encoder Feedback Mode SPI encoders give an absolute angle in digital form, serially to the controller. These sensors can be trusted to give an accurate angle measurement. However, they typically are not perfectly mechanically aligned with the motor’s zero degree reference. Therefore a one-time reference calibration must be performed.
Brushless Motor Connections and Operation values using ASI query. Verify that these value do change as the shaft is turned and that have a difference between the min and max values of at least 1000. Once the sensor is verified to be working, a one-time calibration must be performed to captures the mechanical offset of the sensor. In most cases, a small difference exists between the 0 degrees from the sensor vs the actual 0 degrees of the motor. Verify that the motor shaft is rotating freely.
Sinusoidal Commutation The amount of current (ie torque) that the controller will apply to the motor for the search is set in the Reference Seek Power menu of the configuration utility, or the serial command: ^BZPW ch Amps*10 After each !BND command, if the process was successful, the response will be: BND + BADJ = nn *Will only return BADJ when using SPI, SSI, SinCos or resolver The number in BADJ represents the angle adjustment that has been detected and that must be saved in Flash for future operation I
Brushless Motor Connections and Operation 337.5 0 22.5 315 45 270 292.5 315 0 225 45 90 67.5 135 180 180 Electrical Degrees 135 225 270 90 247.5 45 90 112.5 270 315 0 135 225 202.5 180 157.5 Mechanical Degrees Figure 8-10. Mechanical vs electrical degrees The reference search will settle on a given electrical angle location. This electrical angle value exists in 2 mechanical location on this motor. After performing a first search, rotate the motor shaft and repeat the search.
Operating Brushless Motors Important Warning In version 1.5 and lower of the firmware, the Zero Adjust Offset was stored in the configuration flash. The value will be lost, and a new calibration must be performed when installing version 1.6 of the firmware. In version 1.6 and newer, the value is stored in a dedicated section of Flash and will not be lost after firmware updates.
Brushless Motor Connections and Operation sion motors, this results in a stable speed being reported. On less elaborate motors, such as low-cost hub motors, the reported speed may oscillate by a few percent. Speed measurement is very precise with digital absolute sensors (SPI). Sin/Cos sensors operating without noise also give a very precise value. The motor’s number of poles must be entered as a controller parameter in order to produce an accurate RPM value. See discussion above.
Field Oriented Control (FOC) As can be seen in figure 8-10, when the magnetic field is at an angle other than exactly perpendicular to the rotor’s magnets, the rotor is pulled by a force that can be decomposed in two forces: Lateral force causing torque, and therefore rotation. This force results from the from the Quadrature current Iq, which is also called Torque current Parallel force that pulls the rotor outwards, creating no motion.
Brushless Motor Connections and Operation For single Channel Controllers: ^KPF 1 nn = Proportional Gain for Channel 1 Flux ^KPF 2 nn = Proportional Gain for Channel 1 Torque ^KIF 1 nn = Integral Gain for Channel 1 Flux ^KIF 2 nn = Integral Gain for Channel 1 Torque For dual Channel Controllers: ^KPF 1 nn ^KPF 2 nn ^KPF 3 nn ^KPF 4 nn ^KIF 1 nn ^KIF 2 nn ^KIF 3 nn ^KIF 4 nn = Proportional Gain for Channel 1 Flux = Proportional Gain for Channel 2 Flux = Proportional Gain for Channel 1 Torque = Proportional
FOC Testing and Troubleshooting The amount of Flux current should be different at low and high speed, typically starting with zero, and increasing after a given RPM threshold is reached.
Brushless Motor Connections and Operation 112 Advanced Digital Motor Controller User Manual V1.
Introduction to AC Induction Motors SECTION 9 AC Induction MotorOperation This section discusses the controller’s operating features and options when using three phase AC Induction motors. Introduction to AC Induction Motors Three phase induction motors are the most common types of electrical motors. They have a very simple construction composed of a stator covered with electromagnets, and a rotor composed of conductors shorted at each end, arranged as a “squirrel cage”.
AC-induction-Motor-Operation •• They are maintenance free motors unlike dc motors due to the absence of brushes, commutators and slip rings. •• Induction motors can be operated in polluted and explosive environments as they do not have brushes which can cause sparks Asynchronous Rotation and Slip AC Induction motors are Asynchronous Machines meaning that the rotor does not turn at the exact same speed as the stator’s rotating magnetic field.
Selecting and Connecting the Encoder Connecting the Motor An AC Induction motors has just 3 power wires which must be connected to the controller’s U V and W terminals. The connection order is not important. However, swapping any two motor connections will make the motor turn in the opposite direction. Selecting and Connecting the Encoder A speed sensor must be used to measure and control the motor’s slip when running in Constant Slip mode and Torque/Speed FOC mode.
AC-induction-Motor-Operation Apply a positive motor command. Verify that the motor shaft is moving in the desired direction. If the motor moves in the opposite direction, swap any two of the three motor cables. If the motor moved in the desired direction, then verify that the encoder counter increments when a positive motor command is applied. If the counter decrements, then either swap the A and B encoder wires, or enter a negative number of PPRs in the encoder configuration.
Closed Loop Speed Mode with Constant Slip Control Watt V Amps RPM Nm 3500 48Bat 100 1450 23 50Hz V fase 3 x 27 Encoder 64 Pulses For this motor, the VPH can be determined by dividing the 27 Volts per phase by the 50Hz frequency. In this case 0.54 Volts per Hertz. Note that this value is for the optimal torque as rated on the label. If the load is a lot lighter, the VpH will be too high and result in excessive current consumption.
AC-induction-Motor-Operation •• Set the PID gains found in the Motor Output, Closed Loop Speed Parameters menus (do not use the FOC PID gains). Try first with gains of P=4, I=0.5, D=0. These values will produce adequate results in most cases. Additional turning may be needed. •• Set the Max RPM configuration to the speed that must be reached at full throttle (ie when command = 1000). Make sure to enter a value that is within the physical reach of the motor under the expected maximum load condition.
Field Oriented Control (FOC) mode Operation Rs Stator Resistance Lls Stator Leakage Inductance Rr Rotor Resistance Llr Rotor Leakage Inductance Lm Mutual Inductance These parameters include per phase rotor resistance ‘Rr’, rotor leakage inductance ‘Llr’, mutual inductance ‘Lm’ and rotor leakage inductance ‘Llr’.
AC-induction-Motor-Operation •• Put some high load on the rotor and command a step Torque Amps from the slider bar (say 10A). Record the “FOC Torque Amps” reading on the chart. If the step response reaches the desired (10A) steady state fast enough then the PID is can be considered tuned. If it is slow then increase integral gain. If the Torque and Flux Amps show noise at high speed or motor produces noisy sound, then lower your proportional gain Kp.
Modes Description Closed Loop Speed and Speed-Position Modes SECTION 10 This section discusses the controller’s Closed Loop Speed modes. Modes Description Close loop speed modes ensure that the motor(s) will run at a precise desired speed. If the speed changes because of changes in load, the controller automatically compensates the power output so that the motor maintains a constant speed.
Closed Loop Speed Mode Speed Command Trajectory Expected Position - PWM PID Motor Position Feedback Position Counter The controller incorporates a full-featured Proportional, Integral, Differential (PID) control algorithm for quick and stable speed control. The closed loop speed mode and all its tuning parameters may be selected individually for each motor channel. Motor Sensors The controller can use a variety of sensors for measuring speed.
Brushless Hall Sensors as Speed Sensors Connecting the tachometer to the controller is as simple as shown in the diagram below. 5V Out 1kOhm Zero Adjust 100 Ohm pot Internal Resistors and Converter Max Speed Adjust 10kOhm pot Tach Ana In A/D 20kOhm 33kOhm 1kOhm Ground FIGURE 10-2.
Closed Loop Speed Mode Determining the right polarity is best done experimentally using the Roborun utility (see “Using the Roborun Configuration Utility” on page 349) and following these steps: 1. Configure the controller in Open Loop Mode using the PC utility. This will cause the motor to run in Open Loop for now. 2. Configure the sensor you plan to use as speed feedback. If an analog tachometer is used, map the analog channel on which it is connected as “Feedback” for the selected motor channel.
PID Description sired actual max RPM, an additional parameter must be entered in the encoder or brushless configuration. The Max RPM parameter is the speed that will be reported as 1000 when reading the speed in relative mode. Max RPM is also the speed the controller will attempt to reach when a max command of 1000 is applied. When sending a speed command via serial, CANbus, scripting or USB, the command may be sent as a relative speed (0 to +/-1000) or actual RPM value.
Closed Loop Speed Mode Propor tional Gain x Desired Speed or Position Sensor Integrator Limit - E= Error Measured Speed or Position dE dt Σ x Output Integral Gain dE dt x Differential Gain FIGURE 10-3. PID algorithm used in speed modes PID tuning in Closed Loop Speed Mode As discussed above, three parameters - Proportional Gain, Integral Gain, and Differential Gain - can be adjusted to tune the Closed Loop Speed control algorithm.
PID Tuning in Speed Position Mode In the case where the load moved by the motor is not fixed, tune the PID with the minimum expected load and tune it again with the maximum expected load. Then try to find values that will work in both conditions. If the disparity between minimal and maximal possible loads is large, it may not be possible to find satisfactory tuning values.
Closed Loop Speed Mode Error Detection and Protection The controller will detect large tracking errors due to mechanical or sensor failures, and shut down the motor in case of problem in closed loop speed or position system. The detection mechanism looks for the size of the tracking error (desired position vs. actual position) and the duration the error is present.
Modes Description SECTION 11 Closed Loop Relative and Tracking Position Modes This section describes the controller’s Position Relative and Position Tracking modes, how to wire the motor and position sensor assembly and how to tune and operate the controller in these modes. Modes Description In these two position modes, the axle of a geared-down motor is coupled to a position sensor that is used to compare the angular position of the axle versus a desired position.
Closed Loop Relative and Tracking Position Modes This mode requires fewer settings but often results in a motion that is not as smooth and harder to control overshoots. Selecting the Position Modes The two position modes are selected by changing the Motor Control parameter to Closed Loop Position. This can be done using the corresponding menu in the Power Output tree in the Roborun utility. It can also be done using the associated serial (RS232/USB) command. See “MMOD” on page 329.
Feedback Sensor Range Setting The sensor is composed of two parts: • • a body which must be physically attached to a non-moving part of the motor assembly or the robot chassis, and an axle which must be physically connected to the rotating part of the motor you wish to position. A gear box is necessary to greatly increase the torque of the assembly. It is also necessary to slow down the motion so that the controller has the time to perform the position control algorithm.
Closed Loop Relative and Tracking Position Modes Important Warning If there is a polarity mismatch, the motor will turn in the wrong direction and the position will never be reached. The motor will turn until the Closed Loop Error detection is triggered. The motor will then stop until the error disappears, the controller is set to Open Loop, or the controller is reset.
Using Current Trigger as Protection The diode polarity depends on the particular wiring and motor orientation used in the application. If the diode is mounted backwards, the motor will not stop once the limit switch lever is pressed. If this is the case, reverse the diode polarity. The diodes may be eliminated, but then it will not be possible for the controller to move the motor once either of the limit switches has been triggered.
Closed Loop Relative and Tracking Position Modes Position End Position Start Position Time Speed Position Mode Velocity Acceleration Deceleration Time FIGURE 11-3. When turning the controller on, the default acceleration, deceleration and velocity are parameters retrieved from the configuration EEPROM. In most applications, these parameters can be left unchanged and only change in commands used to control the change from one position to the other.
Operating in Closed Loop Tracking Mode For troubleshooting, the computed position can be monitored in real time by enabling the Tracking channel in the PC utility’s chart recorder. Beware not to use accelerations and max velocity that are beyond the motor’s physical reach at full load. This would result in a loop error which will stop the system if growing too large.
Closed Loop Relative and Tracking Position Modes Propor tional Gain x Integrator Limit Desired Position Sensor Measured Position E= Error dE dt Σ x Output Integral Gain dE dt x Differential Gain FIGURE 11-4. PID algorithm used in Position Mode The Differential component of the algorithm computes the changes to the error from one ms time period to the next.
PID Tuning Differences between Position Relative and Position Tracking The Roborun PC utility makes this experimentation easy by providing one screen for changing the Proportional, Integral and Differential gains and another screen for running and monitoring the motor. When tuning the motor, first start with the Integral and Differential Gains at zero, increasing the Proportional Gain until the motor overshoots and oscillates. Then add Differential gain until there is no more overshoot.
Closed Loop Relative and Tracking Position Modes Loop Error Detection and Protection The controller will detect large tracking errors due to mechanical or sensor failures, and shut down the motor in case of problem in closed loop speed or position system. The detection mechanism looks for the size of the tracking error (desired position vs. actual position) and the duration the error is present.
Mode description Closed Loop Count Position Mode SECTION 12 In the Closed Loop Position mode, the controller can move a motor a precise number of encoder counts, using a predefined acceleration, constant velocity, and deceleration. This mode requires that an encoder be mounted on the motor. Mode description The desired position is given in number of counts.
Closed Loop Count Position Mode Sensor Types and Mounting In position mode, best results are achieved with encoders directly mounted on the motor shaft. Encoders can be: • Quadrature encoders • Hall Sensors built-in brushless motors • Other rotor sensors built-in brushless motors It is not advised to mount encoders at the output of a geared motor as the gear box often introduces backlash.
Count Position Commands Then use the PC Utility to select the Closed Loop Position Mode. After saving to the controller, the motor will operate in Closed Loop and will attempt to go to the 0 counter position. Beware therefore that the motor has not already turned before switching to Closed Loop. Reset the counter if needed prior to closing the loop. Count Position Commands Moving the motor is done using a set of simple commands.
Closed Loop Count Position Mode Beware that the next commands must be entered while the motor is moving, since the next commands will only be taken into account at the end of the current motion. To chain more than two commands, use a MicroBasic script or an external program to load new “next” command when the previous “next” commands become active. The ?DR query can be used to detect that this transition has occurred and that a new next command can be sent to the controller.
PID Tunings PID Tunings As long as the motor assembly can physically reach the acceleration and velocity, smooth motion will result with relatively little need for tuning. As for any position control loop, the dominant PID parameter is the Proportional gain with only little Integral gain and smaller or no Derivative gain. See “PID tuning in Position Mode”on page 128.
Closed Loop Count Position Mode 144 Advanced Digital Motor Controller User Manual V1.
Torque Mode Description SECTION 13 Closed Loop Torque Mode This section describes the controller’s operation in Torque Mode. Torque Mode Description The torque mode is a special case of closed loop operation where the motor command controls the current that flows though the motor regardless of the motor’s actual speed. In an electric motor, the torque is directly related to the current. Therefore, controlling the current controls the torque. Command PID Output Driver Motor Motor Amps FIGURE 13-1.
Closed Loop Torque Mode Torque Mode Selection, Configuration and Operation Use the PC utility and the menu “Operating Mode” to select Torque Mode. The controller will now use user commands from RS232, USB, Analog or Pulse to command the motor current. Commands are ranging from -1000 to +1000. The command is then scaled using the amps limit configuration value. For example, if the amps limit is set to 100A, a user command of 500 will cause the controller to energize the motor until 50A are measured.
Torque Mode Using an External Amps Sensor results use an amps limit that is at least 50% than the controller’s max rating. On newer Brushless motor controllers, amps sensors are placed at the motor output and motor amps are measured directly. Torque mode will work effectively on these models. Torque Mode Using an External Amps Sensor The limitations described above can be circumvented using an external amps sensor device such as the Allegro Microsystems ACS756 family of hall sensors.
Closed Loop Torque Mode 148 Advanced Digital Motor Controller User Manual V1.
Use and benefits of Serial Communication Serial (RS232/ USB) Operation SECTION 14 This section describes the communication settings of the controller operating in the RS232 or USB mode. This information is useful if you plan to write your own controlling software on a PC or microcomputer. The full set of commands accepted by the controller is provided in “Commands Reference” on page 209.
Serial (RS232/USB) Operation Serial Port Configuration The controller’s default serial communication port is set as follows: • 115200 bits/s • 8-bit data 14 • 1 Start bit • 1 Stop bit • No Parity 25 Communication is done without flow control, meaning that the controller is always ready to receive data and can send data at any time. 1 13 Connector RS232 Pin Assignment 14 25 1 8 1 15 13 9 FIGURE 14-1.
Setting Different Bit Rates Make sure that the controller respond to this command with a +. Check that the value has been accepted by sending ~RSBR. Send %EESAV from the console to store the new configuration to flash. Cable configuration The RS232 connection requires the special cabling as described in Figure 14-2. The 9-pin female connector plugs into the PC (or other microcontroller). The 15-pin or 25-pin male connector plugs into the controller.
Serial (RS232/USB) Operation DB9 Female DB9 Male 1 1 RX Data TX Data 6 6 7 7 2 3 8 8 9 9 Data Out 3 Data In 4 4 GND 2 5 5 GND FIGURE 14-3. RS232 extension cable/connector wiring diagram Connecting to Arduino and other TTL Serial Microcomputers Aduino and similar microcomputers have a TTL serial port while Roboteq controllers have a full RS232 serial interface.
USB Configuration The data at the output of the controller is +/-10V. At the other end of the resistor, the voltage is clamped to around 0-3.3V by the protection diodes that are included in the Arduino MCU. However, to avoid any stress it is highly recommended to insert the 2 diodes shown on the diagram. To operate, the RS232 output must be set to inverted. This must be done from the Console of the Roborun Utility while connected via USB.
Serial (RS232/USB) Operation Command Priorities The controller will respond to commands from one of three or four possible sources: • Serial (RS232 or USB) • Pulse • Analog • Spektrum Radio (when available) One, two, three or all four command modes can be enabled at the same time. When multiple modes are enabled, the controller will select which mode to use based on a user selectable priority scheme. The priority mechanism is described in details in “Input Command Modes and Priorities” on page 73. USB vs.
Communication Protocol Description Character Echo The controller will echo back to the PC or Microcontroller every valid character it has received.
Serial (RS232/USB) Operation 156 Advanced Digital Motor Controller User Manual V1.
CAN Networking on Roboteq Controllers SECTION 15 CAN Networking on Roboteq Controllers Some controller models are equipped with a standard CAN interface allowing up to 127 controllers to work together on a single twisted pair network at speeds up to 1Mbit/s. Supported CAN Modes Four CAN operating modes are available on Roboteq controllers: 1 - RawCAN 2 - MiniCAN 3 - CANopen 4 - RoboCAN RawCAN is a low-level operating mode giving total read and write access to CAN frames.
CAN Networking on Roboteq Controllers Connecting to CAN bus A CAN bus network is made of a stretch of two wires. A device can be put on a CANbus network by simply connecting it’s CAN-High and CAN-Low lines to these of other devices on the network. Microcomputer Motor Controllers PLC CANH CANL 120Ω 120Ω Magnetic Guide Sensor CAN Adapter Joysticks, Batteries HMI’s and other CAN Accessories Figure 15-1: CAN Network topology Resistors should be 120 ohm and located at each end of the cable.
CAN Networking on Roboteq Controllers Introduction to CAN Hardware signaling CANbus uses differential signals, which is where CAN derives its robust noise immunity and fault tolerance. The two signal lines of the bus, CANH and CANL, are biased to around 2.5 V. A logical “1” (also known as the dominant state) on the bus takes CANH around 1 V higher to around 3.5 V, and takes CANL around 1 V lower to 1.5 V, creating a typical 2V differential signal as shown in Figure 15-2.
CAN Networking on Roboteq Controllers 9 15 1 8 FIGURE 15-4. DB15 Connector pin locations The pins on the DB15 connector are mapped as described in the table below. TABLE 15-2. CAN Signals on DB15 connector Pin Number 6 Signal CAN_L Description CAN bus low 7 CAN_H CAN bus high 14 25 1 13 FIGURE 15-5. DB25 pin locations The pins on the DB25 connector are mapped as described in the table below. 9 6 TABLE 15-3.
CAN Networking on Roboteq Controllers If communication cannot be established, it can be difficult to determine the source of the problem. Here are a few ways to diagnose: Cable polarity, integrity and termination resistor Verify that the controller’s CANH and CANL are connected to the CANH and CANL wire. Check cable continuity to every node.
CAN Networking on Roboteq Controllers Common Configurations CAN Mode: Used to select one of the 4 operating modes. Off disables all CAN receive and transmit capabilities. Node ID: CAN Node ID used for transmission from the controller. Value may be between 1 and 126 included. Bit Rate: Selectable bit rate. Available speeds are 1000, 800, 500, 250, and 125 kbit/s. Default is 125kbit and is the recommended speed for RawCAN and MiniCAN modes.
CAN Networking on Roboteq Controllers Reading Raw Received Frames After a frame has been moved to the read buffer, the header, bytecount and data can be read with the ?CAN query. The query can be sent from the serial/USB port, or from a MicroBasic script using the getvalue(_CAN, n) function. The query usage is as follows: When the query is sent from serial or USB, without arguments, the controller replies by outputting all elements of the frame separated by colons.
CAN Networking on Roboteq Controllers Using MiniCAN Mode MiniCAN is greatly simplified subset of CANopen. It only supports Heartbeat, and fixed map Received Process Data Objects (RPDOs) and Transmit Process Data Objects (TPDOs). It does not support Service Data Objects (SDOs), Network Management (NMT), SYNC or other objects. Transmitting Data In MiniCAN mode, data to be transmitted is placed in one of the controller’s available Integer or Boolean User Variables.
CAN Networking on Roboteq Controllers Header: RPDO1: 0x200 + NodeID RPDO2: 0x300 + NodeID RPDO3: 0x400 + NodeID RPDO4: 0x500 + NodeID Data: Byte1 Byte2 RPDO1 RPDO4 Byte4 Byte5 Byte6 VAR9 RPDO2 RPDO3 Byte3 BVar 33-40 BVar 41-48 Byte8 VAR10 VAR11 VAR13 Byte7 VAR12 VAR14 BVar 49-56 VAR15 VAR16 BVar 57-64 Byte and Bit Ordering: Integer Variables are loaded from frame with the Least Significant Byte first.
CAN Networking on Roboteq Controllers 166 Advanced Digital Motor Controller User Manual V1.
RoboCAN Networking SECTION 16 RoboCAN Networking RoboCAN is a Roboteq proprietary meshed networking scheme allowing multiple Roboteq products to operate together as a single system. This protocol is extremely simple and lean, yet practically limitless in its abilities. It is the preferred protocol to use by user who just wish to make multiple controllers work together with the minimal effort.
RoboCAN Networking Network Operation RoboCAN requires only that a controller has a unique node number (other than 0) assigned and that the RoboCAN mode is selected and enabled. All nodes must be configured to operate at the same bit rate. Each enabled node will emit a special heartbeat at a set and unchangeable rate of 128ms so that each node can create and maintain a map of all nodes alive in the network.
RoboCAN Networking Realtime Queries Queries are handled the same way but the reply to a query includes the responding node’s address. Below is a Query example: ?V 2 This is the normal query for reading the battery voltage of the local controller. The controller will reply V=123 @04?V 2 This will send the same query to node address 4 The reply of the remote node is @04 V=123 Replies to remote nodes queries are identical to these to a local controller with the exception of an added latency.
RoboCAN Networking Configurations Read/Writes Configuration settings, like Amp Limit or Operating Modes can be read and changed on a remote node via the CAN bus. For example @04^ALIM 1 250 will set the current limit of channel 1 of node 4 at 25.0A @04~OVL will read the Overvoltage limit of node 4. Note that changing a configuration via CAN only makes that change temporary until the remote controller is powered down.
RoboCAN Networking Self Addressed Commands and Queries For sake of consistency commands sent to the local node number are executed the same way as they would be on a remote node. However the no CAN frame is sent to the network.
RoboCAN Networking Will set the overvoltage limit of all nodes to 25.0V. Note that even though the Overvoltage is set for the controller and does not normally require that a Channel, the value 1 must be put in order for the instruction to compile. Script execution is not paused when one of these function is used. The frame is sent on the CAN network within one millisecond of the function call.
RoboCAN Networking Below is a sample script that continuously reads and print the counter value of node 4 top: FetchCANValue(4, _C, 1) ‘ request data from remote node while(IsCANValueReady = false) ‘ wait until data is received end while Counter = ReadCANValue() ‘ read value print (Counter, “\r”) ‘ print value followed by new line goto top ‘ repeat forever Continuous Scan In many applications, it is necessary to monitor the value of an operating parameter on a remote node.
RoboCAN Networking cc is the Query code, eg _V ch is the channel number. Put 1 for queries that do not normally require a channel number tt is the scan rate in ms bb is the buffer location The scan rate can be up to 255ms. Setting a scan rate of 0 stops the automatic sending from this node. Unless otherwise specified, the buffer can store up to 32 values. The arrival of a new value is checked with the function IsScannedCANReady(aa) Where aa is the location in the scan buffer.
RoboCAN Networking Checking the presence of a Node No error is reported in MicroBasic if an exchange is initiated with a node that does not exist. A command or configuration sent to a non-existent node will simply not be executed. A query sent to a non existing or dead node will return the value 0. A function is therefore provided for verifying the presence of a live node. A live node is one that sends the distinct RoboCAN heartbeat frame every 128ms.
RoboCAN Networking 176 Advanced Digital Motor Controller User Manual V1.
Use and benefits of CANopen CANopen Interface SECTION 17 This section describes the configuration of the CANopen communication protocol and the commands accepted by the controller using the CANopen protocol. It will help you to enable CANopen on your Roboteq controller, configure CAN communication parameters, and ensure efficient operation in CANopen mode. The section contains CANopen information specific to Roboteq controllers.
CANopen Interface Connection to a CAN bus is as simple as shown on the diagram above. 120 Ohm Termination Resistors must be inserted at both ends of the bus cable. CAN network can be up to 1000m long. See CAN specifications for maximum length at the various bit rates. CAN Bus Configuration To configure communication parameters via the RoborunPlus PC utility, your controller must be connected to a PC via an RS232/USB port Use the CAN menu in the Configuration tab in order to enable the CANopen mode.
Commands Accessible via CANopen Commands Accessible via CANopen Practically all of the controller’s real-time queries and real-time commands that can be accessed via Serial/USB communication can also be accessed via CANopen. The meaning, effect, range, and use of these commands is explained in detail in Commands Reference section of the manual. All supported commands are mapped in a table, or Object Dictionary that is compliant with the CANopen specification.
CANopen Interface Each of the 4 TPDOs can be configured to be sent at user-defined periodic intervals. This is done using the CTPS parameter (See “CTPS - CANOpen TPDO Send Rate” on page 363). TABLE 17-1.
CANopen Message Types Object Dictionary The CANopen dictionary shown in this section is subject to change. The CANopen EDS file can be downloaded from the roboteq web site. The Object Dictionary given in the table below contains the runtime queries and runtime commands that can be accessed with SDO/PDO messages during controller operation. TABLE 17-3.
CANopen Interface TABLE 17-3.
SDO Construction Details TABLE 17-3.
CANopen Interface The Response from the roboteq device is as shown below: Payload Byte0 Header DLC bits 4-7 bits2-3 bits0-1 Byte1-2 Byte 3 Bytes4-7 0x580+nd 8 css n xx index subindex Data • • • • • • • nd is the source node id. ccs is the Client Command Specifier, if 4 it is query response, 6 it is a successful response to command, 8 is an error in message received. n is the Number of bytes in the data part, which do not contain data xx not necessary for the simplistic way.
SDO Construction Details TABLE 17-4. Magnetic Guide Sensor Object Dictionary Payload Byte0 Header DLC bits 4-7 0x600+12 8 601Ch 8 2 bits2-3 3 bits0-1 0 2C Byte1-2 Byte 3 Bytes4-7 0x200C 0x00 0x01 0C 20 00 01 00 00 00 The respective response will be: Payload Byte0 Header DLC bits 4-7 0x580+1 8 58Ch 8 6 bits2-3 0 bits0-1 0 60 Byte1-2 Byte 3 Bytes4-7 0x200C 0x00 0x00 0C 20 00 00 00 00 00 SDO Example 3: Read Battery Volts (V) of node 1.
CANopen Interface 186 Advanced Digital Motor Controller User Manual V1.
Script Structure and Possibilities SECTION 18 MicroBasic Scripting One of the Roboteq products’ most powerful and innovative features is their ability for the user to write programs that are permanently saved into, and run from the device’s Flash Memory. This capability is the equivalent, for example, of combining the motor controller functionality and this of a PLC or Single Board Computer directly into the controller.
MicroBasic Scripting The complete details on the language can be found in the MicroBasic Language Reference on page 195. Source Program and Bytecodes Programs written in this Basic-like language are interpreted into an intermediate string of Bytecode instructions that are then downloaded and executed in the controller.
Script Structure and Possibilities The SetCommand function is used to send motor commands or to activate the Digital Outputs. Practically all controller parameters can be access using these 4 commands, typically by adding the command name as defined in the Serial (RS232/USB) Operation on page 141 preceded with the “_” character. For example, reading the Amps limit configuration for channel 1 is done using getvalue(_ALIM, 1).
MicroBasic Scripting Editing, Building, Simulating and Executing Scripts Editing Scripts An editor is available for scripting in the RoborunPlus PC utility. See Scripting Tab on page 368 (Roborun scripting) for details on how to launch and operate the editor. The edit window resembles this of a typical IDE editor with, most noticeably, changes in the fonts and colors depending on the type of entry that is recognized as it is entered.
Editing, Building, Simulating and Executing Scripts Downloading MicroBasic Scripts to the controller The Download to Device button will cause the MicroBasic script to be built and then transferred into the controller’s flash memory where it will remain permanently unless overwritten by a new script. The download process requires no other particular attention. There is no warning that a script may already be present in Flash.
MicroBasic Scripting Manual launch is done by sending commands via the Serial or USB port. When connected to the PC running the PC utility, the launch command can be entered from the Console tab. The commands for running as stopping scripts are: • • • • !r : Start or Resume Script !r 0: Pause Script execution !r 1: Resume Script from pause point. All integer and Boolean variables have values they had at the time the script was paused. !r 2: Restarts Script from start.
MicroBasic Scripting Techniques watchdog timeout. If a serial command is received from the serial/USB port at the same time a command is sent from the script, both will be accepted and this can cause conflicts if they are both relating to the same channel. Care must be taken to keep to avoid, for example, cases where the script commands one motor to go to a set level while a serial command is received to set the motor to a different level.
MicroBasic Scripting Start Initialization Steps top Time, Input or Controller events Y Process Events N Wait FIGURE 18-2. Continuous execution scripts Often, some actions must be done only once when script starts running. This could be setting the controller in an initial configuration or computing constants that will then be used in the script’s main execution loop. The main element of a continuous script is the scanning of the input ports, timers, or controller operating parameters.
MicroBasic Language Reference Script Examples Several sample scripts are available from the download page on Roboteq’s web site. Below is an example of a script that continuously checks the heat sink temperature at both sides of the controller enclosure and lowers the amps limit to 50A when the average temperature exceeds 50oC. Amps limit is set at 100A when temperature is below 50o. Notice that as temperature is changing slowly, the loop update rate has been set at a relatively slow 100ms rate.
MicroBasic Scripting Comments A comment is a piece of code that is excluded from the compilation process. A comment begins with a single-quote character. Comments can begin anywhere on a source line, and the end of the physical line ends the comment. The compiler ignores the characters between the beginning of the comment and the line terminator. Consequently, comments cannot extend across multiple lines. ‘Comment goes here till the end of the line.
MicroBasic Language Reference • Sequence \’ Description Single quote \” Double quote \\ Backslash \0 Null \a Alert \b Backspace \f Form feed \n New line \r Carriage return \t Horizontal tab \v Vertical tab Hexadecimal Escape Sequence Hexadecimal escape sequence is represented in a set of hexadecimal digits (0-9, A-F) preceded by \x in the string (such as \x10 for character with ASCII 16).
MicroBasic Scripting Label names are case insensitive that is PrintLabel is identical to printLabel. The scope of a label extends whole the program. Labels cannot be declared more than once in the program. Variables Micro Basic contains only two types of variable (Integer and Boolean) in addition to arrays of these types. Boolean and arrays must be declared before use, but Integer variables may not be declared unless you use the Option Explicit compiler directive.
MicroBasic Language Reference condition is any expression returning a boolean result. stmt is single Micro Basic statement. block is zero or more Micro Basic statements. label is any valid label name. n is a positive integer value. str is a valid string literal. Keywords A keyword is a word that has special meaning in a language construct. All keywords are reserved by the language and may not be used as variables or label names.
MicroBasic Scripting Controller Configuration and Commands The following is a set of device functions for interacting with the Controller: SetConfig Set a configuration parameter SetCommand Send a Real Time command GetConfig Read a configuration parameter GetValue Read an operating value A set of similar commands are available for accessing/changing configurations, sending commands and reading operating values of remote nodes on CAN networks using the RoboCAN protocol.
MicroBasic Language Reference The following example illustrates how to declare Integer variable: Dim intVar As Integer Arrays declaration uses a different syntax, where you should specify the array length between square brackets []. Array length should be integer value greater than 1.
MicroBasic Scripting Else b = a End If ‘ Line If statement If a < b Then a = b Else b = a Below is an example where ElseIf takes place: If score >= 90 Then grade = 1 ElseIf score >= 80 Then grade = 2 ElseIf score >= 70 Then grade = 3 Else grade = 4 End If For...Next Statement Micro Basic contains two types of For...Next loops: • Traditional For...Next: Traditional For...Next exists for backward compatibility with Basic, but it is not recommended due to its inefficient execution. Traditional For...
MicroBasic Language Reference While/Do Statements • While...End While Statement While End While Example: a = 10 While a > 0 Print(“a = “, a, “\n”) a-End While Print(“Loop ended with a = “, a, “\n”) • Do While...Loop Statement Do While Loop The Do While...Loop statement is the same as functionality of the While... End While statement but uses a different syntax. a = 10 Do While a > 0 Print(“a = “, a, “\n”) a-Loop Print(“Loop ended with a = “, a, “\n”) • Do Until.
MicroBasic Scripting a = 10 Do Print(“a = “, a, “\n”) a-Loop While a > 0 Print(“Loop ended with a = “, a, “\n”) • Do...Loop Until Statement Do Loop Until Unlike Do...Loop While statement, Do...Loop Until statement exist the loop when the expression evaluates to true. a = 10 Do Print(“a = “, a, “\n”) a-Loop Until a = 0 Print(“Loop ended with a = “, a, “\n”) Terminate Statement The Terminate statement ends the execution of the program.
MicroBasic Language Reference The following is an example of how to use Continue statement in While loop: While a > 0 If b = 0 Then Continue While End While GoTo Statement A GoTo statement causes execution to transfer to the specified label. GoTo keyword should be followed by the label name. GoTo
MicroBasic Scripting ToBool Statement Converts the given expression into boolean value. It will be return False if expression evaluates to zero, True otherwise. ToBool() Consider the following example: Print(ToBool(a), “\n”) The previous example will output False if value of a equals to zero, True otherwise. Print Statement Output the list of expression passed. Print({str | expression | ToBool()}[,{str | expression | ToBool()}]...
MicroBasic Language Reference Mod Operator The modulus operator (Mod) computes the remainder after dividing its first operand by its second. expression Mod expression And Operator The (And) operator functions only as a binary operator. For numbers, it computes the bitwise AND of its operands. For boolean operands, it computes the logical AND for its operands; that is the result is true if and only if both operands are true.
MicroBasic Scripting The first form is a prefix increment operation. The result of the operation is the value of the operand after it has been incremented. The second form is a postfix increment operation. The result of the operation is the value of the operand before it has been incremented. a = 10 Print(a++, “\n”) Print(a, “\n”) Print(++a, “\n”) Print(a, “\n”) The output of previous program will be the following: 10 11 12 12 -- Operator The decrement operator (--) decrements its operand by 1.
MicroBasic Language Reference >> Operator The right-shift operator (>>) shifts its first operand right by the number of bits specified by its second operand. expression >> expression <> Operator The inequality operator (<>) returns false if its operands are equal, true otherwise. expression <> expression < Operator Less than relational operator (<) returns true if the first operand is less than the second, false otherwise.
MicroBasic Scripting is equivalent to x = x + y -= Operator The subtraction assignment operator. var -= expression An expression using the -= assignment operator, such as x -= y is equivalent to x= x-y *= Operator The multiplication assignment operator. var *= expression An expression using the *= assignment operator, such as x *= y is equivalent to x = x * y /= Operator The division assignment operator.
MicroBasic Language Reference is equivalent to x = x << y >>= Operator The right-shift assignment operator. var >>= expression An expression using the >>= assignment operator, such as x >>= y is equivalent to x = x >> y [ ] Operator Square brackets ([]) are used for arrays (see Arrays on page 198). Abs Function Returns the absolute value of an expression. Abs() Example: a = 5 b = Abs(a – 2 * 10) Atan Function Returns the angle whose arc tangent is the specified number.
MicroBasic Scripting Abs() Example: value = Cos(0) ‘1000 [title] Sin Function Returns the sine of the specified angle. The return value is multiplied by 1000. Sin() Example: value = Sin(90) ‘1000 Sqrt Function Returns the square root of a specified number. The return value is multiplied by 1000. Sqrt() Example: value = Sqrt(2) ‘1414 GetValue This function is used to read operating parameters from the controller at runtime.
MicroBasic Language Reference SetConfig / GetConfig These two functions are used to read or/and change one of the controller’s configuration parameters at runtime. The changes are made in the controller’s RAM and take effect immediately. Configuration changes are not stored in EEPROM. SetConfig Set a configuration parameter GetConfig Read a configuration parameter Both commands require a Configuration Item, and an optional Index as parameters.
MicroBasic Scripting Replace entire sentence with: Where: : 0 - 4 for old controller models 0 - 7 for new controller models : 0 - Timer Running 1 - Timer has completed/stopped (reached 0ms) Sending RoboCAN Commands and Configuration Sending commands or configuration values to remote nodes on RoboCAN is done using the functions. SetCANCommand(, , , ) SetCANConfig(, , , ) Where: id is the remote Node Id in decimal. cc is the Command code, eg. _G.
MicroBasic Language Reference RoboCAN Continuous Scan A scan of a remote RoboCAN node is initiated with the function. ScanCANValue(, , , , ) Where: id is the remote Node Id in decimal. cc is the Query code, eg. _V. cc is the channel number. Put 1 for commands that do not normally require a channel number. tt is the scan rate in ms. bb is the buffer location. The scan rate can be up to 255ms. Setting a scan rate of 0 stops the automatic sending from this node.
MicroBasic Scripting 216 Advanced Digital Motor Controller User Manual V1.
Commands Types Commands Reference SECTION 19 This section lists all the commands accepted by the controller. Commands are typically sent via the serial (RS232 or USB) ports (See “Serial (RS232/USB) Operation” on page 141). Except for a few maintenance commands, they can also be issued from within a user script written using the MicroBasic language (See “MicroBasic Scripting” on page 179).
Commands Reference Set/Read Configuration commands These start with “~” for read and “^” for write when called via the serial communication (RS232 or USB), or using the getconfig() and setconfig() MicroBasic functions. They are used to read or configure all the operating parameters of the controller (e.g. set or read amps limit). See “Set/Read Configuration Commands” on page 218 for the full list and description of these commands.
Runtime Commands AC - Set Acceleration Alias: ACCEL HexCode: 07 CANOpen id: 0x2006 Description: Set the rate of speed change during acceleration for a motor channel. This command is identical to the MACC configuration command but is provided so that it can be changed rapidly during motor operation. Acceleration value is in 0.1 * RPM per second. When using controllers fitted with encoder, the speed and acceleration value are actual RPMs.
Commands Reference Syntax Scripting: setcommand(_AX, cc, nn) setcommand(_NXTACC, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Acceleration Type: Signed 32-bit Min: 0 Max: 500000 Where: cc = Motor channel nn = Acceleration value in 0.1 * RPM/s B - Set User Boolean Variable Alias: BOOL HexCode: 16 CANOpen id: 0x2015 Description: Set the state of user boolean variables inside the controller.
Runtime Commands BND - Mutli-purpose Bind Alias: BIND HexCode: 1C CANOpen id: Description: This command is used to perform a, usually, one-time setup in several situations. When the controller is configured in sinusoidal mode for brushless motor and encoder feedback, !BND will energize the motor to a reference position and set the encoder counter to the zero degree reference angle that will remain active until power down.
Commands Reference Argument 1: Channel Min: 1 Max: Total Number of Encoders Argument 2: Value Type: Signed 32-bit Min: -2147M Max: +2147M Where: cc = Motor channel nn = Counter value Example: !C 2 -1000 : Loads -1000 in encoder counter 2 !C 1 0 : Clears encoder counter 1 CB - Set Brushless Counter Alias: SBLCNTR HexCode: 05 CANOpen id: 0x2004 Description: This command loads the brushless counter with the value contained in the command argument.
Runtime Commands Description: This command is identical to the G (GO) command except that it is meant to be used for sending motor commands via CANOpen.
Commands Reference Where: ee = 1 : Header 2 : Bytecount 3 to 10 : Data0 to data7 nn = value Example: !CS 1 5 : Enter 5 in header !CS 3 2 : Enter 2 in data 0 !CS 4 3 : Enter 3 in data 1 !CS 2 2 : Enter 2 in bytecount and send CAN frame D0 - Reset Individual Digital Out bits Alias: DRES HexCode: 09 CANOpen id: 0x200A Description: The D0 command will turn off the single digital output selected by the number that follows.
Runtime Commands Syntax Serial: !D1 nn Syntax Scripting: setcommand(_D1, nn) setcommand(_DSET, nn) Number of Arguments: 1 Argument 1: OutputNbr Min: 1 Type: Unsigned 8-bit Max: Total number of Digital Outs Where: nn = Output number Example: !D1 1 : will activate output 1 Note: Digital Outputs are Open Collector. Activating an outputs will force it to ground. Deactivating an output will cause it to float.
Commands Reference Where: cc = Motor channel nn = Deceleration value in 0.1 * RPM/s Example: !DC 1 2000 : Reduce Motor 1 speed by 200 RPM every second if speed is measured by encoder !DC 2 20000 : Time from full power to stop is 0.5s if no speed sensors are present and Max RPM is set to 1000 DS - Set all Digital Out bits Alias: DOUT HexCode: 09 CANOpen id: 0x2008 Description: The D command will turn ON or OFF one or many digital outputs at the same time.
Runtime Commands decceleration the controller will use and becomes active upon reaching a previous desired position. If omitted, the command will be chained using the last used decceleration value.
Commands Reference EX - Emergency Stop Alias: ESTOP HexCode: 0E CANOpen id: 0x200C Description: The EX command will cause the controller to enter an emergency stop in the same way as if hardware emergency stop was detected on an input pin. The emergency stop condition will remain until controller is reset or until the MG release command is received.
Runtime Commands Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Value Type: Signed 32-bit Min: -1000 Max: 1000 Where: cc = Motor channel nn = Command value Example: !G 1 500 : In Open Loop Speed mode, applies 50% power to motor channel 1 !G 1 500 : In Closed Loop Speed mode, assuming that 3000 is contained in Max RPM parameter (MXRPM), motor will go to 1500 RPM !G 1 500 : In Closed Loop Relative or Closed Loop Tracking modes, the motor will move to 75% posit
Commands Reference MG - Emergency Stop Release Alias: MGO HexCode: 0F CANOpen id: 0x200D Description: The MG command will release the emergency stop condition and allow the controller to return to normal operation.
Runtime Commands Syntax Serial: !P [cc] nn Syntax Scripting: setcommand(_P, cc, nn) setcommand(_MOTPOS, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Destination Type: Signed 32-bit Min: -2147M Max: +2147M Where: cc = Motor channel nn = Absolute count destination Example: !P 1 10000 : make motor go to absolute count value 10000.
Commands Reference !PR 2 10000 : while previous command was absolute goto position !P 2 5000, motor will go to +15000 Note: Beware that counter will rollover at counter values +/-2’147’483’648. PRX - Next Go to Relative Desired Position Alias: NXTPOSR HexCode: 13 CANOpen id: 0x2011 Description: This command is similar to PR except that it stores a relative count value in a buffer.
Runtime Commands Syntax Scripting: setcommand(_PX, nn, cc) setcommand(_NXTPOS, nn, cc) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Delta Type: Signed 32-bit Min: -2147M Max: +2147M Where: cc = Motor channel nn = Absolute count position Example: !P 1 5000 followed by !PX 1 -10000 : will cause motor to go to count position 5000 and upon reaching the destination move to position -10000.
Commands Reference RC - Set Pulse Out Alias: RCOUT HexCode: 1A CANOpen id: 0x2016 Description: Set the pulse widht on products with pulse outputs. Command ranges from -1000 to +1000, resulting in pulse widht of 1.0ms to 1.5ms respectively.
Runtime Commands Where: cc = Motor channel nn = Speed value in RPM Example: !S 2500 : set motor 1 position velocity to 2500 RPM SX - Next Velocity Alias: NXTVEL HexCode: 17 CANOpen id: 0x2014 Description: This command is used in Position Count mode. It is similar to S except that it stores a velocity value in a buffer. This value will become the next velocity the controller will use and becomes active upon reaching a previous desired position.
Commands Reference Syntax Scripting: setcommand(_VAR, nn, mm) setcommand(_VAR, nn, mm) Number of Arguments: 2 Argument 1: VarNbr Min: 1 Max: Total nbr of User Variables Argument 2: Value Min: -2147M Type: Signed 32-bit Max: 2147M Where: nn = Variable number mm = Value Runtime Queries Runtime queries can be used to read the value of real-time measurements at any time during the controller operation. Real-time queries are very short commands that start with “?” followed by one to three letters.
Runtime Queries TABLE 19-2.
Commands Reference TABLE 19-2.
Runtime Queries Amps and calculate the Motor Amps. The measured Amps is always more precise than the calculated Amps. See controller datasheet to find which Amps is measured by your particular model. AI - Read Analog Inputs Alias: ANAIN HexCode: 10 CANOpen id: 0x6401 Description: Reports the raw value in mV of each of the analog inputs that are enabled. Input that is disabled will report 0.
Commands Reference Where: cc = Analog Input number nn = Converted analog input value +/-1000 range ANG - Read Rotor Angle Alias: ANG HexCode: 42 CANOpen id: 0x2132 Description: On brushless controller operating in sinusoidal mode, this query returns the real time value of the rotor’s angle sensor of brushless motor. This query is useful for verifying troubleshooting sin/cos and SPI/SSI sensors. Angle are reported in 0-511 degrees.
Runtime Queries Where: cc = 1 : Sin input 1 2 : Cos input 1 3 : Sin input 2 4 : Cos input 2 nn = ADC value B - Read User Boolean Variable Alias: BOOL HexCode: 16 CANOpen id: 0x6407 Description: Read the value of boolean internal variables that can be read and written to/from within a user MicroBasic script. It is used to pass boolean states between user scripts and a microcomputer connected to the controller.
Commands Reference Syntax Scripting: result = getvalue(_BA, cc) result = getvalue(_BATAMPS, cc) Reply: BA=aa Type: Signed 16-bit Min: 0 Where: cc = Motor channel aa = Amps *10 for each channel Example: Q: ?BA R: BA=100:200 Note: Some controller models measure the Motor Amps and Calculate the Battery Amps, while other models measure the Battery Amps and calculate the Motor Amps. The measured Amps is always more precise than the calculated Amps.
Runtime Queries Syntax Serial: ?BS [cc] Argument: Channel Min: 1 Max: Total Number of Motors Syntax Scripting: result = getvalue(_BS, cc) result = getvalue(_BLSPEED, cc) Reply: BS=nn Type: Signed 16-bit Min: -32768 Max: 32767 Where: cc = Motor channel nn = Speed in RPM BSR - Read BL Motor Speed as 1/1000 of Max RPM Alias: BLRSPEED HexCode: 0B CANOpen id: 0x210B Description: On brushless motor controllers, returns the measured motor speed as a ratio of the Max RPM configuration parameter.
Commands Reference Syntax Serial: ?C [cc] Argument: Channel Min: 1 Max: Total Number of Encoders Syntax Scripting: result = getvalue(_C, cc) result = getvalue(_ABCNTR, cc) Reply: C=nn Type: Signed 32-bit Min: -2147M Max: 2147M Where: cc = Encoder channel number nn = Absolute counter value CAN - Read Raw CAN frame Alias: CAN HexCode: 27 CANOpen id: Description: This query is used in CAN-enabled controllers to read the content of a received CAN frame in the RawCAN mode.
Runtime Queries Example: Q: ?CAN R: CAN=5:4:11:12:13:14:0:0:0:0 Q: ?CAN 3 R: CAN=11 CB - Read Absolute Brushless Counter Alias: BLCNTR HexCode: 05 CANOpen id: 0x2105 Description: On brushless motor controllers, returns the running total of Hall sensor transition value as an absolute number. The counter is 32-bit with a range of +/- 2147483648 counts.
Commands Reference Reply: CF=nn Type: Unsigned 8-bit Min: 0 Max: 16 Where: nn = Number of frames in receive queue CIA - Read Converted Analog Command Alias: CMDANA HexCode: 1A CANOpen id: 0x2117 Description: Returns the motor command value that is computed from the Analog inputs whether or not the command is actually applied to the motor. The Analog inputs must be configured as Motor Command.
Runtime Queries Syntax Serial: ?CIP [cc] Argument: Channel Min: 1 Max: Total Number of Motors Syntax Scripting: result = getvalue(_CIP, cc) result = getvalue(_CMDPLS, cc) Reply: CIP=nn Type: Signed 32-bit Min: -1000 Max: 1000 Where: cc = Motor channel nn = Command value in +/-1000 range CIS - Read Internal Serial Command Alias: CMDSER HexCode: 19 CANOpen id: 0x2116 Description: Returns the motor command value that is issued from the serial input or from a MicroBasic script whether or not t
Commands Reference done information. E.g. bits 0-3 of first number is for node 0, bits 8-11 of first number is for node 2, bits 4-7 of second number is for node 5 and bits 12-15 of fourth number is for node 11, etc. Syntax Serial: ?CL nn Argument: Group Min: 1 Max: 16 Syntax Scripting: result = getvalue(_CL, nn) result = getvalue(_CALIVE, nn) Reply: CL=mm Type: Unsigned 32-bit Min: 0 Max: 4194M Where: nn = 1 : nodes 0-3 2 : nodes 4-7 ... ...
Runtime Queries Reply: CR=nn Type: Signed 32-bit Min: -2147M Max: 2147 Where: cc = Motor channel nn = Counts since last read using ?CR D - Read Digital Inputs Alias: DIGIN HexCode: 0E CANOpen id: 0x210E Description: Reports the status of each of the available digital inputs. The query response is a single digital number which must be converted to binary and gives the status of each of the inputs.
Commands Reference Syntax Scripting: result = getvalue(_DI, cc) result = getvalue(_DIN, cc) Reply: DI=nn Type: Boolean Min: 0 Max: 1 Where: cc = Digital Input number nn = 0 or 1 state for each input Example: Q: ?DI R: DI=1:0:1:0:1:0 Q: ?DI 1 R: DI=0 DO - Read Digital Output Status Alias: DIGOUT HexCode: 17 CANOpen id: 0x6408 Description: Reads the actual state of all digital outputs.
Runtime Queries buffer have become active. The Destination Reached bit is latched and is cleared once it has been read.
Commands Reference Description: Reports the value of the feedback sensors that are associated to each of the channels in closed-loop modes. The feedback source can be Encoder, Analog or Pulse. Selecting the feedback source is done using the encoder, pulse or analog configuration parameters. This query is useful for verifying that the correct feedback source is used by the channel in the closed-loop mode and that its value is in range with expectations.
Runtime Queries FF - Read Fault Flags Alias: FLTFLAG HexCode: 15 CANOpen id: 0x6406 Description: Reports the status of the controller fault conditions that can occur during operation. The response to that query is a single number which must be converted into binary in order to evaluate each of the individual status bits that compose it. Syntax Serial: ?FF Argument: None Syntax Scripting: result = getvalue(_FF, 1) result = getvalue(_FLTFLAG, 1) Reply: FF = f1 + f2*2 + f3*4 + ...
Commands Reference Reply: FID=ss Type: String Where: ss = Firmware ID string Example: Q: ?FID R: FID=Roboteq v1.6 RCB500 05/01/2016 FM - Read Runtime Status Flag Alias: MOTFLAG HexCode: 30 CANOpen id: 0x2122 Description: Report the runtime status of each motor. The response to that query is a single number which must be converted into binary in order to evaluate each of the individual status bits that compose it.
Runtime Queries FS - Read Status Flags Alias: STFLAG HexCode: 14 CANOpen id: 0x6405 Description: Report the state of status flags used by the controller to indicate a number of internal conditions during normal operation. The response to this query is the single number for all status flags. The status of individual flags is read by converting this number to binary and look at various bits of that number.
Commands Reference Argument: Channel Min: 1 Max: Total Number of Motors Syntax Scripting: result = getvalue(_HS, cc) result = getvalue(_HSENSE, cc) Reply: HS= ha + 2*hb + 4*hc Type: Unsigned 8-bit Min: 0 Max: 7 Where: cc = channel ha = hall sensor A hb = hall sensor B hc = hall sensor C Example: Q: ?HS 1 R: HS=5 : sensors A and C are high, sensor B is low Note: Function not available on HBLxxxxx products ICL - Is RoboCAN Node Alive Alias: ICL HexCode: 46 CANOpen id: Description: This query
Runtime Queries Description: On controller models with Spektrum radio support, this query is used to read the raw values of each of up to 6 receive channels. When signal is received, this query returns the value 0.
Commands Reference M - Read Motor Command Applied Alias: MOTCMD HexCode: 01 CANOpen id: 0x2101 Description: Reports the command value that is being used by the controller. The number that is reported will be depending on which mode is selected at the time. The choice of one command mode vs. another is based on the command priority mechanism. In the RS232 mode, the reported value will be the command that is entered in via the RS232 or USB port and to which an optional exponential correction is applied.
Runtime Queries Syntax Scripting: result = getvalue(_MA, nn) result = getvalue(_MEMS, nn) Reply: MA=mm Type: Signed 16-bit Where: nn = 1 : Flux Amps 1 (Id) 2 : Torque Amps 1 (Iq) 3 : Flux Amps 2 (Id) 4 : Torque Amps 2 (Iq) mm = Amps * 10 MGD - Read Magsensor Track Detect Alias: MGDET HexCode: 29 CANOpen id: 0x211D Description: When one or more MGS1600 Magnetic Guide Sensors are connected to the controller, this query reports whether a magnetic tape is within the detection range of the sensor.
Commands Reference MGM - Read Magsensor Markers Alias: MGMRKR HexCode: 2B CANOpen id: 0x211F Description: When one or more MGS1600 Magnetic Guide Sensors are connected to the controller, this query reports whether left or right markers are present under sensor.If only one sensor is connected to any pulse input this query will report the data of that sensor, regardless which pulse input it is connected to.
Runtime Queries Syntax Scripting: result = getvalue(_MGS, ) result = getvalue(_MGSTATUS, ) Reply: MGS=f1 + f2*2 + f3*4 + ... + fn*2n-1 Type: Unsigned 16-bit Where: cc = (When only one sensor enabled) None or 1 : Current sensor cc = (When only several sensors enabled) 1 : Sensor at pulse input 1 2 : Sensor at pulse input 2 ...
Commands Reference 1 : Left Track of sensor at pulse input 1 2 : Right Track of sensor at pulse input 1 3 : Active Track of sensor at pulse input 1 4 : Left Track of sensor at pulse input 2 5 : Right Track of sensor at pulse input 2 6 : Active Track of sensor at pulse input 2 ...
Runtime Queries Description: Reports the actual PWM level that is being applied to the motor at the power output stage. This value takes into account all the internal corrections and any limiting resulting from temperature or over current. A value of 1000 equals 100% PWM. The equivalent voltage at the motor wire is the battery voltage * PWM level.
Commands Reference Syntax Scripting: result = getvalue(_PI, cc) result = getvalue(_PLSIN, cc) Reply: PI=nn Type: Unsigned 16-bit Min: 0 Max: 65536 Where: cc = Pulse capture input number nn = Value Note: The total number of Pulse input channels varies from one controller model to another and can be found in the product datasheet.
Runtime Queries Description: Reports the actual speed measured by the encoders as the actual RPM value.
Commands Reference Description: Returns the measured motor speed as a ratio of the Max RPM (MXRPM) configuration parameter. The result is a value of between 0 and +/1000. As an example, if the Max RPM is set at 3000 inside the encoder configuration parameter and the motor spins at 1500 RPM, then the returned value to this query will be 500, which is 50% of the 3000 max. Note that if the motor spins faster than the Max RPM, the returned value will exceed 1000.
Runtime Queries 3 : Channel 2 side tt = temperature in degrees Note: On some controller models, additional temperature values may reported. These are measured at different points and not documented. You may safely ignore this extra data. Other controller models only have one heatsink temperature sensor and therefore only report one value in addition to the Internal IC temperature.
Commands Reference Syntax Serial: ?TR [cc] Argument: Channel Min: 1 Max: Total Number of Motors Syntax Scripting: result = getvalue(_TR, cc) result = getvalue(_TRACK, cc) Reply: TR=nn Type: Signed 32-bit Min: -2147M Max: 2147M Where: cc = Motor channel nn = Position TRN - Read Control Unit type and Controller Model Alias: TRN HexCode: 1F CANOpen id: Description: Reports two strings identifying the Control Unit type and the Controller Model type.
Runtime Queries Description: Reports MCU specific information. This query is useful for determining the type of MCU: 100 = STM32F10X, 300 = STM32F30X. The query also produces a unique Id number that is stored on the MCU silicon.
Commands Reference Where: ee = 1 : Internal volts 2 : Battery volts 3 : 5V output nn = Volts * 10 for internal and battery volts. Milivolts for 5V output Example: Q: ?V R:V=135:246:4730 Q: ?V 3 R:V=4730 VAR - Read User Integer Variable Alias: VAR HexCode: 06 CANOpen id: 0x2106 Description: Read the value of dedicated 32-bit internal variables that can be read and written to/from within a user MicroBasic script.
Query History Commands Reply: SL=nn Type: Signed 16-bit Min: -32768 Max: 32768 Where: cc = Motor channel nn = Slip Frequency in Hertz * 10 Query History Commands Every time a Real Time Query is received and executed, it is stored in a history buffer from which it can be recalled. The buffer will store up to 16 queries. If more than 16 queries are received, the new one will be added to the history buffer while the firsts are removed in order to fit the 16 query buffer.
Commands Reference # C - Clear Buffer History This command will clear the history buffer of all queries that may be stored in it. If the controller was in the process of automatically sending queries from the buffer, then receiving this command will also cause the sending to stop Syntax: #C Reply: None # nn - Start Automatic Sending This command will initiate the automatic retrieving and execution of queries from the history buffer.
Maintenance Commands CLMOD - Calibrate Sin/Cos sensors Argument: Key Description: This command is used to enter the calibration mode for sin/cos sensors on brushless motor controllers. After calibration is complete, the sensor data must be saved using the %CLSAV command.
Commands Reference Description: Firmware update can be performed via the RS232 port or via USB. When done via USB, the DFU command is used to cause the controller to enter in the firmware upgrade mode. This command must be used with care and must be followed by a 9-digit safety key to prevent accidental use. Once the controller has received the DFU command, it will no longer respond to the PC utility and no longer be visible on the PC.
Maintenance Commands LK - Lock Configuration Access Argument: Key Description: This command is followed by any user-selected secret 32-bit number. After receiving it, the controller will lock the configuration and store the key inside the controller, in area which cannot be accessed. Once locked, the controller will no longer respond to configuration reads. However, it is still possible to store or to set new configurations.
Commands Reference number of seconds from a preset day and time is stored (for example 02/01/00 at 3:00). On newer model, the clock contains 6 registers for seconds, dates, minuted, hours, dayofmonth, month, year. The command syntax will be different for each of these models.
Set/Read Configuration Commands ^PWM 180 : Sets PWM frequency to 18.0 kHz ^OVL 400 : Sets Overvoltage limit to 40.0V Other parameters have multiple value, with typically one value applying to a different channel. Multiple value parameters are numbered from 1 to n. For example, Amps limit for a motor channel or the configuration of an analog input channel. ^ALIM 1 250 : Sets Amps limit for channel 1 to 25.
Commands Reference Configuration Read Protection The controller may be locked to prevent the configuration parameters to be read. Given the large number of possible configurations, this feature provides effective system-level copy protection. The controller will reply to configuration read requests only if the read protection is unlocked. If locked, the controller will respond a “-” character.
General Configuration and Safety Syntax Serial: ^ACS nn ~ACS Syntax Scripting: setconfig(_ACS, nn) Number of Arguments: 1 Argument 1: Enable Type: Unsigned 8-bit Min: 0 Default: 1 Max: 1 Where: nn = 0: Safety disabled 1: Safety enabled AMS - Analog within Min & Max Safety HexCode: 0C Description: This configuration is used to make sure that the analog input command is always within a user preset minimum and maximum safe value.
Commands Reference BEE - User Storage in Battery Backed RAM HexCode: 64 Description: Store and retrieve user data in battery backed RAM. Storage is quasi permanent, limited only by the on-board battery (usually several years) . Unlike storage in Flash using the EE configuration commands, there are no limits in the amount or frequency of read and write cycles with BEE. This feature is only available on selected models, see product datasheet.
General Configuration and Safety Syntax Scripting: setconfig(_BRUN, nn) Number of Arguments: 1 Argument 1: Enable Type: Unsigned 8-bit Min: 0 Default: 0 = Disabled Max: 2 Where: nn = 0: Disabled 1: Enabled after 2 seconds 2: Enabled immediately CLIN - Command Linearity HexCode: 0D Description: This parameter is used for applying an exponential or a logarithmic transformation on the command input, regardless of its source (serial, pulse or analog). There are 3 exponential and 3 logarithmic choices.
Commands Reference nn = 0: Linear (no change) 1: Exp weak 2: Exp medium 3: Exp strong 4: Log weak 5: Log medium 6: Log strong Example: ^CLIN 1 1 : Sets linearity for channel 1 to exponential weak CPRI - Command Priorities HexCode: 07 Description: This parameter contains up to 3 variables (4 on controllers with Spektrum radio support) and is used to set which type of command the controller will respond in priority and in which order.
General Configuration and Safety Example: ^CPRI 1 2 : Set Analog as first priority ~CPRI 2 : Read what command mode is second priority Note: USB, RS232, CAN and Microbasic commands share the “Serial” type. When serial commands come from different Serial source, they are executed in the order received. DFC - Default Command value HexCode: 0E Description: The default command values are the command applied to the motor when no valid command is fed to the controller.
Commands Reference Description: This command is used to disable/enable the echo on the serial or USB port. By default, the controller will echo everything that enters the serial communication port. By setting ECHOF to 1, commands are no longer being echoed. The controller will only reply to queries and the acknowledgements to commands can be seen.
General Configuration and Safety Argument 2: Data Type: Signed 16-bit Min: -32768 Default: 0 Max: +32767 Where: aa = Address dd = Data Example: ^EE 1 555 : Store value 555 in RAM location 1 %EESAV or !EES : Copy data from temporary RAM to Flash ~EE 1 : Read data from RAM location 1 Note: See product datasheet to know the total available EE storage. Do not transfer to Flash with %EESAV or !EES at high frequency as the number of write cycles to Flash are limited to around 10000.
Commands Reference 2: 38400 3:19200 4: 9600 5: 115200 + Inverted RS232 6: 57600 + Inverted RS232 7: 38400 + Inverted RS232 8: 19200 + Inverted RS232 9: 9600 + Inverted RS232 Example: ^RSBR 3 : sets baud rate at 19200 Note: This configuration can only be changed while connected via USB or via scripting. After the baud rate has been changed, it will not be possible to communicate with the Roborun PC utility using the srial port until the rate is changed back to 115200.
General Configuration and Safety SCRO - Select Print output port for scripting HexCode: 5E Description: Selects which port the print statement sends data to. When 0, the last port which received a valid character will be the one the script outputs to.
Commands Reference Where: cc = Channel nn = Center value SKDB - Spektrum Deadband HexCode: 54 Description: Sets the deadband value for the Spektrum channel. It is defined as the percent number from 0 to 50% and defines the amount of movement from joystick or sensor around the center position before its converted value begins to change.
General Configuration and Safety Syntax Scripting: setconfig(_SKLIN, cc) Number of Arguments: Argument 1: Channel Min: 1 Max: 2 Type: Unsigned 8-bit Min: 0 Default: 0 = Linear Max: 6 Argument 2: Linearity Where: cc = Input channel number nn = 0 : linear (no change) 1: exp weak 2: exp medium 3: exp strong 4: log weak 5: log medium 6: log strong SKMAX - Spektrum Max HexCode: 52 Description: Value captured from Spektrum radio that will be considered as +1000 command Syntax Serial: ^SKMAX cc nn ~SKMAX
Commands Reference SKMIN - Spektrum Min HexCode: 51 Description: Value captured from Spektrum radio that will be considered as -1000 command Syntax Serial: ^SKMIN cc nn ~SKMIN [cc] Syntax Scripting: setconfig(_SKMIN, cc) Number of Arguments: Argument 1: Channel Min: 1 Max: 2 Type: Unsigned 16-bit Min: 0 Default: 0 Max: 1024 Argument 2: Min Where: cc = Channel nn: Min value SKUSE - Assign Spektrum port to motor command HexCode: 50 Description: Chose which of the 6 joysticks from the Spektrum RC rece
General Configuration and Safety Argument 2: Port Type: Unsigned 8-bit Min: 1 Max: 6 Where: cc = Channel number nn = Radio port TELS - Telemetry String HexCode: 47 Description: This parameter command lets you enter the telemetry string that will be used when the controller starts up. The string is entered as a series of queries characters between a beginning and an ending quote. Queries must be separated by “:” colon characters.
Commands Reference Analog, Digital, Pulse IO Configurations These parameters configure the operating mode and how the inputs and outputs work. TABLE 19-6.
Analog, Digital, Pulse IO Configurations Syntax Scripting: setconfig(_ACTR, cc, nn) Number of Arguments: 2 Argument 1: InputNbr Min: 1 Max: Total Number of Analog Inputs Argument 2: Center Type: Unsigned 16-bit Min: 0 Default: 2500 mV Max: 10000 Where: cc = Analog input channel nn = 0 to 10000mV Example: ^ACTR 3 2000 : Set Analog Input 3 Center to 2000mV Note: Center value must always be a number greater of equal to Min, and smaller or equal to Max Make the center value the same as the min value in ord
Commands Reference Argument 2: Deadband Type: Unsigned 8-bit Min: 0 Default: 5 = 5% Max: 50 Where: cc = Analog input channel nn = Deadband in % Example: ^ADB 6 10 : Sets Deadband for channel 6 at 10% Note: Deadband is not used when input is used as feedback AINA - Analog Input Use HexCode: 19 Description: This parameter selects whether an input should be used as a command feedback or left unused.
Analog, Digital, Pulse IO Configurations mm = mot1*16 + mot2*32 + mot3*48 Example: ^AINA 1 17: Sets Analog channel 1 as command for motor 1. I.e. 17 = 1 (command) +16 (motor 1) ALIN - Analog Linearity HexCode: 18 Description: This parameter is used for applying an exponential or a logarithmic transformation on an analog input. There are 3 exponential and 3 logarithmic choices.
Commands Reference AMAX - Set Analog Input Max Range HexCode: 15 Description: This parameter sets the voltage that will be considered as the maximum command value. The min, max and center are useful to set the range of a joystick or of a feedback sensor. Internally to the controller, commands and feedback values are converted to -1000, 0, +1000.
Analog, Digital, Pulse IO Configurations Syntax Serial: ^AMAXA cc (aa + mm) ~AMAXA [cc] Syntax Scripting: setconfig(_AMAXA, cc, aa) Number of Arguments: 2 Argument 1: InputNbr Min: 1 Max: Total Number of Analog In- Type: Unsigned 8-bit Min: 0 Default: 0 = No action Max: 255 puts Argument 2: Action Where: cc = Analog input channel aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counte
Commands Reference Number of Arguments: 2 Argument 1: InputNbr Min: 1 Max: Total Number of Analog In- Type: Unsigned 16-bit Min: 0 Default: 100 mV Max: 10000 puts Argument 2: Min Where: cc = Analog input channel nn = 0 to 10000mV Example: ^AMIN 5 250 : Set Analog Input 5 Min to 250mV Note: Analog input can capture voltage up to around 5.2V.
Analog, Digital, Pulse IO Configurations Where: cc = Analog input channel aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32 + mot3*48 Example: ^AMINA 2 33 : Stops motor 2. I.e. 33 = 1 (safety stop) + 32 (motor2) AMOD - Enable and Set Analog Input Mode HexCode: 13 Description: This parameter is used to enable/disable an analog input pin.
Commands Reference nn = 0: Disabled 1: Absolute 2: Relative Example: ^AMOD 1 1 : Analog input 1 enabled in absolute mode APOL - Analog Input Polarity HexCode: 1C Description: Inverts the analog capture polarity value after conversion. When this configuration bit is cleared, the pulse capture is converted into a -1000 to +1000 command or feedback value. When set, the converted range is inverted to +1000 to -1000.
Analog, Digital, Pulse IO Configurations Syntax Serial: ^DINA cc (aa + [mm]) ~DINA [cc] Syntax Scripting: setconfig(_DINA, cc, aa) Number of Arguments: 2 Argument 1: InputNbr Min: 0 Max: Total Number of Digital Inputs Argument 2: Action Type: Unsigned 8-bit Min: 0 Default: 0 = No actions Max: 255 Where: cc = Input channel number aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter
Commands Reference Number of Arguments: 1 Argument 1: ActiveLevels Type: Unsigned 32-bit Min: 0 Max: 2 ^ Total Number of Digital Inputs Default: 0 = All Active high Where: cc = Digital input number aa= 0: Active High 1: Active Low Example: ^DINL 2 1 : Sets digital input 2 to active low DOA - Digital Output Action HexCode: 11 Description: This configuration parameter will set what will trigger a given output pin.
Analog, Digital, Pulse IO Configurations 1: Motor on 2: Motor reversed 3: Overvoltage 4: Overtemperature 5: Mirror status LED 6: No MOSFET failure Example: ^DOA 1 3 : Output 1 is active when Overvoltage is observed Note: Typical default configuration is Digital outputs 1 (2) are active when motor is on. Digital output 2 (3) when no MOSFET failure is detected.
Commands Reference Description: This defines the raw value of the measured pulse that would be considered as the 0 value inside the controller. The default value is 1500 which is the center position of the pulse in the RC radio mode.
Analog, Digital, Pulse IO Configurations Min: 0 Default: 5 = 5% Max: 50 Where: cc = Pulse input number nn = Deadband in % Note: Deadband is not used when input is used as feedback PINA - Pulse Input Use HexCode: 23 Description: This parameter selects whether an input should be used as a command feedback, position feedback or left unused. Embedded in the parameter is the motor channel that this command or feedback should act on.
Commands Reference Note: Input 1 is generally enabled and set as motor command on single channel motor controllers. Inputs 1 and 2 are enabled and set as motor command on dual channel controllers PLIN - Pulse Linearity HexCode: 22 Description: This parameter is used for applying an exponential or a logarithmic transformation on a pulse input. There are 3 exponential and 3 logarithmic choices.
Analog, Digital, Pulse IO Configurations Syntax Serial: ^PMAX cc nn ~PMAX [cc] Syntax Scripting: setconfig(_PMAX, cc, nn) Number of Arguments: 2 Argument 1: InputNbr Min: 1 Max: Total Number of Pulse Inputs Argument 2: Max Type: Unsigned 16-bit Min: 0 Default: 2000us Max: 65536 Where: cc = Pulse input number nn = 0 to 65536us PMAXA - Action on Pulse Max HexCode: 25 Description: This parameter configures the action to take when the max value that is defined in PMAX is reached.
Commands Reference aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32 + mot3*48 PMIN - Pulse Min Range HexCode: 1E Description: This sets the raw value of the pulse capture that would be considered as the -1000 internal value to the controller. The value is in number of microseconds (1000 = 1ms).
Analog, Digital, Pulse IO Configurations Description: This parameter selects what action should be taken if the minimum value that is defined in PMIN is reached. The list of action is the same as these of the DINA digital input actions. Embedded in the parameter is the motor channel(s) to which the action should apply.
Commands Reference and converted to a command or a feedback value in the range of -1000 to +1000 for use by the controller internally.
Motor Configurations PPOL - Pulse Input Polarity HexCode: 26 Description: Inverts the pulse capture value after conversion. When this configuration bit is cleared, the pulse capture is converted into a -1000 to +1000 command or feedback value. When set, the converted range is inverted to +1000 to -1000. Center value must always be a number greater of equal to Min, and smaller or equal to Max.
Commands Reference TABLE 19-7.
Motor Configurations Description: This is the maximum Amps that the controller will be allowed to deliver to a motor regardless the load of that motor. The value is entered in Amps multiplied by 10. The value is the Amps that are measured at the motor and not the Amps measured from a battery. When the motor draws current that is above that limit, the controller will automatically reduce the output power until the current drops below that limit.
Commands Reference Syntax Scripting: setconfig(_ATGA, cc, aa) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 10 Default: 0 = No action Max: 255 Argument 2: Action Where: cc = Motor channel aa = 0 : No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32 + mot3*48 ATGD - Amps Trigger Delay HexCode:
Motor Configurations Min: 0 Default: 500ms Max: 10000 Where: cc = Motor channel nn = Delay in ms Example: ^ATGD 1 1000: Action will be triggered if motor Amps exceeds the value set with ATGL for more than 1000ms ATRIG - Amps Trigger Level HexCode: 2B Description: This parameter lets you select Amps threshold value that will trigger an action. This threshold must be set to be below the ALIM Amps limit. When that threshold is reached, then list of action can be selected using the ATGA parameter.
Commands Reference Description: Set the delay in miliseconds from the time a motor stops and the time an output connected to a brake solenoid will be released. Applies to any Digital Ouput(s) that is configured as motor brake. Delay value applies to all motors in multi-channel products.
Motor Configurations Min: 0 Default: 0 = Other Sensor Max: 1 Where: cc = Motor channel nn = 0: Other feedback 1: Brushless sensor feedback (Hall, SPI, Sin/Cos) BLSTD - Stall Detection HexCode: 3A Description: This parameter controls the stall detection of brushless motors and of brushed motors in closed loop speed mode. If no motion is sensed (i.e.
Commands Reference CLERD - Close Loop Error Detection HexCode: 38 Description: This parameter is used to detect large tracking errors due to mechanical or sensor failures, and shut down the motor in case of problem in closed loop speed or position system. The detection mechanism looks for the size of the tracking error and the duration the error is present. This parameter allows three combination of time & error level.
Motor Configurations Description: Defines a maximum count value at which the controller will trigger an action when the counter goes above that number. This feature is useful for setting up virtual or “soft†limit switches .This value, together with the Low Count Limit, are also used in the position mode to determine the travel range when commanding the controller with a relative position command. In this case, the High Limit Count is the desired position when a command of 1000 is received.
Commands Reference Argument 2: Action Type: Unsigned 8-bit Min: 0 Default: 0 = No action Max: 255 Where: cc = Encoder channel aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32 + mot3*48 EHOME - Encoder Counter Load at Home Position HexCode: 4F Description: Contains a value that will be loaded in the selected encoder counter when a home switch
Motor Configurations ELL - Encoder Low Count Limit HexCode: 4B Description: Defines a minimum count value at which the controller will trigger an action when the counter dips below that number. This feature is useful for setting up virtual or “soft†limit switches.This value, together with the High Count Limit, are also used in the position mode to determine the travel range when commanding the controller with a relative position command.
Commands Reference Syntax Scripting: setconfig(_ELLA, cc, aa) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Encoders Type: Unsigned 8-bit Min: 0 Default: 0 = No action Max: 255 Argument 2: Action Where: cc = Encoder channel aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32 + mot3*48 EMOD - Encoder Usage HexCode: 49
Motor Configurations Argument 2: Use Type: Unsigned 8-bit Min: 0 Default: 0 = Unused Max: 255 Where: cc = Encoder channel aa = 0: Unused 1: Command 2: Feedback mm = mot1*16 + mot2*32 + mot3*48 Example: ^EMOD 1 18 = Encoder used as feedback for channel 1 EPPR - Encoder PPR Value HexCode: 4A Description: This parameter will set the pulse per revolution of the encoder that is attached to the controller. The PPR is the number of pulses that is issued by the encoder when making a full turn.
Commands Reference Example: ^EPPR 2 200 : Sets PPR for encoder 2 to 200 ICAP - PID Integral Cap HexCode: 32 Description: This parameter is the integral cap as a percentage. This parameter will limit maximum level of the Integral factor in the PID. It is particularly useful in position systems with long travel movement, and where the integral factor would otherwise become very large because of the extended time the integral would allow to accumulate.
Motor Configurations Syntax Scripting: setconfig(_KD, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 0 Default: 0 Max: 255 Argument 2: Gain Where: cc = Motor channel nn = Differential Gain *10 Example: ^KD 1 155: Set motor channel 1 Differential Gain to 15.5 Note: Do not use default values. As a starting point, se P=2, I=0, D=0 in position modes (including Speed Position mode).
Commands Reference Where: cc = Motor channel nn = Integral Gain *10 Example: ^KI 1 155: Set motor channel 1 Integral Gain to 15.5 Note: Do not use default values. As a starting point, se P=2, I=0, D=0 in position modes (including Speed Position mode). Use P=0, I=1, D=0 in closed loop speed mode and in torque mode. Perform full tuning after that. KP - PID Proportional Gain HexCode: 2E Description: Sets the PID’s Proportional Gain for that channel. The value is set as the gain multiplied by 10.
Motor Configurations On brushless motor controller with FOC support, KP is not used for torque control. A separate PID is used for current control MAC - Motor Acceleration Rate HexCode: 33 Description: Set the rate of speed change during acceleration for a motor channel. This command is identical to the AC realtime command. Acceleration value is in 0.1*RPM per second. When using controllers fitted with encoder, the speed and acceleration value are actual RPMs.
Commands Reference which itself is a user-provide number for the speed normally expected speed at full power. Assuming that the Max RPM parameter is set to 1000, and deceleration value of 10000 means that the motor will go from full speed to 0 1 second, regardless of the actual motor speed.
Motor Configurations Syntax Serial: ^MMOD cc nn ~MMOD [cc] Syntax Scripting: setconfig(_MMOD, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 0 Default: 0 = Open loop Max: 6 Argument 2: Mode Where: cc = Motor channel nn = 0: Open-loop 1: Closed-loop speed 2: Closed-loop position relative 3: Closed-loop count position 4: Closed-loop position tracking 5: Torque 6: Closed-loop speed position Example: ^MMOD 2 : Select Closed loop position r
Commands Reference Argument 2: Velocity Type: Signed 32-bit Min: 0 Default: 1000 RPM Max: 30000 Where: cc = Motor channel nn = Velocity value in RPM MXMD - Separate or Mixed Mode Select HexCode: 05 Description: Selects the mixed mode operation. It is applicable to dual channel controllers and serves to operate the two channels in mixed mode for tank-like steering. There are 3 possible values for this parameter for selecting separate or one of the two possible mixed mode algorithms.
Motor Configurations Syntax Serial: ^MXPF cc nn ~MXPF [cc] Syntax Scripting: setconfig(_MXPF, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 25 Default: 100% Max: 100 Argument 2: MaxPower Where: cc = Motor channel nn = Max Power MXPR - Motor Max Power Reverse HexCode: 29 Description: This parameter lets you select the scaling factor for the PWM output, in the reverse direction, as a percentage value.
Commands Reference MXRPM - Max RPM Value HexCode: 36 Description: Commands sent via analog, pulse or the !G command only range between -1000 to +1000. The Max RPM parameter lets you select which actual speed, in RPM, will be considered the speed to reach when a +1000 command is sent. In open loop, this parameter is used together with the acceleration and deceleration settings in order to figure the ramping time from 0 to full power.
Motor Configurations Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Turns Type: Signed 32-bit Min: 10 Max: 100000 Default: 10000 = 1000.0 turns Where: cc = Motor channel nn = Number of turns * 10 Example: ^MXTRN 1 2000: Set max turns for motor 1 to 200.0 turns OVH - Overvoltage hysteresis HexCode: 42 Description: This voltage gets subtracted to the overvoltage limit to set the voltage at which the overvoltage condition will be cleared.
Commands Reference OVL - Overvoltage Cutoff Limit HexCode: 02 Description: Sets the voltage level at which the controller must turn off its power stage and signal an Overvoltage condition. Value is in volts multiplied by 10 (e.g. 450 = 45.0V) . The power stage will turn back on when voltage dips below the Overvoltage Clearing threshold that is set with the the OVH configuration command.
Motor Configurations Argument 1: Frequency Type: Unsigned 16-bit Min: 100 Default: 160 = 16.0kHz Max: 500 Where: nn = PWM Frequency *10 Example: ^PWMF 200 := Set PWM frequency to 20kHz Note: Do not change the default PWM frequency when operating brushless motors in sinusoidal mode. THLD - Short Circuit Detection Threshold HexCode: 04 Description: This configuration parameter sets the threshold level for the short circuit detection. There are 4 sensitivity levels from 0 to 3.
Commands Reference UVL - Undervoltage Limit HexCode: 03 Description: Sets the voltage below which the controller will turn off its power stage. The voltage is entered as a desired voltage value multiplied by 10. Undervoltage condition is cleared as soon as voltage rises above the limit. Syntax Serial: ^UVL nn ~UVL Syntax Scripting: setconfig(_UVL, nn) Number of Arguments: 1 Argument 1: Voltage Type: Unsigned 16-bit Min: 50 = 5.0V Max: Max Voltage in Product Datasheet Default: 50 = 5.
Brushless Specific Commands TABLE 19-8.
Commands Reference Example: ^BADJ 1 220 : Manually set the zero to 220 degrees %CLSAV 3216549987 : Save change permanently to non-voltatile calibration memory space Note: Use %CLSAV to save the values to EEPROM. Clicking on Save to Controller on the PC Utility will not save the data. BADV - Brushless timing angle adjust HexCode: 61 Description: When operating in sinusoidal mode, this parameter shifts by number of degrees to the 3 phases rotating magnetic field.
Brushless Specific Commands Syntax Serial: ^BFBK cc nn ~BFBK [cc] Syntax Scripting: setconfig(_BFBK, cc) Number of Arguments: Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 0 Default: 0 = Encoder Max: 4 Argument 2: Sensor Where: cc = Motor channel nn = 0: Encoder 1: Hall 2: Hall + Encoder 3: SPI 4: Sin/Cos BHL - Brushless Counter High Limit HexCode: 3E Description: This parameter allows you to define a minimum brushless count value at which the controller will trig
Commands Reference Argument 2: Value Type: Signed 32-bit Min: -2147M Default: 20000 Max: +2147M Where: cc = Motor channel nn = Counter value Example: ^BHL 10000 : Set brushless counter high limit Note: Counter is not an absolute position. A homing sequence is necessary to set a reference position. BHLA - Brushless Counter High Limit Action HexCode: 40 Description: This parameter lets you select what kind of action should be taken when the high limit count is reached on the brushless counter.
Brushless Specific Commands 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32 + mot3*48 Example: ^BHLA 1 36 : Forward limit switch for motor 2 (5 + 32) BHOME - Brushless Counter Load at Home Position HexCode: 3C Description: This parameter contains a value that will be loaded in the brushless hall sensor counter when a home switch is detected, or when a Home command is received from the serial/ USB, or issued
Commands Reference BLL - Brushless Counter Low Limit HexCode: 3D Description: This parameter defines a minimum brushless count value at which the controller will trigger an action when the counter dips below that number. This feature is useful for setting up virtual or “soft†limit switches. This value, together with the High Count Limit, are also used in the position mode to determine the travel range when commanding the controller with a relative position command.
Brushless Specific Commands Syntax Serial: ^BLLA cc aa ~BLLA [cc] Syntax Scripting: setconfig(_BLLA, cc, aa) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 0 Default: 0 = No action Max: 255 Argument 2: Action Where: cc = Motor channel aa = 0: No action 1: Safety stop 2: Emergency stop 3: Motor stop 4: Forward limit switch 5: Reverse limit switch 6: Invert direction 7: Run MicroBasic script 8: Load counter with home value mm = mot1*16 + mot2*32
Commands Reference Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 0 Default: 0 = Trapezoidal Max: 2 Argument 2: Mode Where: cc = Motor channel nn = 0: Trapezoidal 1: Sinusoidal 2: Sensorless 3: AC Induction Note: After changing this setting, the motor will perform a reference searched when selecting sinusoidal mode with encoder feedback.
Brushless Specific Commands BZPW - Brushless zero seek power level HexCode: 62 Description: Sets the level of Amps to be applied to the motor coils during the zero-angle reference search in sinusoidal mode. Zero reference is automatically initiated every time the controller is powered up when sinusoidal with encoder feedback is selected. Zero reference search is initiated manually with the !BND command in sinusoidal mode with sin/cos and SPI feedback.
Commands Reference Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Hall Position Type: Unsigned 8-bit Min: 0 Max: 1 Default: 0 Where: cc = Motor channel nn = Hall Sensor Position 0: 120degree 1: 60degree Example: ^HPO 1 1: Configure that the Hall Sensor of motor 1 are spaced by 60 degrees. HSM - Hall Sensor Map HexCode: A3 Description: Configure this parameter to match the ABC hall sensor cable pattern with the UVW motor windings wire pattern connected to the controller.
Brushless Specific Commands Where: cc = Motor channel nn = Motor’s Hall Sensor Map Example: ^HSM 1 1: Set Hall Sensor Map for motor 1 to value 1. KIF - FOC PID Integral Gain HexCode: 8E Description: On brushless motor controller operating in sinusoidal mode, this parameter sets the Integral gain in the PI that is used for Field Oriented Control. Two gains can be set for each motor channel, in order to control the Flux and Torque current.
Commands Reference KPF - FOC PID Proportional Gain HexCode: 8D Description: On brushless motor controller operating in sinusoidal mode, this parameter sets the Proportional gain in the PI that is used for Field Oriented Control. Two gains can be set for each motor channel, in order to control the Flux and Torque current.
Brushless Specific Commands Syntax Scripting: setconfig(_SPOL, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Type: Unsigned 8-bit Min: 1 Default: 1 Max: 255 Argument 2: Number Where: cc = Motor channel nn = Number of poles SSP - Sensorless Start-Up Power HexCode: 93 Description: This parameter sets the start-up Power in Sensorless mode. It is the minimum power to apply to the motor in order to make it start.
Commands Reference SST - Sensorless Start-Up Time HexCode: 94 Description: This parameter is used to define the initial period of the commutation timer in Sensorless mode. The smaller this value the quicker the initial commutation frequency. This value is determined by executing the sensorless start-up calibration, and can be modified accordingly depending on the specifications of the motor. The value is number from 0 to 65535.
Brushless Specific Commands Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Swap Windings Type: Unsigned 0-bit Min: 0 Max: 1 Default: 0 Where: cc = Motor channel nn = Motor’s Swap Windings 0: Angle up-counting for clockwise direction 1: Angle down-counting for clockwise direction Example: ^SWD 1 1: Set angle down-counting for clockwise direction for motor 1.
Commands Reference Where: cc = Motor Channel nn = Amps * 10 ZSMC - SinCos Calibration HexCode: 46 Description: Shows Sin/Cos calibration value that are captured after the completion of the auto calibration step. Values are not to be altered manually. When non-zero values are returned after querying ZSMC, this indicates that a calibration has been successfuly completed at one time or another.
Brushless Specific Commands AC Induction Specific Command TABLE 19-9.
Commands Reference Description: This parameter is only used for AC Induction controllers when operating in FOC mode and contains motor’s mutual inductance (coupled to both stator and rotor). Syntax Serial: ^ILM cc nn ~ ILM [cc] Syntax Scripting: setconfig(_ILM, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Mutual Inductance Type: Unsigned 32-bit Min: 0 Max: 10000 Default: 10 Where: cc = Motor channel nn = Motor’s Mutual Inductance in μH.
Brushless Specific Commands Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Rotor Leakage Inductance Type: Unsigned 32-bit Min: 0 Max: 10000 Default: 10 Where: cc = Motor channel nn = Motor’s Rotor Leakage Inductance in μH. Example: ^RFC 1 67: Set Rotor Leakage Inductance of motor 1 to value 67μH. IRR - Rotor Resistance HexCode: 99 Description: This parameter is only used for AC Induction controller when operating in FOC mode and contains the resistance per phase of the rotor.
Commands Reference Where: cc = Motor channel nn = Motor’s Rotor Resistance in micro-ohm. Example: ^IRR 1 24500: Set Rotor Resistance of motor 1 to value 24500μΩ. MPW - Minimum Power HexCode: 97 Description: This parameter is only used for AC Induction controllers when operating in Volts per Hertz mode. It defines a minimum PWM output value so that there is always a minimal of rotor flux to create induction.
Brushless Specific Commands MXS - Optimal Slip Frequency HexCode: 96 Description: This parameter is only used for AC Induction controllers. The optimal slip is the value that the controller will work to maintain while operating in Constant Slip mode.
Commands Reference Syntax Scripting: setconfig(_RFC, cc, nn) Number of Arguments: 2 Argument 1: Channel Min: 1 Max: Total Number of Motors Argument 2: Rotor Flux Current Type: Unsigned 16-bit Min: 0 Max: 500 Default: 10 Where: cc = Motor channel nn = Motor’s Rotor Flux Current in Amps * 10 Example: ^RFC 1 50: Set Rotor Flux Current for motor 1 to value 5A. CAN Communication Commands This section describes all the configuration parameters uses for CANbus operation. TABLE 19-10.
CAN Communication Commands Syntax Serial: ^CAS nn ~CAS Syntax Scripting: setconfig(_CAS, nn) Number of Arguments: 1 Argument 1: Rate Type: Unsigned 8-bit Min: 0 Default: 0 = Off Max: 1 Where: nn = 0: Device is inactive 1: Device is active on CANOpen at power-up CBR - CAN Bit Rate HexCode: 58 Description: Sets the CAN bus bit rate Syntax Serial: ^CBR nn ~CBR Syntax Scripting: setconfig(_CBR, nn) Number of Arguments: 1 Argument 1: BitRate Type: Unsigned 8-bit Min: 0 Default: 3 = 250K Max: 5 Where: n
Commands Reference Description: Enables CAN and selects the CAN protocol Syntax Serial: ^CEN nn ~CNOD Syntax Scripting: setconfig(_CEN, nn) Number of Arguments: 1 Argument 1: Mode Type: Unsigned 8-bit Min: 0 Max: 5 Where: nn = 0: Disabled 1: CANOpen 2: MiniCAN 3: RawCAN 4: RoboCAN 5: MiniJ1939 CHB - CAN Heartbeat HexCode: 59 Description: Sets the rate in miliseconds at which the controller will send a heartbeat frame on the CAN bus. Heartbeat is sent when either MiniCAN, RawCAN, CANOpen are selected.
CAN Communication Commands Description: In RawCAN and MiniCAN mode, this parameter filters the incoming frames in order to capture only these originating from a given node address.
Commands Reference Description: Rate in ms at which MiniCAN frames are sent Syntax Serial: ^CSRT nn ~CSRT Syntax Scripting: setconfig(_CSRT, nn) Number of Arguments: 1 Argument 1: Rate Type: Unsigned 8-bit Min: 0 Default: 100ms Max: 65536 Where: nn = Rate in ms. No frames sent. if value is 0 CTPS - CANOpen TPDO SendRate HexCode: 5D Description: Sets the send rate for each of the 4 TPDOs when CANOpen is enabled.
System Requirements SECTION 20 Using the Roborun Configuration Utility A PC-based Configuration Utility is available, free of charge, from Roboteq. This program makes configuring and operating the controller much more intuitive by using pull-down menus, buttons and sliders. The utility can also be used to update the controller’s software in the field as described in “Updating the Controller’s Firmware” on page 241.
Using the Roborun Configuration Utility • After the installation is complete, run the program from your Start Menu > Programs > Roboteq The controller does not need to be connected to the PC to start the Utility. For installations on older versions of Windows, it may be necessary to install .NET Framework version 3.5. On Windows 10 systems, you may need to enable .net framework version 3.5.
The Roborun+ Interface Header Content The header is always visible and contains an “Emergency Stop” button that can be hit at any time to stop the controller’s operation. Hitting the button again will resume the controller operation. The header also displays inside a text box the Controller type that has been detected The “View Pinout” button will pop open a window showing the pinout of the detected controller model. For each analog, digital or pulse input/output, the table shows the default label (e.g.
Using the Roborun Configuration Utility • • Firmware ID string as reported by the controller. Contains revision number and date. Connected/Disconnected LED. When lit green, it indicates that the communication with the controller is OK. Program Launch and Controller Discovery After launching the Roborun Utility, if the controller is connected, or after you connect the controller, the Roborun will automatically scan all the PC’s available communication ports.
Program Launch and Controller Discovery FIGURE 20-4. Configuration tab The configuration tab contains two configuration trees: the one on the left deals mostly with the I/O and control signals, while the tree on the right deals with the power output and motor parameters. The exact content and layout of a tree depends on the controller model that is detected. The trees are, for the most part, self explanatory and easy to follow. Each node will expand when clicking on the small triangle next to it.
Using the Roborun Configuration Utility • • Selection List Text String When entering a numerical value, that value is checked against the allowed minimum and maximum range for that parameter. If the entered value is lower than the minimum, then the minimum value will be used instead, if above the maximum, then the maximum value will be used as the entered parameter. Boolean parameters, such as Enabled/Disabled will appear as a two-state menu list.
Program Launch and Controller Discovery When clicking on the “Calibrate” link, a window pops up that displays a bar showing the live value of that analog or pulse input in real time. The window contains three cursors that move in relation to the input, capturing the minimum and maximum detected values. It is possible to further manually adjust further these settings by moving the sliders.
Using the Roborun Configuration Utility Loading, Saving Controller Parameters The buttons on the right of the Configuration tab let you load parameters from the controller at any time and save parameters typically after a new parameter has been changed in the trees. You can save a configuration profile to disk and load it back into the tree. The “Reset Defaults ...” button lets you reset the controller back to the factory settings. This button will also clear the custom labels if any were created.
ConfigurationParametersGrouping&Organization That secret number gets stored inside the controller with no way to read it. Once locked, any time there is an attempt to read the controller configuration (as for example, when the controller is first detected), a message box will pop open to indicate that the configuration cannot be read. The user is prompted to enter the key to unlock the controller and read the configuration.
Using the Roborun Configuration Utility The Script Autostart enables or disables script execution. Make sure that the script is bug free before enabling. Then a number of Command Safety parameters can also be configured. These are the Watchdog timeout when receiving Serial commands, and the safety ranges for analog commands. The Telemetry parameter contains the string that is executed whenever controller is first powered up.
ConfigurationParametersGrouping&Organization FIGURE 20-16. Can Menus Encoder Parameters In the Encoder node are all the parameters relevant to the usage of the encoder. The first parameter is the Use and is used to select what this encoder will be used for and to which motor channel it applies. Additional parameters let you set a number of Pulse Per Revolution, Maximum Speed and actions to do when certain limit counts are reached. FIGURE 20-17.
Using the Roborun Configuration Utility For Digital Output, you can set the Active Level and the trigger source that will activate the Output. FIGURE 20-19. Digital Out Menu Analog Input Parameters For Analog inputs, all the parameters that can be selected include the enabling and conversion type what this input should be used for and for which channel the input range limits the deadband and which actions to perform when the minimum or maximum values are reached. FIGURE 20-20.
Power Output Parameters FIGURE 20-21. Puksein Menu Power Output Parameters The on the right side of the configuration screen are the parameters that relate to the motor driver and power stage of the controller. General Settings There is one tree for setting parameters that apply to all channels of the controller. These are: the PWM Frequency, the low and high side Voltage Limits, the Short Circuit Protection and the mixed mode. FIGURE 20-22.
Using the Roborun Configuration Utility Run Tab The Run tab lets you exercise the motors and visualize all the inputs and outputs of the controller. A powerful chart recorder is provided to plot real-time controller parameters on the PC, and/or log to a file for later analysis. FIGURE 20-23. RUN tab Each group of monitored parameters can be disabled with a checkbox at the upper left corner of their frame. By default, all are enabled.
Run Tab The DefConfig Fault LED will also turn on the first time the controller is restarted after a new firmware release has be installed and default configuration first reloaded. Applying Motor Commands The command sliders will cause the command value to be applied to the controller. Clicking on the “+”, “++”, “-”, “--” buttons lets you fine-tune the command that is applied to the controller. The numerical value can be entered manually by entering a number in the text box.
Using the Roborun Configuration Utility resets the Min and Max. The chart can be paused or it can be cleared and the recorded values can be saved in an Excel format for later analysis. FIGURE 20-25. Chart recorder “Handles” on the left vertical axis may be used to zoom in a particular vertical range. Similar handles on the horizontal axis can be used to change the scrolling speed of the chart.
Run Tab FIGURE 20-26. Console tab Updating the Controller’s Firmware The controller’s firmware can be updated in the field. This function allows the controller to be always be up-to date with the latest features or to install custom firmware. Update can be done via the serial port or via USB.
Using the Roborun Configuration Utility FIGURE 20-27. Update Controller Firmware window When updating via USB, click on the “Update Controller firmware with USB”. This will cause the COM port to close and the device to disappear from PC utility. The controller then enters a special update mode and will automatically launch the Roboteq “DFU Loader” utility that is found in the Start menu. Selecting and updating the file will perform the firmware update via USB.
Scripting Tab Updating Script It is possible to load a new script into the controller using the “Update Script” button. After clicking, select a script object file in .hex format. The hex file is generated from the Scripting tab. Updating the Controller Logic Some controller models have one or two programmable logic parts which can also be updated in the field.
Using the Roborun Configuration Utility Edit Window The main window in this tab is used to enter the scripts. The editor automatically changes the color and style of the entered text so that comments, keywords, commands and text strings are immediately recognizable. The editor has simple text editing features needed to write source code. More information on the scripting language and its capabilities can be found in the “MicroBasic Language Reference” on page 187.
Scripting Tab FIGURE 20-30. Script compile error Beware that not all programming errors are detected. Be especially careful with variable names. Use the #option explicit directive to enforce variable declarations. Beware not to mix setconfig() and setcommand() when changing a configuration or a command. A faulty script can cause the controller to crash. Enable the scripting Auto Start configuration only on known working scripts. Executing Scripts Scripts are not automatically executed after the transfer.
Using the Roborun Configuration Utility Debugging Scripts A number of techniques can be used to debug a script that is not behaving as expected. You can view the value of variable in real time during program execution by clicking on the Inspect Variables button. Then hover the mouse over a variable in the program listing. The variable value will be read and displayed at the mouse location. The variable value is read only once when first hovering over the variable.