Home

User Manual

image

Contents

1. Priority Y Y Analog Inputs Input Capture Selection Commands Motor Output a and Command Driver Motor Switchbox Outputs gt Pulse Inputs Feedback gt Estop Limit Switches Digital Inputs Pila Encoder Inputs utputs Amps A Temperature Configuration Voltages lag FIGURE 26 Simplified representation of the controller s internal operation Advanced Digital Motor Controllers User Manual 49 VO Configuration and Operation Robote 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 possibili ties 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 26 any input can be used for practically any purpose All inputs even when they are sharing the same pins on the connector are captured and evaluated by the controller Whether an input is used and what it is used for is set individually using the descriptions that follow Important Notice On shared O pins there is nothing stopping one input to be used as analog or pulse at the same time or for two separate inputs to act identically or in conflict with one another While such an occurrence is normally harmless it may cause the con troller to behave in unexpected manner a
2. 120 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Digital Input Output Configurations DINL Digital Input Active Levels This parameter is used to set the active level for each Digital input An input can be made to be active high or active low Active high means that pulling it to a voltage will trigger an action Active low means pulling it to ground will trigger an action This parameter is a sin gle number for all inputs Syntax DINL bb DINL Where bb L1 L2 2 L3 4 L4 8 L5 16 L6 32 and where Ln 0 input is active high 1 input is active low Default Value All inputs active high Example DINL 33 inputs 1 and 6 active low all others active high l e 33 1 output1 32 output6 DOA Digital Output Trigger This configuration parameter will set what will trigger a given output pin The parameter is a number in a list of possible triggers when one or several motors are on when one or several motors are reversed when an Overvoltage condition is detected or when an Over temperature condition is detected Embedded in the parameter is the motor channel s to which the action should apply Syntax ADOA cc aa mm DOA cc Where cc Output channel aa 0 no action 1 when motor on motor reversed overvoltage overtemperature miror status LED mm mot1 16 mot2 32 PUN Default Value All outputs disabled Exam
3. 114 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Set Read Configuration Commands Set Read Configuration Commands These commands are used to set or read all the operating parameters needed by the con troller for its operation Parameters are loaded from EEPROM into RAM from where they are and then used every time the controller is powered up or restarted Important Notices The total number of configuration parameters is very large To simplify the configu ration process and avoid errors it is highly recommended to use the RoborunPlus PC utility to read and set configuration Some configuration parameters may be absent depending on the presence or absence of the related feature on a particular controller model Setting Configurations The general format for setting a parameter is the character followed by the command name followed by parameter s for that command These will set the parameter in the con troller s RAM and this parameter becomes immediately active for use The parameter can also be permanently saved in EEPROM by sending the EESAV maintenance command Some parameters have a unique value that applies to the controller in general For exam ple overvoltage or PWM frequency These configuration commands are therefore fol lowed by a single parameter APWM 180 Sets PWM frequency to 18 0 kHz OVL 400 Sets Overvoltage limit to 40 0V Other parameters hav
4. SECTION 8 Closed Loop Position Mode This section describes the controller s Position mode how to wire the motor and position sensor assembly and how to tune and operate the controller in this mode Mode Description In this mode 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 The controller will move the motor so that It reaches this position This feature makes it possible to build ultra high torque jumbo servos that can be used to drive steering columns robotic arms life size models and other heavy loads The controller incorporates a full featured Proportional Integral Differential PID control algorithm for quick and stable positioning Selecting the Position Mode The position mode is 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 Operating Mode on page 143 The position mode can be set independently for each channel Position Feedback Sensor Selection The controller may be used with the following kinds of sensors e Potentiometers Hall effect angular sensors e Optical Encoders Advanced Digital Motor Controllers User Manual 79 Closed Loop Position Mode Robote The first two are use
5. Version 1 2 January 8 2011 Robote Analog Inputs Configurations and Use Configuring the Digital Inputs and the Action to use can be done very simply using the PC Utility See Digital Input and Output Parameters on page 187 Wiring instructions for the Digital Inputs can be found in Connecting Switches or Devices to Inputs shared with Outputs on page 30 Analog Inputs Configurations and Use The controller can do extensive conditioning on the analog inputs and assign them to differ ent use Each input can be disabled or enabled When enabled it is possible to select the whether capture must be as absolute voltage or relative to the controller s 5V Output Details on how to wire analog inputs and the differences between the Absolute and Relative captures can be found in Using the Analog Inputs to Monitor External Voltages on page 35 TABLE 6 Analog Capture Modes Analog Capture Mode Description Disabled Analog capture is ignored forced to O Absolute Analog capture measures real volts at the input Relative Analog captured is measured relative to the 5V Output which is typ ically around 4 8V Correction is applied so that an input voltage measured to be the same as the 5V Output voltage is reported at 5 0V The raw Analog capture then goes through a series of processing shown in the diagram below Min Max Center Deadband Exponent Use Select Analog Command Input x Feedba
6. M Motor Command Applied 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 com mand mode vs another is based on the command priority mechanism described at Com mand Priorities on page 90 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 In the Analog and Pulse modes this query will report the Analog or Pulse input after it is being converted using the min max center deadband and linearity corrections This query is useful for viewing which command is actually being used and the effect of the correction that is being applied to the raw input Advanced Digital Motor Controllers User Manual 105 Serial RS232 USB Operation Robote Syntax Reply Where Examples Notes M cc Mzn1 n2 cc channel number n1 n2 command value used for each motor 0 to 1000 range Q M R M 800 1000 Q M 1 R M 800 Single channel controllers will only report one value P Motor Power Output Applied Reports the actual power 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 temper ature or over current Syntax Reply Where Examples Notes PI Pulse I
7. 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 If this protection is disabled there will be no way of stopping it other than pressing the emergency stop button or disconnecting the power Determining the right polarity is best done experimentally using the Roborun utility see Using the Roborun Configuration Utility on page 177 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 If an encoder is used configure the encoder channel with the encoder s Pulses Per Revolution value 3 Click on the Run tab of the PC utility Configure the Chart recorder to display the speed information if an encoder is used Display Feedback if an analog sensor is used 4 Verify that the motor sliders are in the O Stop position 5 f a tachometer is used verify that the reported feedback value read is O when the motors are stopped If not adjust the Analog Center parameter 6 Move the cursor
8. Trigger Action similar to Digital Input if under or over user selectable threshold ENC1a b Encoder Inputs Command for motor s to Speed or position feedback ENC2a b D d Trigger action similar to Digital Input if under or over user selectable count threshold Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Connecting devices to Digital Outputs Connecting devices to Digital Outputs Depending on the controller model 2 to 8 Digital Ouputs are available for multiple pur poses 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 a 24V battery at the other Connecting Resistive Loads to Outputs Resistive or other non inductive loads can be connected simply as shown in the diagram below Lights LEDs or any other non inductive load Upto 24V DC CH DOUT Internal Transistor Ground FIGURE 6 Connecting resistive loads to DOUT pins Connecting Inductive loads to Outputs The diagrams on Figure 7 show how to connect a relay solenoid valve small motor or other inductive load to a Digital Output Relay Valve Motor Solenoid or other Inductive Load Upto 24V D
9. CLIN Command Linearity 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 Exponential correction make the commands change less at the beginning and become stronger at the end of the command input range The logarithmic correction will have a stronger effect near the start and lesser effect near the end The lin ear selection causes no change to the input A linearity transform is also available for all Advanced Digital Motor Controllers User Manual 117 Serial RS232 USB Operation Robote analog and pulse inputs Both can be enabled although in most cases it is best to use the Command Linearity parameter for modifying command profiles Syntax Where Default Value Example ACLIN cc nn CLIN cc ec Motor channel number nn 0 linear no change exp weak exp medium exp strong log weak log medium log strong O01 0 N All channels linear CLIN 1 1 Sets linearity for channel 1 to exp weak CPRI Command Priorities This parameter contains up to 3 variables and is used to set which type of command in pri ority the controller will respond to and in which order The first item is the first priority sec ond second priority third third priority Each priority item is then one of the three command modes Serial An
10. Enable o a Sop Config i Be Capture 100 U Ph EE ENS m Channel Value Min Max Or Pag t Bl Motor Command 1 ME 801 58 6 one i Bl Motor Power 1 Js 295 x B 40 5 Be z a50 4980 1485 E 2 vA ZEN BG I5 7 x d Bl Encoder Count 1 y 19934 66476 475487 E ar 7 Stes 0 0 0 e ers Bl Heatsink Temp 2 Bu a naka E Wi Controller Volt g 3 fan fae 80 E B Pause L Gear Chart SUR petet poteet ree paan ac 1 a timen aaa aaa ra CES 3 Gert Found COMI COM2 COM2 is Open Firmware ID Roboteq v1 1 RCB500 05 24 2010 FIGURE 53 The Roborun Interface The screen has a header status bar and 4 tabs upgrading testing and troubleshooting troller Configuration tab for setting all the different configuration parameters Run tab for testing and monitoring the status of the controller at runtime Console tab for performing a number of low level operations that are useful for Scripting tab for writing simulating and downloading custom scripts to the con 178 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote 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 control ler operation The header also displays inside two text boxes the Controller type that ha
11. IRoboteQ Advanced Digital Motor Controllers User Manual Brushed DC HDC2450 VDC2450 MDC2250 SDC2130 2160 Brushless DC HBL1650 VBL1650 HBL2350 VBL2350 MBL1350 Sepex VDC1850 v1 2 January 8 2011 visit www roboteg com to download the latest revision of this manual Copyright 2011 Roboteq Inc Advanced Digital Motor Controllers User Manual Robote Revision History Date Version Changes January 1 2010 1 0 Initial release May 15 2010 1 1 Added Scripting July 15 2010 1 2 Extended command set Improved position mode January 8 2011 1 2 Added Brushless Motor Connections and Operation The information contained in this manual is believed to be accurate and reliable However it may contain errors that were not noticed at time of publication Users are expected to perform their own product validation and not rely solely on data contained in this manual Aavanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote SECTION 1 SECTION 2 Revision HIStO y mama naa eee wae km Ra NDN PNG KGG PIDO RRS INITOQUCHON g si E Pagan BORA PWDE wick ANT dees rad conkers beans Refer to the Datasheet for Hardware Specific Issues User Manual Structure and Use llle SECTION 1 Connecting Power and Motors to the Controller SECTION 2 Connecting Sensors and Actuators to Input Outputs SECTION 3 Command Modes l
12. Serial RS232 USB Operation IRo boteQ 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 Queries can then be called from the history buffer using manual commands or automati cally at user selected intervals This feature is very useful for monitoring and telemetry Additionally the history buffer can be loaded with a set of user selected queries at power on so that the controller can automatically issue operating values immediately after power up See TELS Telemetry String on page 119 for detail on how to set up the startup Telemetry string A command set is provided for managing the history buffer These special commands start with a character TABLE 13 Query History Commands Command Description Send the next value Stop automatic sending C Clear buffer history nn Start automatic sending Send Next History Item Stop Automatic Sending A alone will call and execute the next query in the buffer If the controller was in the pro cess of automatically sending queries from the buffer then receiving a will cause the sending to stop When a query is executed from the history buf
13. The main benefit of this technique is its total independence on the controller s electronics and its ability to work in practically all circumstances Its main limitation is that the switch and diode must be capable of handling the current that flows through the motor Note that the current will flow though the diode only for the short time needed for the motor to move away from the limit switches Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Using Current Trigger as Protection SW1 SW2 idis ino ole Controller FIGURE 45 Safety limit switches interrupting power to motor Important Warning Limit switches must be used when operating the controller in Position Mode This will significantly reduce the risk of mechanical damage and or injury in case of dam age to the position sensor or sensor wiring Using Current Trigger as Protection The controller can be configured to trigger an action when current reaches a user configu rable threshold for more than a set amount of time This feature can be used to detect that a motor has reached a mechanical stop and is no longer turning The triggered action can be an emergency stop or a simulated limit switch Operating in Closed Loop Position Mode The controller position algorithm allows you to move the motor from an initial position to a desired position The motor starts with a controlled acceleration reaches a desired ve
14. 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 If the short circuit is detected again for up to a quarter of a second it is con sidered as a permanent condition and the controller enters a Safety Stop condition mean ing that it will remain off until the command is brought back to 0 The short circuit detection can be configured with the PC utility to have one of three sensi tivity levels quick medium and slow The protection is very effective but has a few restrictions Only shorts between two motor outputs of the same channel are detected Shorts between a motor wire and VMot are also detected Shorts between a motor output and Ground are not detected Wire inductance causes current to rise slowly relative to the PWM On Off times Short cir cuit will typically not be detected at low PWM ratios which can cause significant heat to eventually accumulate in the wires load and the controller even though the controller will typically not suffer direct damage Increasing the short circuit sensitivity will lower the PWM rati
15. llle 149 Editing Building Simulating and Executing Scripts 150 Editing SCriptS seriski ant Era NEEE sabe See E REG tek ne Y eee 150 Building SONDIS x xx niacin ews ered NINYO hee oe bm ds 150 Sim latirig SCriptS usus saa er RE RI ERE RA RI Dor ES 150 Downloading MicroBasic Scripts to the controller 151 Executing MicroBasic Scripts ees 151 Script Command PriOrltles ssa si ged se peace deere eek o Re Ro xta Pana ceeds 152 MicroBasic Scripting Techniques llle 152 Single Execution SCriptS sus encre eres iker eee eee ee ERG EG 152 Continuous SCFIDES a s tare Cerco ecce RR ce o cx ac 152 Optimizing Scripts for Integer Math llle 153 SChPtEXaMpleSis eee cete ium erm m codon e qos e sri cof ties 154 MicroBasic Language Reference 2 2 cece eee 155 IMEKOGUCHON eS emus i eR ELDER WEN I DA DA BRA LAN kaba 155 COMMENTS E EET T EIC Sen wide Ges ace 00 TTE 155 Boolean 2 ek sew her dake ru ERE EUER Paka we Pe Pe EE ES 155 INuin DOES sess dpa tex es Boos tows Dieu xe doit a mar teen ous 155 Su 156 Blocks and Labels anG KANA eee eae WA e nn e 156 VaniableS z ckkua ck sy NG bese e eee deta db VERA eS ek ee oe 157 ci Er 157 Terminology 2 5 kB ext RR nos Oe ee p RR ca RR RR RR CR 157 KGyWOFEBS ru rg aut Rer ALA IN E m abe RR AG 158 ODeratOESs ux Rx SA UE ae Rea eee 158 Micro Basic F nCtions uu nia o EEG Speak weed ded E NAE UR 159 Controller Configuration an
16. BRENDA Rie ms 61 Motor Channel Parameters ce hh hh 63 User Selected Current Limit Settings aaa 63 Selectable Amps Threshold Triggering 2 cece eee eee eee 63 Programmable Acceleration amp Deceleration 64 Forward and Reverse Output Gain llle re 64 Selecting the Motor Control Modes lesen 64 Open Loop Speed Control cc ee ce eee nee ee ee ee mx 64 Closed Loop Speed Control 2 cece eee eens 64 Close Loop Position Control sss 0 cc eee eee eee ees 65 Brushless Motor Connections and Operation 2 0 e eee ees 67 Brushless Motor Introduction 00 cee eee ee eee 67 Number of Poles eee ee ee RERO RR AS 68 Hall Sensor WIM sies rn rtm m Rau Rod RR S DURCH NM ERR NA 68 Hall Sensor Wiring Order llle ene 69 Brushless Motor Operations ss iesu or rrr RE RE RE ERR 70 Stall DetectlOTis du 3 ocu tt need ced pine ow ec pe m RR a aes 70 Speed Measurement using Hall Sensors 0 cece ee 71 Distance Measurement using Hall Sensors 71 Closed Loop Speed Mode ec eee c ccc eee eee teen eee eens 73 Mode Descriptio aks magma unn nc n acer nC CR CR RR RR CR aces warmed me 73 Tachometer or Encoder Wiring lille 73 Tachometer or Encoder Mounting llle 73 Tachometer Wiring ss euh yet RE nee Rw ee NUN A 74 Advanced Digital Motor Controllers User Manual Robote SECTION 8 SECTION 9 Brushless Hall Sensors
17. Character Echo The controller will echo back to the PC or Microcontroller every valid character it has received If no echo is received one of the following is occurring e echo has been disabled the controller is Off the controller may be defective Command Acknowledgement The controller will acknowledge commands in one of the two ways For commands that cause a reply such as a configuration read or a speed or amps queries the reply to the query must be considered as the command acknowledgement For commands where no reply is expected such as speed setting the controller will issue a plus character followed by a Carriage Return after every command as an acknowl edgment Command Error If a command or query has been received but is not recognized or accepted for any rea son the controller will issue a minus character to indicate the error If the controller issues the character it should be assumed that the command was not recognized or lost and that it should be repeated Watchdog time out For applications demanding the highest operating safety the controller should be config ured to automatically switch to another command mode or to stop the motor but other wise remain fully active if it fails to receive a valid command on its RS232 or USB ports or from a MicroBasic Script for more than a predefined period Advanced Digital Motor Controllers User Manual 91 Serial RS232 USB Operation
18. Pulse Max Range This parameter defines the raw pulse measurement number that would be considered as the 1000 internal value to the controller By default it is set to 2000 which is the max pulse width of an RC radio pulse Syntax APMAX cc nn PMAX cc Where nn 0 to 65000us Default Value 2000us Advanced Digital Motor Controllers User Manual 127 Serial RS232 USB Operation IRo boteQ PMAXA Action at Pulse Max This parameter configures the action to take when the max value that is defined in PMAX is reached The list of action is the same as in the DINA digital input action list Embedded in the parameter is the motor channel s to which the action should apply Syntax APMAXA cc aa mm PMAXA cc Where cc Input channel number aa DIN Action List mm mot1 16 mot2 32 Default Value No action on all channels PMIN Pulse Min Range 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 Maximum captured value is 65000 The default value is 1000 microseconds which is the minimum value on an RC radio pulse Syntax APMIN cc nn PMIN cc Where nn 0 to 65000us Default Value 1000ys PMINA Action at Pulse Min 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 in
19. SCHIPLNG VADs a maa anwar te ae Rees ete eee a te eee wae AA E 195 Edit WINTOW sisse Oe bP ae eee eee REN aes 195 Download to Device DUTtION 2 eee ee eee 195 Build DUON s s uus iuga ene bed mh Rab RUE Y KA RO x gom Pm ee ae 195 SIMUlALON DUEEOFIss s uc sim mom e pn imas ema re dores 196 Executirig SCrlpEs uui soos races RR a PUR Eran Ra Roses eee ela 196 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ 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 These include Number and types of I O Connectors pin out Wiring diagrams Maximum voltage and operating voltage e Thermal and environmental specifications e Mechanical drawings and characteristics mechanical User Manual Structure and Use The user manual discusses issues that are common to all controllers inside a given product family Except for a few exceptions the information contained in the manual does not repeat the data that is provided in the datasheets The Manual is divided in 11 Sections organized as follows SECTION 1 Connecting Power and Motors to the Controller This section describes the power connections to the battery and motors the mandatory vs optional connections Instruc
20. 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 expression expression Operator Greater than relational operator returns true if the first operand is greater than the sec ond false otherwise expression expression z Operator Less than or equal relational operator lt returns true if the first operand is less than or equal to the second false otherwise expression lt expression 168 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction Operator Greater than relational operator returns true if the first operand is greater than the sec ond false otherwise expression expression gt Operator Greater than or equal relational operator gt returns true if the first operand is greater than or equal to the second false otherwise expression gt expression Operator The addition assignment operator var expression An expression using the assignment operator such as x y is equivalent to Operator The subtraction assignment operator var e
21. f3 undervoltage f4 short circuit f5 emergency stop f6 Sepex excitation fault f7 EEPROM fault f8 configuration fault FID Firmware ID This query will report a string with the date and identification of the firmware revision of the controller Syntax FID Reply FID Firmware ID string 104 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Runtime Queries Example Q FID R FID Roboteq v0 9 RCB200 11 23 2009 FS Status Flag Report the state of status flags used by the controller to indicate a number of internal con ditions during normal operation The response to this query is the single number for all sta tus flags The status of individual flags is read by converting this number to binary and look at various bits of that number Syntax FS Reply FS f1 f2 2 f3 4 fn 2 Where f1 Serial mode f2 Pulse mode f3 Analog mode f4 Power stage off f5 Stall detected f6 At limit f7 Analog inputs uncalibrated f8 Amps uncalibrated LK Lock Status Returns the status of the lock flag If the configuration is locked then it will not be possible to read any configuration parameters until the lock is removed or until the parameters are reset to factory default This feature is useful to protect the controller configuration from being copied by unauthorized people Syntax LK Reply LK ff Where ff 0 unlocked 1 locked
22. lIRoboteQ Operating the Controller In Analog Mode Input Analog Channel Configuration An Analog input can be Enabled or Disabled When enabled it can be configured to cap ture absolute voltage or voltage relative to the 5V output that is present on the connector See Analog Inputs Configurations and Use on page 51 Analog Range Calibration If the joystick movement does not reach full OV and 5V and or if the joystick center point does not exactly output 2 5V the analog inputs can be calibrated to compensate for this See Min Max and Center adjustment on page 52 and Deadband Selection on page 53 Using Digital Input for Inverting direction Any digital input can be configured to change the motor direction when activated See Digital Inputs Configurations and Uses on page 50 Inverting the direction has the same effect as instantly moving the command potentiometer to the same level the opposite direction The motor will first return to O at the configured deceleration rate and go to the inverted speed using the configured acceleration rate Safe Start in Analog Mode By default the controller is configured so that in Analog command mode no motor will start until all command joysticks are centered The center position is the one where the input equals the configured Center voltage plus the deadband After that the controller will respond to changes to the analog input The safe start check is not performed again until
23. 2011 lIRoboteQ Analog Input Configurations Input Action on page 120 For example this feature can be used to create soft limit switches in which case the motor can be made to stop if the feedback sensor in a position mode has reached a minimum value Syntax AAMINA cc aa mm AMINA cc Where ce Input channel number aa DIN Action list mm mot1 16 mot2 32 Default Value No action on all channels Example AAMINA 2 33 Stops motor 2 l e 33 1 motor stop 32 motor2 AMOD Enable and Set Analog Input Mode This parameter is used to enable disable an analog input pin When enabled it can be made to measure an absolute voltage from 0 to 5V or a relative voltage that takes the 5V output on the connector as the 5V reference The absolute mode is preferred whenever measuring a voltage generated by an outside device or sensor The relative mode is the mode to use when a sensor or a potentiometer is powered using the controller s 5V output of the controller Using the relative mode gives a correct sensor reading even though the 5V output is imprecise Syntax AMOD cc nn AMOD cc Where cc channel number nn 0 disabled 1 absolute 2 relative Example AAMOD 1 1 Analog input 1 enabled in absolute mode APOL Analog Input Polarity Inverts the analog capture polarity Syntax APOL cc nn APOL Where cc analog channel number nn 0 not inverted 1 inverted Advanced Digital Mot
24. 8 2011 lIRoboteQ Command Inputs Configuration and Safety ACS Analog Center Safety This parameter enables the analog safety that requires that the input be at zero or centered before it can be considered as good This safety is useful when operating with a joystick and requires that the joystick be centered at power up before motors can be made to run Syntax AACS nn ACS Where nn 0 safety enabled 1 safety disabled Default Value 0 enabled AMIS Analog within Min amp Max Safety This configuration is used to make sure that the analog input command is always within a user preset minimum and maximum safe value It is useful to detect for example that the wire connection to a command potentiometer is broken If the safety is enabled and the input is outside the safe range the Analog input command will be considered invalid The controller will then apply a motor command based on the priority logic See Command Priorities on page 90 Syntax AAMS nn AMS Where nn 0 enable 1 disable Default Value 0 enabled BRUN MicroBasic Auto Start This parameter is used to enable or disable the automatic MicroBasic script execution when the controller powers up When enabled the controller checks that a valid script is present in Flash and will start its execution 2 seconds after the controller has become active Syntax BRUN nn BRUN Where nn 0 enabled 1 disabled Default Value 0 disabled
25. 90 to set the priority of commands issued from the script vs commands received from the Pulse Inputs or Analog Inputs Advanced Digital Motor Controllers User Manual 43 Command Modes Robote Operating the Controller in RC mode The controller can be directly connected to an R C receiver In this mode the speed or position information is contained in pulses whose width varies proportionally with the joy sticks positions The controller mode is compatible with all popular brands of RC transmit ters 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 SBRERRRR FIGURE 24 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 0 milliseconds indicates the maximum joystick position When the joystick is in the center position the pulse should be 1 5ms joystick position min center max R C pulse timing FIGURE 25 Joystick position vs pulse duration default values The controller has a very accurate pulse capture input and is capable of detecting changes in joystick position and therefore pulse width as small as 0 196 This resolution is superior to the one usually found in most low cost RC transmit
26. AINA cc Where cc Input channel number nn 0 unused 1 command 2 feedback mm mot1 16 mot2 32 Default Value All channels unused Example ARINA 1 17 Sets Analog channel 1 as command for motor 1 l e 17 1 command 16 motor 1 ALIN Analog Linearity This parameter is used for applying an exponential or a logarithmic transformation on an analog input There are 3 exponential and 3 logarithmic choices 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 Syntax ALIN cc nn ALIN cc 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 Default Value All channels linear Example AALIN 11 Sets linearity for channel 1 to exp weak Advanced Digital Motor Controllers User Manual 123 Serial RS232 USB Operation IRo boteQ AMAX Set Analog Input Max Range 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 Syntax AAMAX cc nn AMAX cc Where nn 0 to 5000mV
27. Command Priorities When sending a Motor or Digital Output command from the script it will be interpreted by the controller the same way as a serial command RS232 or USB This means that the RS232 watchdog timer will trigger in if no commands are sent from the script within the 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 To avoid this problem when using the Roborun PC utility click on the mute button to stop commands sending from the PC Script commands also share the same priority level as Serial commands Use the Com mand Priority Setting See Command Priorities on page 90 to set the priority of com mands issued from the script vs commands received from the Pulse Inputs or Analog Inputs MicroBasic Scripting Techniques Writing scripts for the Roboteq controllers is similar to writing programs for any other com puter Scripts can be called to run once and terminate when done Alternatively scripts can be written so that they run continuously Single Execution Scripts These scripts are programs that perform a number of functions and eventually terminate These kin
28. Controller Powering Schemes e The battery must be connected in permanence to the controller s Red wire s or VMot terminal via a high power emergency switch SW2 as additional safety mea sure Partially discharged batteries may not blow the fuse while still having enough power left to cause a fire Leave the switch SW2 closed at all times and open only in case of an emergency Use the main On Off switch SW1 for normal operation This will prolong the life of SW2 which is subject to arcing when opening under high current with consequent danger of contact welding e If installing in an electric vehicle equipped with a Key Switch where SW2 is a con tactor and the key switch energizes the SW2 coil then implement SW1 as a relay Connect the Key Switch to both coils of SW1 and SW2 so cutting off the power to the vehicle by the key switch and SW2 will set the main switch SW1 in the OFF position as well 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 control ler s internal logic The motors will continue to be powered by the main battery while the main battery voltage is higher than the secondary battery voltage This option is valid on all controller models except the SDCxxx
29. Default Value 4900mV Example AMAX 4 4500 Set Analog Input 4 Max range to 4500mV AMAXA Action at Analog Max This parameter selects what action should be taken if the maximum value that is defined in AMAX is reached The list of action is the same as these of the DINA see DINA Digital Input Action on page 120 For example this feature can be used to create soft limit switches in which case the motor can be made to stop if the feedback sensor in a position mode has reached a maximum value Syntax AAMAXA cc aa mm AMAXA cc Where ce Input channel number aa DIN Action List mm mot1 16 mot2 32 Default Value No action on all channels Example AAMAXA 3 34 Stops motor 2 AMIN Set Analog Input Min Range This parameter sets the raw value on the input that will be considered as the minimum 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 Syntax AAMIN cc nn AMIN cc Where nn 0 to 5000mV Default Value 100mV Example AAMIN 5 250 Set Analog Input 5 Min to 250mV AMINA Action at Analog Min This parameter selects what action should be taken if the minimum value that is defined in AMIN is reached The list of action is the same as these of the DINA see DINA Digital 124 Advanced Digital Motor Controllers User Manual Version 1 2 January 8
30. Digital Analog and Pulse Input Monitoring The status of Digital inputs and the value Analog and Pulse can be monitored in real time Analog and Pulse inputs will update only if the selected channel is enabled The labels for the digital inputs digital outputs analog inputs and pulse inputs can be made to take the value that has been entered in the configuration tree as described in Input Output Label ing on page 183 Using a nickname for that signal makes it easier to monitor that informa tion Digital Output Activation and Monitoring The Digital output LEDs reflect the actual state of each of the controller s Output If an out put is not changed by the controller using one of the available automatic Output Triggers see DOA Digital Output Trigger on page 121 clicking on the LED will cause the selected output to toggle On and Off Using the Chart Recorder A powerful chart recorder is provided for real time capture and plotting of operating param eters This chart can display up to eight operating parameters at the same time Each of the chart s channels has a pull down menu that shows all of the operating parameters that can be viewed and plotted The colors can be changed by clicking on the color icon and select ing another color When selecting a parameter to display this parameter will appear in the chart and change in real time The three boxes show a numerical representation of the actual value and the Min and Max
31. Gains for both motors and therefore assumes that similar motor mechanical assemblies and loads are present at each channel Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Use and benefits of Serial Communication SECTION 9 Serial RS232 USB Operation This section describes the communication settings and the commands accepted by the controller in the RS232 or USB mode of operation This information is useful if you plan to write your own controlling software on a PC or microcomputer These commands will also allow you to send commands manually using a terminal emulation program When using the controller s scripting feature the command list shows the parameters that can be read or written from within a script If you wish to use your PC simply to set configuration parameters and or to exercise the controller you should use the RoborunPlus PC utility Use and benefits of Serial Communication The serial communication allows the controller to be connected to microcomputers or wireless modems This connection can be used to both send commands and read various status information in real time from the controller The serial mode enables the design of complex motion control system autonomous robots or more sophisticated remote con trolled robots than is possible using the RC mode RS232 commands are very precise and securely acknowledged by the controller They are also the method by which
32. IRo boteQ By default the watchdog is enabled with a timeout period of 1 second Timeout period can be changed or the watchdog can be disabled by the user When the watchdog is enabled and timeout expires the controller will accept commands from the next source in the prior ity list See Command Priorities on page 90 Controller Present Check The controller will reply with an ASCII ACK character 0x06 anytime it receives a QRY char acter 0x05 This feature can be used to quickly scan a serial port and detect the presence absence or disappearance of the controller The QRY character can be sent at any time even in the middle of a command and has no effect at all on the controller s normal oper ation Commands Types The controller will accept and recognize four types of commands Runtime commands nya These start with and these are usually motor or operation commands that will have immediate effect e g to turn on the motor set a speed or activate digital output See Runtime Commands on page 93 for the full list and description of these commands Runtime queries These start with and they are used to read operating values at runtime e g read Amps Volts power level counter values See Runtime Commands on page 93 for the full list and description of these commands Maintenance commands These start with Yo They are used for all of the maintenance commands such as e g set the time save co
33. LP eases E EET 105 M Motor Command Applied ce eee ee ee 105 P Motor Power Output Applied 0 cee eee eee 106 Pl Pulse Input si sapianu tamga Renae wl nea eek Rd m RC RR n ccn 106 S Encoder Speed RPM elle Re eR ee ee 107 SR Encoder Speed Relative ee eere re 107 T Temperature sss hr hk RR ROCK ne RURAL AG 107 TM sRead TWANG ceed dnc Ae eee PP GLAND NEGI Shee eee LIB case ee 108 TRN Control Unit type and Controller Model Lus 108 Vee VOIS aea E oat ck hed E DA NANANA ha aco ih 108 VAR Read User Variable ccc eee 109 Query History Commands xau mx xxm PALANG KANG 110 Send Next History Item Stop Automatic Sending 110 C Clear Buffer HIStOry sisse ke RR RR rox ema 110 nn Start Automatic Sending llle 111 Advanced Digital Motor Controllers User Manual Robote Maintenance Commands aa aaa eee 112 DFU Update Firmware via USB aaa aan 112 EELD Load Parameters from EEPROM 00 cee eee ences 112 EERST Reset Factory Defaults 2 0 0 cece eee 112 EESAV Save Configuration in EEPROM 0c eee e eee 113 LK Lock Configuration Access eee ee 113 RESET Reset Controller s ice exit er Ra bade eee wae 113 SIME ef TIME isa genter ER EET ERI DIRE RE EE ES 113 UK Unlock Configuration ACCESS cee eee 114 Set Read Configuration Commands llle 115 Setting Confligurati ns Luce rm
34. Level and 1 Level on quadrature output e 5VDC operation 50mA or less current consumption per encoder More sophisticated incremental encoders with index and other features may be used however these additional capabilities will be ignored The choice of encoder resolution is very wide and is constrained by the module s maxi mum pulse count at the high end and measurement resolution for speed at the low end Specifically the controller s encoder interface can process 1 million counts per second 30 000 counts per second max on SDCxxxx As discussed above a count is generated for each transition on the Channel A and Channel B Therefore the module will work with encoders outputting up to 62 500 pulses per second Commercial encoders are rated by their numbers of Pulses per Revolution also some times referred as Number of Lines or Cycles per Revolution Carefully read the manu facturer s datasheet to understand whether this number represents the number of pulses that are output by each channel during the course of a 3600 revolution rather than the total number of transitions on both channels during a 3600 revolution The second number is 4 times larger than the first one The formula below gives the pulse frequency at a given RPM and encoder resolution in Pulses per Revolution Pulse Frequency in counts per second RPM 60 PPR 4 Example a motor spinning at 10 000 RPM max with an encoder with 200 Pulses per Rev olutio
35. Motor Controllers User Manual 97 Serial RS232 USB Operation IRo boteQ Runtime Queries Runtime queries can be used to read the value of real time measurements at any time dur ing the controller operation Real time queries are very short commands that start with followed by one or two letters A couple special runtime queries use three letters as well In some instances queries can be sent with or without a numerical parameter Without parameter the controller will reply with the values of all channels When a numerical parameter is sent the controller will respond with the value of the channel selected by that parameter All queries are stored in a history buffer that can be made to automatically recall the past 16 queries at a userselectable time interval See Query History Commands on page 110 TABLE 12 Runtime Queries Command Arguments Description A InputNbr Read Motor Amps Al InputNbr Read Analog Inputs BA InputNbr Read Battery Amps BS none Read BL Motor Speed in RPM BSR none Read BL Motor Speed as 1 1000 of Max C Channel Read Absolute Encoder Count CB none Read Absolute Brushless Counter CBR none Read Brushless Count Relative CIA Channel Read Internal Analog Command CIP Channel Read Internal Pulse Command CIS Channel Read Internal Serial Command CR Channel Read Encoder Count Relative D InputNbr Read All Digital Inputs D InputNbr Read Indi
36. Motor with tachometer or Encoder for Closed Loop Speed operation Close Loop Position Control In this mode illustrated in Figure 38 the axle of a geared down motor is typically coupled to a position sensor that is used to compare the angular position of the axle versus a desired position This feature of the controller makes it possible to build ultra high torque jumbo servos that can be used to drive steering columns robotic arms life size models and other heavy loads Details on how to wire the position sensing potentiometers and operating in this mode can be found in Closed Loop Position Mode on page 79 Position Feedback Position Sensor Gear box FIGURE 38 Motor with potentiometer assembly for Position operation Advanced Digital Motor Controllers User Manual 65 Motor Operating Features and Options Robote 66 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Brushless Motor Introduction SECTION 6 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 Brushless Motor Introduction Brushless motors or more accurately Brushless DC Permanent Magnet motors since there are other types of motors without brushes contain permanent magnets and electro magnets The electromagnets are arranged in groups of three
37. Operation This section addresses installation an operating issues specific to brushless motors It is applicable only to brushless motor controller models SECTION 7 Closed Loop Speed Mode This section focuses on the closed loop speed mode with feedback using analog speed sensors or encoders Information is provided on how to setup a closed loop speed control system tune the PID control loop and operate the controller SECTION 8 Closed Loop Position Mode This section describes how to configure and operate the controller in position mode using analog pulse or encoder feedback In position mode the motor can be made to smoothly go from one position to the next Information is provided on how to setup a closed loop position system tune the PID control loop and operate the controller SECTION 9 Serial RS232 USB Operation This section describes how to communicate to the controller via the RS232 or USB inter face It lists and describes in detail all configuration parameters runtime commands oper ating queries and maintenance commands available in the controller SECTION 10 MicroBasic Scripting This section describes the MicroBasic scripting language that is built into the controller It describes the features and capabilities of the language and how to write custom scripts A Language Reference is provided SECTION 11 Using the Roborun Configuration Utility This section describes the features and capabilities of the Roborun
38. Outputs for Commands on page 46 Connecting Optical Encoders Optical Incremental Encoders Overview Optical incremental encoders are a means for capturing speed and travelled distance on a motor Unlike absolute encoders which give out a multi bit number depending on the reso lution incremental encoders output pulses as they rotate Counting the pulses tells the application how many revolutions or fractions of the motor has turned Rotation velocity can be determined from the time interval between pulses or by the number of pulses within a given time period Because they are digital devices incremental encoders will measure distance and speed with perfect accuracy 36 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Connecting Optical Encoders Since motors can move in forward and reverse directions it is necessary to differentiate the manner that pulses are counted so that they can increment or decrement a position 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 fourtime multiplication of resolution is achieved by counting the rising and falling edges of each channel A and B For example an encoder that produces 250 Pulses per Revolu tion PPR can generate 1 000
39. 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 87 preceded with the _ character For example reading the Amps limit configuration for channel 1 is done using getvalue ALIM 1 See the MicroBasic Language Reference on page 155 for details on these functions and how to use them Timers and Wait The language supports four 32 bit Timer registers Timers are counters that can be loaded with a value using a script command The timers are then counting down every millisecond independently of the script execution status Functions are included in the language to load a timer read its current count value pause resume count and check if it has reached O Timers are very useful for implementing time based motion sequences A wait function is implemented for suspending script execution for a set amount of time When such an instruction is encountered script execution immediately stops and no more time is allocated to script execution until the specified amounts of milliseconds have elapsed Script execution resumes at the instruction that follows the wait Execution Time Slot and Execution Speed Protections MicroBasic scripts are executed in the free time that is available every 1ms after the con troller has completed all its motion control processing The available time can therefore vary depending on the functions that
40. RS232 Mode lessen 48 I O Configuration and Operation cc eee eee ees 49 Basic Operation ea echt e mre REN eee Vee ee 49 ppur Selection sucus RE den BRAD x dH RE RR Re EA A CRGA RUN R 50 Digital Inputs Configurations and Uses llle 50 Analog Inputs Configurations and Use llli eere 51 Analog Min Max Detection cc eee ee eee 52 Aavanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote SECTION 5 SECTION 6 SECTION 7 Min Max and Center adjustment a aan 52 Deadbarid Selection sse ura 3 MANG PG KNEE YI E 53 Exponent Factor Application e ee ee 54 Use of Analog Input nne 54 Pulse Inputs Configurations and Uses eee eee ee eee 54 Use of Pulse Input entem ee Rae ee ee ne a 55 Digital Outputs Configurations and Triggers 56 Encoder Configurations and Use 0 cece ees 56 Hall Sensor INPUTS 2s xay xa PROS ted a EXC oa che ee ee 57 Motor Operating Features and Options llle ees 59 Power Output Circuit Operation sssr 6 ce ee ene 59 Global Power Configuration Parameters 0 00 cece cee eee eee 60 PWM Frequency ssa a tn Rr RE UR KU reie n RR AG 60 Overvoltage Protection hh hn 60 Undervoltage Protection eile ll rl RR RR RR 60 Temperature Based Protection eee 60 Short Circuit Protection a ser Re XR RR n ERR e RES 61 Mixing Mode Select i llli mk lk
41. The G command is used to set the speed or position of a single motor The commands are given in values from 1000 to 1000 and represent a power level in open loop speed mode desired speed in percent of max RPM in the closed loop speed mode or a desired relative position in the closed loop position mode Syntax 1G nn mm Where nn Motor Channel May be omitted in single channel controllers mm command value in 1000 range Examples G 1500 set motor1 to 500 G 2 600 set motor2 to 600 H Load Home counter This command loads the Home count value into the Encoder or Brushless Counters The Home count can be any user value and is set using the EHOME and BHOME configuration parameters When sent without argument the command loads all counters for all motors with their preset value When sent with an argument the argument selects the motor channel This command only works if the selected motor channel is configured in Open Loop Speed mode Syntax IH nn Where nn Motor Channel Examples IH loads all counter with their preset home value IH 1 loads encoder counter 1 and brushless counter 1 with their preset home values IH 2 loads encoder counter 2 with its preset home value MG Emergency Stop Release The MG command will release the emergency stop condition and allow the controller to return to normal operation Syntax IMG M Multiple Motor Command The M command is used to set the speed or position of one or two
42. already present inside the controller 5V Out 20kOhm 33kOhm Ground FIGURE 9 Pull up switch wirings to DIN pins 30 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ 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 Ground FIGURE 10 Pull down switch wirings to DIN pins Important Warning Do not activate an output when it is used as input If the input is connected directly to a positive voltage when the output is activated a short circuit will occur Always pull the input up via a resistor 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 See also ACTR Set Analog Input Center 0 Level on page 122 Internal Resistors and Converter 20kOhm 0 5V Source 33kOhm Ground FIGURE 11 Voltage source connected to Analog inputs Advanced Digital Motor Controllers User Manual 31 Connecting Sensors and Actuators to Input Outputs Robote Connecting Potentiometers to Analog Inputs Potentiometers mounted on a foot pedal or inside a joystick are an effective method for giv ing command
43. at zero increas ing the Proportional Gain until the motor overshoots and oscillates Then add Differential gain until there is no more overshoot If the overshoot persists reduce the Proportional Gain Add a minimal amount of Integral Gain Further fine tune the PID by varying the gains from these positions To set the Proportional Gain which is the most important parameter use the Roborun util ity to observe the three following values e Command Value e Actual Position e Applied Power With the Integral Gain set to 0 the Applied Power should be Applied Power Command Value Actual Position Proportional Gain Experiment first with the motor electrically or mechanically disconnected and verify that the controller is measuring the correct position and is applying the expected amount of power to the motor depending on the command given Verify that when the Command Value equals the Actual Position the Applied Power equals to zero Note that the Applied Power value is shown without the sign in the PC utility In the case where the load moved by the motor is not fixed the PID must be tuned with the minimum expected load and tuned 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 Note that the controller uses one set of Proportional Integral and Differential
44. be issued at any time during controller operation Beware that some configuration parameters can alter the motor behavior Change configurations with care Whenever possible change configurations while the motors are stopped 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 protec tion is unlocked If locked the controller will respond a character Command Inputs Configuration and Safety The commands in this group are used to choose which type of command the controller should respond to and enable safety features TABLE 15 Command Inputs Configuration and Safety Command Set Arguments Get Argument Description ACS Enable none Enable Ana Center Safety AMS Enable none Enable Ana Min Max Safety BRUN Enable none MicroBasic Auto Start CLIN ChNbr Linearity Channel Command Linearity CPRI PriorityNbr PriorityLevel PriorityLevel Command Priority DFC ChNbr DefaultCommand Channel Default Command value ECHOF EchoOff none Disable Enable RS232 amp USB Echo RWD RS232 WdogTimeout none RS232 Watchdog 0 to disable TELS Telemetry String String Telemetry Startup String 116 Advanced Digital Motor Controllers User Manual Version 1 2 January
45. channel nn power scaling Allowed Range 25 to 100 Default Value 10096 MRPM Max RPM Value This parameter lets you select which speed value would be considered as 1000 as the internal relative speed parameter The controller can measure speed in absolute RPM val ues However for internal use in some modes controller uses a speed value relative to a user defined max RPM value The MRPM value lets you select what that max level will be Syntax MRPM cc nn 144 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Motor Channel Configuration and Set Points Where Allowed Range Default Value Notes cc Channel number nn Max RPM value 1 to 65000 3000 The relative speed can be read using the sr query MXTRN Turns between Limits This parameter is used in position mode to measure the speed when an analog or pulse feedback sensor is used The value is the number of motor turns between the feedback value of 1000 and 1000 When encoders are used for feedback this parameter is auto matically computed from the encoder configuration and can thus be omitted See Closed Loop Position Mode on page 79 for a detailed discussion Syntax Where Allowed Range Default Value Example PIDM PID Mode AMXTRN cc nn MXTRN cc cc Motor channel nn Number of turns x 10 10 to 100000 1000 AMXTRN 1 2000 Set max turns for motor 1 to 200 0 tur
46. counter _MGO _MG None Release Shutdown MOTCMD _M Command1 Command2 Set Command for 1 or 2 channels _MOTPOS _P Channel Position Set Position _MOTVEL S Channel Velocity Set Velocity _SBLCNTR _CB Counter Set Brushless Counter _SENCNTR Ec Channel Counter Set Encoder Counters VAR VAR Value Set User Variable 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 The Configuration Item can be any one from the table below The Index is used to select one of the Configuration Item in multi channel configurations When accessing a configuration parameter that is not part of an array index can be omitted or an index value of 0 can be 172 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction used Details on the various configurations items their effects and acceptable values can be found in the Controller s User Manual Note that most but not all configuration parameters are accessible via the SetConfig or GetConfig function No check is performed that the value you store is valid so this function must
47. effect of this part of the algorithm is to give a boost of extra power when starting the motor due to changes to the desired position value The differential component will also help dampen any overshoot and oscillation Advanced Digital Motor Controllers User Manual 85 Closed Loop Position Mode Robote The Integral component of the algorithm performs a sum of the error over time In the posi tion mode this component helps the controller reach and maintain the exact desired posi tion When the error would otherwise be too small to energize the motor using the Proportional component alone Only a very small amount of Integral Gain is typically required in this mode PID tuning in Position Mode As discussed above three parameters Proportional Gain Integral Gain and Differential Gain can be adjusted to tune the position control algorithm The ultimate goal in a well tuned PID is a motor that reaches the desired position quickly without overshoot or oscilla tion Because many mechanical parameters such as motor power gear ratio load and inertia are difficult to model tuning the PID is essentially a manual process that takes experimenta tion The Roborun PC utility makes this experimentation easy by providing one screen for chang ing 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
48. from one position to the other In more sophisticated systems the acceleration deceleration and velocity can be changed on the fly using Serial USB commands or from within a MicroBasic script When using Encoders as feedback sensors the controller can accurately measure the speed and the number of motor turns that have been performed at any point in time The complete positioning algorithm can be performed with the parameters described above When using analog or pulse sensors as feedback the system does not have a direct way to measure speed or number of turns It is therefore necessary to configure an additional parameter in the controller which determines the number of motor turns between the point the feedback sensor gives the minimum feedback value 1000 to the maximum feedback value 1000 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Control Loop Description Control Loop Description The controller performs the Position mode using a full featured Proportional Integral and Differential PID algorithm This technique has a long history of usage in control systems and works on performing adjustments to the Power Output based on the difference mea sured between the desired position set by the user and the actual position captured by the position sensor Figure 47 shows a representation of the PID algorithm Every 1 millisecond the controller measures the actual motor pos
49. issued from a MicroBasic script 134 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Brushless Specific Commands Syntax ABHOME nn BHOME Where nn counter value to be loaded Default Value 0 BLFB Encoder or Hall Sensor Feedback On brushless motors system equipped with optical encoders this parameter lets you select the encoder or the brushless hall sensors as the source of speed or position feed back Encoders provide higher precision capture and should be preferred whenever possi ble Syntax ABLFB nn BLFB Where nn 0 hall sensors feedback 1 encoder feedback Default Value O hall sensor BLL Brushless Counter Low Limit This parameter allows you to define a minimum brushless count value at which the control ler 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 In this case the Low Limit Count is the desired position when a command of 1000 is received Syntax BLL nn BLL Where nn Counter value Default Value 2000 Example BLL 10000 Set brushless counter low limit BLLA Brushless Counter Low Limit Action This parameter lets you select what kind of action should be taken when the low
50. item indicating that this parameter has been changed but not yet saved to the controller Clicking on the Save to the controller button moves this parameter into the controller s RAM and it becomes effective immediately This also also saves the parameter into the controller s EEPROM so that it is loaded the next times the controller is powered up again Advanced Digital Motor Controllers User Manual 181 Using the Roborun Configuration Utility Robote Entering Parameter Values Depending on the node type values can be entered in one of many forms Numerical e Boolean e g Enable Disable 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 Some parameters like Commands or Actions have the option to apply to one or the other of the motor channels For this type of parameters next to the menu list are checkboxes one for each of the channels Checking one or the other tells the controller to which chan nel this input or action should apply 4j Encoder 1 No Action nee Motor Command RPM Feedback FIGURE 57 Parameter applying to one or more channe
51. list of action is the same as in the DINA digital input action list see DINA Digital Input Action on page 120 Syntax AEHLA cc nn EHLA cc Where ce Input channel number aa DIN Action List mm mot1 16 mot2 32 Default Value 0 no action for each encoder EHOME Encoder Counter Load at Home Position This parameter contains a value that will be loaded in the selected encoder counter when a home switch is detected or when a Home command is received from the serial USB or issued from a MicroBasic script Syntax EHOME cc nn EHOME Where ce channel number nn counter value to be loaded Default Value 0 ELL Encoder Low Count Limit This parameter allows you to define a minimum count value at which the controller will trig ger 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 In this case the Low Limit Count is the desired position when a command of 1000 is received Syntax ELL cc nn ELL Where cc Channel number nn Counter value Default Value 20000 Example ELL 1 100000 Set encoder 1 low limit Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Encoder Operations ELLA Encoder Low Li
52. number nn Deadband in 96 Allowed Range 0 to 50 Default Value 0 126 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Pulse Input Configuration PINA Pulse Input Use 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 com mand or feedback should act on Feedback can be position feedback if potentiometer is used or speed feedback if tachometer is used Syntax APINA cc nn mm PINA cc Where ce Input channel number nn 0 unused 1 command 2 feedback mm mot1 16 mot2 32 Default Value All channels unused Example APINA 1 17 Sets Pulse channel 1 as command for motor 1 PLIN Pulse Linearity This parameter is used for applying an exponential or a logarithmic transformation on a pulse input There are 3 exponential and 3 logarithmic choices 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 Syntax APLIN cc nn PLIN cc Where ce 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 Default Value All channels linear PMAX
53. of correc tions adjustments and checks to the R C commands as described below Automatic Joystick Range Calibration For best control accuracy the controller can be calibrated to capture and use your radio s specific timing characteristics and store them into its internal Flash memory This is done using a simple calibration procedure described on page 52 Deadband Insertion The controller allows for a selectable amount of joystick movement to take place around the center position before activating the motors See the full description of this feature at Deadband Selection on page 53 Command Exponentiation The controller can also be set to translate the joystick motor commands so that the motor respond differently depending on whether the joystick is near the center or near the extremes Five different exponential or logarithmic translation curves may be applied Since this feature applies to the R C Analog and RS232 modes it is described in detail in Exponent Factor Application on page 54 in the General Operation section of the manual Reception Watchdog Immediately after it is powered on if in the R C mode the controller is ready to receive pulses from the RC radio If valid pulses are received on any of the enabled Pulse input channels the controller will consider the RC Pulse mode as active If no higher priority command is currently active See Input Command Modes and Priorities on page 41 the captured RC pulses
54. of the desired motor to the right so that the motor starts rotating and verify that a positive speed is reported Move the cursor to the left and verify that a negative speed is reported 7 f the tachometer or encoder polarity is the same as the applied command the wiring is correct 8 If the tachometer polarity is opposite of the command polarity then reverse the motor s wiring reverse the tachometer wires or change the capture polarity in the Input configuration If an encoder is used swap its ChA and ChB outputs Alterna tively swap the motor leads if using a brushed DC motor only 9 Set the controller operating mode to Closed Loop Speed mode using the Roborun util ity 10 Move the cursor and verify that speed stabilizes at the desired value If speed is unsta ble tune the PID values Advanced Digital Motor Controllers User Manual 75 Closed Loop Speed Mode Robote Important Warning It is critically important that the tachometer or encoder wiring be extremely robust If the speed sensor reports an erroneous speed or no speed at all the controller will consider that the motor has not reached the desired speed value and will gradually increase the applied power to the motor until the closed loop error is triggered and the motor is then stopped Controlling Speed in Closed Loop When using encoder feedback or Hall Sensor brushless motor feedback the controller will measure and report speed a
55. page 189 In case the controller is not connected via a bi directional link and can only send informa tion one way typically to a remote host the controller can be configured to output a user selectable set of operating parameters at a user selectable repeat rate See Query His tory Commands on page 110 Using the Controller in Serial USB RS232 Mode The serial mode allows full control over the controller s entire functionality The controller will respond a large set of commands These are described in detail in Serial RS232 USB Operation on page 87 48 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Basic Operation SECTION 4 I O Configuration and Operation This section discusses the controller s normal operation in all its supported operating modes Basic Operation The controller s operation can be summarized as follows Receive commands from a radio receiver joystick or a microcomputer e Activate the motor according to the received command e Perform continuous check of fault conditions and adjust actions accordingly Report real time operating data The diagram below shows a simplified representation of the controller s internal operation The most noticeable feature is that the controller s serial digital analog pulse and encoder inputs may be used for practically any purpose Configuration Y RS232 U5B E 2c Configuration Configuration Command
56. parameters that deal with the Analog Digital Pulse I O encoder and communication The right tree includes all parameters related to the power drive section The exact content of the trees changes according to the controller that is attached to the PC Commands Parameters See Command Inputs Configuration and Safety on page 116 for details on this group of parameters In the commands menu we can set the command priorities the linearization or exponenti ation that must be performed on that input 4 9 Commands 4 3 Command Priorities Priority 1 RS232 Priority 2 Pulse Priority 3 None 4 Y Command Adjustments Linearity 1 Linear Linearity 2 Linear FIGURE 65 Commands parameters Advanced Digital Motor Controllers User Manual 185 Using the Roborun Configuration Utility Robote Then a number of Command Safety parameters can be configured These are the Watch dog timeout when receiving Serial commands and the safety ranges for analog com mands 4 9 Command Safety 4 d RS232 Safety Watchdog ms 1000 4 y Pulse Safety Keep within Min Max Disabled 49 Analog Safety Center to Start Disabled Keep within Min Max Disabled FIGURE 66 Command Safety parameters The Telemetry parameter contains the string that is executed whenever controller is first powered up This parameter is typically loaded with a series of real time queries that the the controller automatically and periodically perform Q
57. period should be only as short as it needs to be in order to avoid using processing resources unnecessarily For example a script that monitors the battery and triggers an output when the battery is low does not need to run every millisecond A wait time of 100ms would be adequate and keep the controller from allocating unnecessary time to script execution Optimizing Scripts for Integer Math Scripts only use integer values as variables and for all internal calculation This leads to very fast execution and lower computing resource usage However it does also cause limita tion These can easily be overcome with the following techniques First if precision is needed work with smaller units In this simple Ohm law example whereas 10V divided by 3A results in 3 Ohm the same calculation using different units will give a higher precision result 10000mV divided by 3A results in 3333 mOhm Second the order in which terms are evaluated in an expression can make a very big differ ence For example 10 20 1000 will produce a result of 0 while 10 1000 20 produces 5000 The two expressions are mathematically equivalent but not if numbers can only be integers Advanced Digital Motor Controllers User Manual 153 MicroBasic Scripting Robote Script Examples Several sample scripts are included in the RoborunPlus installation Below is a continuous script that checks the heat sink temperature at both sides of the controller e
58. power is turned off Protecting against Loss of Command Device By default the controller is protected against the accidental loss of connection to the com mand potentiometer This is achieved by adding resistors in series with the potentiometer that reduce the range to a bit less than the full OV to 5V swing If one or more wires to the potentiometer are cut the voltage will actually reach OV and 5V and be considered a fault condition if that protection is enabled See Connecting Potentiometers for Commands with Safety band guards on page 32 Safety Switches Any Digital input can be used to add switch activated protection features For example the motor s can be made to activate only if a key switch is turned On and a passenger is pres ent on the driver s seat This is done using by configuring the controller s Digital inputs See Digital Inputs Configurations and Uses on page 50 Advanced Digital Motor Controllers User Manual 47 Command Modes Robote 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 See Run Tab on
59. the Motor current and not on the Battery current See Bat tery Current vs Motor Current on page 23 for a discussion of the differences Selectable Amps Threshold Triggering The controller can be configured to detect when the Amp on a motor channel exceed a userdefined threshold value and trigger an action if this condition persists for more than a preset amount of time The list of actions that may be triggered is shown in the table below TABLE 9 Possible Action List when Amps threshold is exceeded Applicable Action Channel Description No Action Input causes no action Safety Stop Selectable Stops the selected motor s channel until command is moved back to 0 or command direction is reversed Emergency stop All Stops the controller entirely until controller is powered down or a special command is received via the serial port This feature is very different than Amps limiting Typical uses for it are for stall detection or soft limit switches When for example a motor reaches an end and enters stall condi tion the current will rise and that current increase can be detected and the motor be made to stop until the direction is reversed Advanced Digital Motor Controllers User Manual 63 Motor Operating Features and Options Robote Programmable Acceleration amp Deceleration When changing speed command the controller will go from the present speed to the desired one at a user selectab
60. the control ler s features can be accessed and operated to their fullest extent When operating in RC or analog input serial communication can still be used for monitor ing or telemetry When connecting the controller to a PC the serial mode makes it easy to perform simple diagnostics and tests including Sending precise commands to the motor Reading the current consumption values and other parameters e Obtaining the controller s software revision and date Reading inputs and activating outputs e Setting the programmable parameters with a user friendly graphical interface Updating the controller s software Advanced Digital Motor Controllers User Manual 87 Serial RS232 USB Operation I RO boteQ Serial Port Configuration The controller s serial communication port is set as follows 115200 bits s e 8 bit data e 1 Start bit e 1 Stop bit e No Parity Communication is done without flow control meaning that the controller is always ready to receive data and can send data at any time These settings cannot be changed You must therefore adapt the communication set tings in your PC or microcomputer to match those of the controller Connector RS232 Pin Assignment 14 25 8 1 000000000000 0000009000 0000000000000 O 0000000 1 13 15 9 FIGURE 48 DB25 and DB15 Connector pin locations When used in the RS232 mode the pins on the controller s DB15 or DB25 connector depending on t
61. the controller will never switch to a lower priority mode In the pulse mode the mode is considered active if a valid pulse train is found and remains present In analog mode the mode is considered active at all time unless the Center at Start safety is enabled In this case the Analog mode will activate only after the joystick has been cen tered The Keep within Min Max safety mode will also cause the analog mode to become inactive and thus enable the next lower priority mode if the input is outside of a safe range The example in Figure 23 shows the controller connected to a microcomputer a RC radio and an analog joystick If the priority registers are set as their factory default configuration below 1 Serial 2 Pulse 3 Analog then the active command at any given time is given in the table below Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Input Command Modes and Priorities TABLE 4 Priority resolution example Microcomputer Valid Pulses Analog joystick Command mode Sending commands Received within safe Min Max selected Yes Don t care Don t care Serial No Yes Don t care RC mode No No Yes Analog mode No No No User selectable default value Note that it is possible to set a priority level to Disable For example the priority table 1 Serial 2 RC Pulse 3 Disable will only arbitrate and use Serial or RC Pulse command
62. the following Print Label Print Hello World Label name should start with alphabetical character and followed by zero or more alphanu meric characters or underscore Label names cannot start with underscore Labels names cannot match any of Micro Basic reserved words Label names are case insensitive that is Print Label is identical to print label The scope of a label extends whole the program Labels cannot be declared more than once in the program 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 Option Explicit Variables can be declared using DIM keyword see Dim Variable Declaration on page 159 Variable name should start with alphabetical character and followed by zero or more alpha numeric characters or underscore Variable names cannot start with underscore Variable names cannot match any of Micro Basic reserved words Variable names are case insensitive that is VAR is identical to var The scope of a variable extends whole the program Variables cannot be declared more than once in the program Arrays is special variables that holds a set of values of the variable type Arrays are declared using DIM command see Dim Variable Declaration on page 159 To access specific element in the array you can use t
63. the inputs Syntax D cc Reply D nn Where ce Digital Inout number nn b1 b2 2 4 b3 4 bn 2 102 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Runtime Queries Examples Notes Q D R D 17 Inputs 1 and 5 active all others inactive The total number of Digital input channels varies from one controller model to another and can be found in the product datasheet DI Read individual Digital Inputs Reports the status of an individual Digital Inputs The query response is a boolean value 0 or 1 Syntax Reply Where Examples Notes DI cc DI n1 n2 n3 n4 nn cc Digital Input number n1 nn 0 or 1 state for each input Q DI R Dl 1 0 1 0 1 0 Q DI 1 R Dl 0 The total number of Digital input channels varies from one controller model to another and can be found in the product datasheet DO Digital Output Status Reads the actual state of the digital outputs The response to that query is a single number which must be converted into binary in order to read the status of the individual output bits Syntax Reply Where Examples Notes DO cc DO nn ce Digital Input number nn d1 d2 2 4 d3 4 dn 277 Q DO R DO 17 Outputs 1 and 5 active all others inactive Q DO 1 R DO 1 Queried output 1 is active When querying an individual output the reply is O or 1 depending o
64. the opposite direction back to the power source It is therefore essential that the controller be connected to rechargeable batteries If a power supply is used instead the current will attempt to flow back in the power supply during regeneration potentially damaging it and or the controller Regeneration can also cause potential problems if the battery is disconnected while the motors are still spinning In such a case the energy generated by the motor will keep the controller On and depending on the command level applied at that time the regenerated 24 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Using the Controller with a Power Supply current will attempt to flow back to the battery Since none is present the voltage will rise to potentially unsafe levels The controller includes an overvoltage protection circuit to pre vent damage to the output transistors see Using the Controller with a Power Supply on page 25 However if there is a possibility that the motor could be made to spin and gener ate a voltage higher than 40V a path to the battery must be provided even after a fuse is blown This can be accomplished by inserting a diode across the fuse as shown in Figure 2 on page 18 Please download the Application Note Understanding Regeneration from the www robo teq com for an in depth discussion of this complex but important topic Important Warning Use th
65. the placement between sensors be accurate On precision motors this results in a stable speed being reported On less elaborate motors such as hub motors the reported speed may oscillate by a few percents The motor s number of poles must be entered as a controller parameter in order to pro duce an accurate RPM value See discussion above The speed information can then be used as feedback in a closed loop system Motor with a more precise Hall sensor position ing will work better in such a configuration than less precise motors Distance Measurement using Hall Sensors The controller automatically detects the direction of rotation keeps track of the number of Hall sensor transition and updates a 32 bit up down counter The number of counts per rev olution is computed as follows Counts per Revolution Number of Poles 6 The counter information can then be read via the Serial USB port or can be used from a MicroBasic script The counter can also be used to operate the brushless motor in a Closed Loop Position mode within some limits Advanced Digital Motor Controllers User Manual Brushless Motor Connections and Operation Robote 72 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Mode Description SECTION 7 Closed Loop Speed Mode This section discusses the controller s Closed Loop Speed mode Mode Description In this mode an analog or digital
66. the voltage rises above the nominal output of the power supply The controller can be configured to activate the load using a digi tal output configured to turn on When overvoltage condition is detected 26 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Controller Connections SECTION 2 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 located on the back of the unit and on the front and DSub connectors for all necessary connections The power connections are used for connection to the batteries and motor and will typi cally carry large current loads Details on the controller s power wiring can be found at Connecting Power and Motors to the Controller on page 15 The DSub connectors are used for all low voltage low current connections to the Radio Microcontroller sensors and accessories This section covers only the connections to sen sors and actuators For information on how to connect the RS232 port see Serial RS232 USB Operation on page 87 The remainder of this section describes how to connect sensors and actuators to the con troller s low voltage I O pins that are located on the DSub connectors Advanced Digital Motor Controllers User Manua
67. to 15 pin cable is provided by Roboteq for controllers with 15 pin connectors Controllers with 25 pins connectors are fitted with a USB port that can be used with any USB cables with a type B connector Extending the RS232 Cable RS232 extension cables are available at most computer stores However you can easily build one using a 9 pin DB9 male connector a 9 pin DB9 female connector and any 3 con ductor cable DO NOT USE COMMERCIAL 9 PIN TO 25 PIN CONVERTERS as these do not match the 25 pin pinout of the controller These components are available at any elec tronics distributor A CAT5 network cable is recommended and cable length may be up to 100 30m Figure 50 shows the wiring diagram of the extension cable DB9 Female DB9 Male 10 O1 O6 6O RX Data 2 9 dO2 Data Out ON 7 Q TX Data 3 9 O3 Data In O 8 8 O 40 O4 O9 90 GND 5 0 05 GND FIGURE 50 RS232 extension cable connector wiring diagram Advanced Digital Motor Controllers User Manual 89 Serial RS232 USB Operation IRo boteQ USB Configuration USB is available on some controller models and provides a fast and reliable communication method between the controller and the PC After plugging the USB cable to the controller and the PC the PC will detect the new hardware and install the driver Upon successful installation the controller will be ready to use The controll
68. to it in reverse direction Overvoltage When battery voltage above overlimit Shunt load activation Overtemperature When overtemperature limit exceeded Fan activation Warning buzzer Status LED When status LED is ON Place Status indicator in visible location Encoder Configurations and Use On controller models equipped with encoder inputs external encoders enable a range of precision motion control features See Connecting Optical Encoders on page 36 for a detailed discussion on how optical encoders work and how to physically connect them to the controller The diagram below shows the processing chain for each encoder input apak Counter Count lt Min Selectable Action 32 bit Count gt Max Selectable Action Encoder JIL Kasa Use Select x Command Feedback Speed in RPM Speed Measure Scalling Speed as o k ry of Max RPM Encoder PPR Max RPM FIGURE 34 Encoder input processing The encoder s two quadrature signals are processed to generate up and down counts depending on the rotation direction The counts are then summed inside a 32 bit counter 56 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 IRo boteQ Hall Sensor Inputs The counter can be read directly using serial commands and or can be used as a position feedback source for the closed loop position mode The counter can be compared to user defined Min and or Max values and trigg
69. to the controller In closed loop mode a potentiometer is typically used to provide position feedback information to the controller Connecting the potentiometer to the controller is as simple as shown in the diagram on Figure 12 The potentiometer value is limited at the low end by the current that will flow through it and which should ideally not exceed 5 or 10mA If the potentiometer value is too high the analog voltage at the pot s middle point will be distorted by the input s resistance to ground of 53K A high value potentiometer also makes the input sensitive to noise particularly if wiring is long Potentiometers of 1K or 5K are recommended values 45V Internal Resistors and Converter 20kOhm 53xohm 1K to 10K Ohm Pot Ground FIGURE 12 Potentiometer wiring in Position mode Because the voltage at the potentiometer output is related to the actual voltage at the con troller 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 or see ACTR Set Analog Input Center 0 Level on page 122 Connecting Potentiometers for Commands with Safety band guards When a potentiometer is used for sensing a critical command Speed or Brake for exam ple it is critically important that the controller reverts to a safe condition in case wiring
70. value reached by this input Clicking on the Clear button for that channel 190 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 IlRoboteQ resets the Min and Max The chart can be paused or it can be cleared and the recorded val ues can be saved in an Excel format for later analysis Off Encoder Count 1 Encoder Count 2 Motor Command 1 Motor Command 2 Motor Power 1 Capture Motor Power 2 soo np AA AA AA AA AA AA RP NUNT ME rr v Min Max Cr i F B uv 0 305 161 pe 80 E Y H Batt Amps 2 A oU B B Feedback 1 0 35 161 j J Feedback 2 Pal L Bl NCU Temp 0 54 5 J 1 F Heatsink Temp 1 20 M E B Heatsink Temp 2 40690 79721 163056 J S Controller Volt 0 Bl Battery Volts 40692 79717 163060 4 i 5V Output 6x10 bas 20 endis E Speed 1 m E E Speed 2 pud 40 n Speed 1 RPM mm 4 Speed 2 RPM 60 m m E Pause J Clear Chart 1100 yg D a ig 1 1 1 1 1 D 1 1 1 B Gearlog FIGURE 75 Chart recorder Handles on the left vertical axis may be used to zoom in a particular vertical range Simi lar handles on the horizontal axis can be used to change the scrolling speed of the chart Aavanced Digital Motor Controllers User Manual 191 Using the Roborun Configuration Utility Robote Console Tab The console tab is useful for practicing low level commands and viewing the raw data exchanged by the controller and the PC
71. 00 Decceleration ms 500 Operating Mode Open Loop Speed FIGURE 71 Motor Output parameters When operating in the Closed Loop the Closed Loop parameters let you set the closed loop parameters such as PID gain 4 O Closed Loop Parameters PID Mode Flat PID 4 Proportional Gain 2 0 PGain 0 2 0 PGain 25 PGain 50 PGain 75 PGain 100 b Integral Gain 2 0 D Differential Gain 2 0 Integrator Limit 75 100 io pee FIGURE 72 Closed Loop parameters 188 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 IlRoboteQ 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 FR Roborun tere sg Motor Control Utility IB Wok Che Rev 1 1 5 22 10 Mew Pinout Control Unit H Type Controller Model DC245 Configuration Run Console Scripting amp ril E nsus Puse Qo WFETs0f eo o eo 2786 Cmdi O NC 0 Pht Vi 2791 Cmd2 0 NC 0 Pin2 He Vc Volt HWFaull Heat Overvolt UnderVolt Short iwrat 9 e cc Fe T ls Y V Nc O wc 0 Pina Qo o2 Qo Ding Qs Qo Qo Qoo Qoo Qs done T lis Ec Geo Enci8 Enia Qro G 690 Qoo Qoous Dous ia ons eo oo GPdinig Go dou7 oos 0 MTmp2 0 Ping commen JE EI mee g EJE torsi 58 Stop _ Enab
72. 2000000000 counts Syntax CB Reply CB nn Where nn absolute counter value CBR Read Brushless Count Relative One brushless motor controllers returns the number of Hall sensor transition value that have been measured from the last time this query was made Relative counter read is sometimes easier to work with compared to full counter reading as smaller numbers are usually returned Syntax CBR Reply CBR nn nn Where nn counts since last read CIA Read Internal Analog Command Returns the motor command value that is computed from the Analog inputs whether or not the command is actually applied to the motor This query can be used for example to read the command joystick from within a MicroBasic script or from an external microcom puter even though the controller may be currently responding to RS232 or Pulse command because of a higher priority setting The returned value is the raw Analog input value with all the adjustments performed to convert it to a command Min Max Center Deadband Lin earity Syntax CIA Reply CIA nn Where nn command value in 1000 range Advanced Digital Motor Controllers User Manual 101 Serial RS232 USB Operation IRo boteQ CIP Read internal Pulse Command Returns the motor command value that is computed from the Pulse inputs whether or not the command is actually applied to the motor This query can be used for example to read the command joystick from
73. 300 0 600 600 600 300 300 600 600 0 1000 1000 1000 1000 1000 1000 1000 300 300 600 0 600 0 522 90 300 600 900 300 900 300 762 120 300 1000 1000 700 1000 1000 1000 400 300 300 0 600 0 600 90 522 300 600 300 900 300 900 120 762 300 1000 700 1000 1000 1000 400 1000 600 300 900 300 900 300 708 480 600 600 1000 0 1000 200 888 360 600 1000 1000 400 1000 1000 1000 200 600 300 300 900 300 900 480 708 600 600 0 1000 200 1000 360 888 600 1000 400 1000 1000 1000 200 1000 1000 300 1000 700 1000 400 900 1000 1000 600 1000 400 1000 200 1000 1000 1000 1000 1000 0 1000 1000 1000 1000 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Motor Channel Parameters TABLE 8 Mixing Mode characteristics Input Mode 1 Mode 2 Mode 3 Throttle Steering M1 M2 M1 M2 M1 M2 1000 300 700 1000 400 1000 1000 900 1000 600 400 1000 200 1000 1000 1000 1000 1000 0 1000 1000 1000 1000 1000 Motor Channel Parameters User Selected Current Limit Settings The controller has current sensors at each of its output stages Every 1 ms this current is measured and a correction to the output power level is applied if higher than the user pre set value 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
74. C Internal Transistor Ground FIGURE 7 Connecting inductive loads to DOUT pins Important Warning Overvoltage spikes induced by switching inductive loads such as solenoids or relays will destroy the transistor unless a protection diode is used Advanced Digital Motor Controllers User Manual 29 Connecting Sensors and Actuators to Input Outputs Robote 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 When the digital outputs are in the Off state these outputs can be used as inputs to read the presence or absence of a voltage at these pins 5V Out Epi 1K aid Input 10 DIN12 to DIN19 Buffer i DOUT1 to DOUT7 CU gt Output Driver GND FIGURE 8 Switch wiring to Inputs shared with Outputs For better noise immunity an external pull up resistor should be installed even though one is already present inside the controller Connecting Switches or Devices to direct Digital Inputs The controller Digital Inputs are high impedance lines with a pull down resistor built into the controller Therefore it will report an On state if unconnected and a simple switch as shown on Figure 9 is necessary to activate it When a pull up switch is used for better noise immunity an external pull down resistor should be installed even though one is
75. CII characters un Default Value empty string Examples ATELS A V T 4200 Controller will issue Amps Volts and temper ature information automatically upon power up at 200ms intervals Digital Input Output Configurations These parameters configure the operating mode and how the inputs and outputs work TABLE 16 Digital Input Output Configurations Command Set Arguments Get Argument Description DINA InputNbr Action InputNbr Digital Input Action DINL InputNbr Action InputNbr Digital Input Active Level DOA OutputNbr Action InputNbr Digital Output Action DOL OutputNbr Action InputNbr Digital Output Action DINA Digital Input Action This parameter sets the action that is triggered when a given input pin is activated The action list includes limit switch for a selectable motor and direction use as a deadman Switch emergency stop safety stop or invert direction Embedded in the parameter is the motor channel s to which the action should apply Syntax DINA cc aa mm DINA cc Where ce Input channel number aa 0 no action 1 safety stop emergency stop Motor stop forward limit switch reverse limit switch invert direction run MicroBasic script load counter with home value mm mot1 32 mot2 64 ONQO 01 sb ON Default Value 0 no action for each input Example ADINA 1 33 Input 1 as safety stop for Motor 1 l e 33 1 safety stop 32 Motor1
76. Counts per Revolution CPR after quadrature A Channel AI EJ rn 1 Pulse 4 Transitions B Channel 4 Counts Quadrature QM a oe eee Signal Pl LL B ttl LLL EL bid ti Count Up Count Down FIGURE 19 Quadrature encoder output waveform The figure below shows the typical construction of a quadrature encoder As the disk rotates in front of the stationary mask it shutters light from the LED The light that passes through the mask is received by the photo detectors Two photo detectors are placed side by side at so that the light making it through the mask hits one detector after the other to produces the 900 phased pulses O LED light source gf Rotating cu A encoder disk Stationary mask MN ud Photodetector 4 FIGURE 20 Typical quadrature encoder construction Unlike absolute encoders incremental encoders have no retention of absolute position upon power loss When used in positioning applications the controller must move the motor until a limit switch is reached This position is then used as the zero reference for all subsequent moves Advanced Digital Motor Controllers User Manual 37 Connecting Sensors and Actuators to Input Outputs Robote Recommended Encoder Types The module may be used with most incremental encoder module as long as they include the following features e Two quadrature outputs Ch A Ch B single ended or differential signals e 3 0V minimum swing between O
77. Delay ATRIG Channel AmpTrigger Channel Amps Trigger Value CLERD Channel LoopErrorDetection Channel Close Loop Error Detection ICAP Channel Capped Int Channel PID Integral Cap KD Channel DiffGain Channel PID Differential Gain KI Channel IntGain Channel PID Integral Gain KP Channel PropGain Channel PID Proportional Gain MAC Channel Acceleration Channel Motor Acceleration MDEC Channel Deceleration Channel Motor Deceleration MMOD Channel OperatingMode Channel Motor Operating Mode MVEL Channel DefPositionVel Channel Motor s Default Position Velocity MXPF Channel MaxPower Channel Motor Max Power Forward MXPR Channel MaxPower Channel Motor Max Power Reverse MXRPM Channel MaxRPM Channel Motor RPM at 10096 MXTRN Channel MaxTurns Channel Number of Motor Turns between Limits PIDM Channel PIDMode Channel PID Mode Advanced Digital Motor Controllers User Manual 139 Serial RS232 USB Operation IRo boteQ ALIM Amp Limit This is the maximum Amps that the controller will be allowed to deliver to a motor regard less 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 Syntax AALIM cc nn ALIM cc Where ce Motor channel nn Amps 10 Allowed Range 10A
78. Double quote Backslash Null Alert Backspace Form feed New line Carriage return Horizontal tab 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 Since a hexadecimal escape sequence can have a variable number of hex digits the string literal x123 contains a single character with hex value 123 To create a string containing the character with hex value 12 followed by the character 3 one could write x00123 So to represent a string with the statement Hello World followed by a new line you may use the following syntax Hello World n Blocks and Labels A group of executable statements is called a statement block Execution of a statement block begins with the first statement in the block Once a statement has been executed the next statement in lexical order is executed unless a statement transfers execution elsewhere A label is an identifier that identifies a particular position within the statement block that can be used as the target of a branch statement such as GoTo GoSub or Return 156 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction Variables Arrays Label declaration statements must appear at the beginning of a line Label declaration statements must always be followed by a colon as
79. Feedback BLL BLLowLimit none BL Counter Low Limit BLLA BLLoLimAction none BL Counter Low Limit Action _BLSTD StallDetection none BL Stall Detection BPOL NumberOfPoles none Number of Poles of BL Motor Sepex Specific _SXC CurvePoint Value Point Sepex Curve Points _SXM MinimumCurrent none Minimum Field Current Encoder EHL Channel EncHighLimit Channel Encoder High Limit _EHLA Channel EncHiLimAction Channel Encoder High Limit Action _EHOME Channel HomeCount Channel Encoder Counter Load at Home Position ELL Channel EncLowLimit Channel Encoder Low Limit ELLA Channel EncLoLimAction Channel Encoder Low Limit Action EMOD Channel EncoderUse Channel Encoder Use _EPPR Channel EncoderPPR Channel Encoder PPR _KDC1 PointNbr Point KD Curve Points for Motor1 Ch1DiffGainCurve KDC2 PointNbr Point KD Curve Points for Motor2 Ch2DiffGainCurve _KIC1 PointNbr Ch1IntGainCurve Point KI Curve Points for Motor1 _KIC2 PointNbr Ch2lntGainCurve Point KI Curve Points for Motor2 _KPC1 PointNbr Point KP Curve Points for Motor1 Ch1PropGainCurve1 _KPC2 PointNbr Point KP Curve Points for Motor2 Ch2PropGainCurve Aavanced Digital Motor Controllers User Manual 175 MicroBasic Scripting Robote SetTimerCount GetTimerCount These two functions used to set get timer count SetTimerCount lt index gt lt milliseconds gt GetTimerCount lt index gt Where index is the timer index 1 4 and millisec
80. IRoboteQ Motor Channel Configuration and Set Points ATRIG Amps Trigger Level This parameter lets you select Amps threshold value that will trigger an action This thresh old 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 Syntax AATRIG cc nn ATRIG cc Where ce Motor channel nn Amps 10 Default Value 75 of Max Datasheet rating Examples AATRIG 2 550 Set Amps Trigger to 55 0A CLERD Closed Loop Error Detection 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 amp error level Syntax ACLERD cc nn CLERS Where ce channel nn 0 Detection disabled 1 250ms at Error gt 100 2 500ms at Error gt 250 3 1000ms at Error gt 500 Default Value 2 Example ACLERD 2 Motor will stop if command feedback is greater than 100 for more than 250ms ICAP Integral Cap 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
81. IRoboteQ Motor Channel Configuration and Set Points MAC Motor Acceleration Rate 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 Brushless motor controllers use the hall sensor for measuring actual speed and accelera tion will also be in actual RPM s When using the controller without speed sensor the acceleration value is relative to the Max RPM configuration parameter which itself is a userprovide number for the speed nor mally expected speed at full power Assuming that the Max RPM parameter is set to 1000 and acceleration value of 10000 means that the motor will go from 0 to full speed in exactly 1 second regardless of the actual motor speed Syntax MAC cc nn MAC cc Where ce Motor channel nn Acceleration time in 0 1 RPM per seconds Allowed Range 100 to 32000 MDEC Motor Deceleration Rate This parameter sets the motor deceleration It is the same as MACC but for when the motor goes from a high speed to a lower speed Syntax AMDEC cc nn MDEC cc Where ce Motor channel nn Deceleration time in 0 1 RPM per second Allowed Range 100 to 32000 MMOD Operating Mode This parameter lets you select the operating mode for that channel Syntax AMMOD cc nn MMOD cc Where ce moto
82. OL nn Number of poles 2 136 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote General Power Stage Configuration Commands General Power Stage Configuration Commands This section describes all the configuration parameters that relate to the controller s power stage and that are common to both outputs in multi channel controllers TABLE 21 General Power Stage Configuration Commands Command Parameter Description CAD Address Controller Address OVL Voltage Overvoltage Limit UVL Voltage Undervoltage Limit THLD Level Short Circuit detection threshold MXMD Mode Number Mixed Mode PWMF Frequency PWM Frequency CAD Controller Address This parameter allows the user to set or read an individual address number for that control ler that can be used to identify that specific unit when used into a network The address is an 8bit number from 0 to 255 The factory default value is O OVL Overvoltage Limit Syntax Where Allowed Range Example Default Value Notes CAD nn CAD nn Address 0 255 ACAD 55 Set address to 55 0 Address is not currently used by the controller Address may be useful to identify a particular controller when more than one controller are attached to USB for example Overvoltage This number sets the voltage level at which the controller must turn off its power stage and signal an Overvoltag
83. PC Status Bar Content The status bar is located at the bottom of the window and is split in 4 areas From left to right List of COM ports found on the PC e COM port used for communication with the controller Port Open indicates that communication with the controller is established Advanced Digital Motor Controllers User Manual 179 Using the Roborun Configuration Utility Robote Firmware ID string as reported by the controller Contains revision number and date e 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 The automatic scanning is particularly useful for controllers connected via USB since it is not usually possible to know ahead of time which communication port the PC will assign to the controller If a controller is found on any of those ports Roborun will Display the controller model in the window header Display the Connection COM port number report the Firmware revision and turn on the Connect LED in the Status bar e Pop up a message box asking you if you wish to read the configuration Roborun Plus Ex Controller found Do you wish to load configuration oye J No FIGURE 55 Pop up m
84. PC utility The utility can be used for setting changing configurations operate monitor the motors and I O edit sim ulate and run Microbasic scripts and perform various maintenance functions such as firm ware updates Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ 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 Any problem due to wiring errors may have very serious consequences and will not be covered by the product s warranty Power Connections Power connections are described in the controller model s datasheet Depending on the model type power connection is done via wires fast on tabs screw terminals or copper bars coming out of the controller Controllers with wires as power connections have Ground black VMot red power cables and a Power Control wire yellow The power cables are located at the back end of the controller The various power cables are identified by their position wire thickness and color red is p
85. Robote Editing Building Simulating and Executing Scripts Editing Scripts An editor is available for scripting in the RoborunPlus PC utility See Scripting Tab on page 195 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 This capability makes code easier to read and provides a first level of error checking Code is entered as free form text with no restriction in term of length indents use or other Building Scripts Building is the process of converting the Basic source code in the intermediate Bytecode anguage that is understood by the controller This step is nearly instantaneous and nor mally transparent to the user unless errors are detected in the program Build is called automatically when clicking on the Download to Device or Simulate but tons Building can be called independently by clicking on the Build button This step is nor mally not necessary but it can be useful in order to compare the memory usage efficiency of one script compared to another Simulating Scripts Scripts can be ran directly on the PC in simulation mode Clicking on the Simulate button will cause the script to be built and launch a simulator in which the code is executed This feature is useful for writing testing and de
86. Save Parameters to EEPROM LK Key Lock Configuration read RESET Channel Key Reset Controller STIME Hours Mins Secs Set Time UK Key Unlock Configuration read DFU Update Firmware via USB 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 pre vent 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 When this mode is entered you must launch the separate upgrade utility to start the firmware upgrade process Syntax DFU safetykey Where safetykey 321654987 Example DFU 321654987 EELD Load Parameters from EEPROM This command reloads the configuration that are saved in EEPROM back into RAM and activates these settings Syntax EELD EERST Reset Factory Defaults The EERST command will reload the controller s RAM and EEPROM with the factory default configuration Beware that this command may cause the controller to no longer work in your application since all your configurations will be erased back to factory defaults This command must be used with care and must be followed by a 9 digit safety key to pre vent accidental use Syntax EERST safetykey Where safetykey 321654987 112 Advanced Digital Motor Co
87. The Console tab also contains the buttons for per forming field updates of the controller Text Mode Commands Communication The console mode allows you to send low level commands and view the raw controller responses Ten text fields are provided in which you can type commands and send them in any sequence by clicking on the respective Send button All the traffic that is exchanged by the controller and the PC is logged in the console box on the right It is then possible to copy that information and paste it into a word processor or an Excel spreadsheet for further analysis The Stop button sends the command to the controller and will stop the automatic query updating if it is currently active IR Roborun seo CH Work Motor Control Utility ic One Rev 1 1 5 22 10 View Pinout Control Unit H Type Controller Model DC 245 Configuration Run Console Out data In data Send Send Send Send Send Send Send Send j Send Send Stop Update Controller Firmware Update Controller Logic Update Power Board Logic Gear tog Hd Copy Log FID Roboteq v0 9 RCB500 10 01 2009 Found COMI COM2 COM2 is Open Firmware ID Roboteq v1 1 RCB500 05 24 2010 FIGURE 76 Console tab 192 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Console Tab Updating the Controller s Firmware The controller s
88. When floating or pulled to above 1V the DC DC converter is active and supplies the controller s microcomputer and drivers thus turning it On When the Power Control input is pulled to Ground the DC DC converter is stopped and the controller is turned Off The Power Control input MUST be connected to Ground to turn the Controller Off For turn ing the controller On even though the Power Control may be left floating whenever possi ble pull it to a 12V or higher voltage to keep the controller logic solidly On You may use a separate battery to keep the controller alive as the main Motor battery discharges The diode circuit is not included in the SDCxxxx low power controllers In these models the Power Control input is only used to turn on off the controller The diode circuit is also excluded in high voltage controller models above 75V For these controllers a separate voltage source must be provided externally to the Power Control input Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Controller Power The table below shows the state of the controller depending on the voltage applied to Power Control and VMot TABLE 1 Controller Status depending on Power Control and VMot Power Control input is And Main Battery connected to Voltage is Action Ground Any Voltage Controller is Off Required Off Configuration Floating OV Controller is Off Not Recom mende
89. a 10 Do Print a a n cc Loop Until a 0 Print Loop ended with a a n Terminate Statement The Terminate statement ends the execution of the program Terminate Exit Statement The following is the syntax of Exit statement Exit For While Do An Exit statement transfers execution to the next statement to immediately containing block statement of the specified kind If the Exit statement is not contained within the kind of block specified in the statement a compile time error occurs The following is an example of how to use Exit statement in While loop While a gt 0 If b 0 Then Exit While End While Continue Statement The following is the syntax of Continue statement Continue For While Do A Continue statement transfers execution to the beginning of immediately containing block statement of the specified kind If the Continue statement is not contained within the kind of block specified in the statement a compile time error occurs Advanced Digital Motor Controllers User Manual 163 MicroBasic Scripting Robote The following is an example of how to use Continue statement in While loop While a gt 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 lt label gt The following example illustrates how to use GoT
90. alog or RC Pulse See Command Priorities on page 90 Syntax Where Default Value Examples CPRI pp nn CPRI pp pp priority rank 0 1 or 2 nn 0 disabled 1 Serial 2 RC 3 Analog priority 1 2 RC priority 2 2 RS232 USB priority 3 2 Disabled CPRI 1 2 Set Serial as first priority CPRI 2 Read what mode is second priority DFC Default Command value The default command values are the command applied to the motor when no valid com mand is fed to the controller It is the last priority item in the Command Priority mecha nism See Command Priorities on page 90 Syntax Where Allowed Range DFC cc nn DFC cc Channel number nn command value 1000 to 1000 118 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Command Inputs Configuration and Safety Default Value 0 Example ADFC 1 500 Sets motor command to 500 when no command source are detected ECHOF Enable Disable Serial Echo This command is used to disable enable the echo on the serial port By default the control ler 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 Syntax AECHOF nn ECHOF Where nn 0 echo is enabled 1 echo is disabled Default Value 0 enabled Examples ECHOF 1 Disa
91. and are powered in sequence in order to create a rotating field that drives the permanent magnets The elec tromagnets are located on the non rotating part of the motor which is normally in the motor casing for traditional motors in which case the permanent magnets are on the rotor that is around the motor shaft On hub motors such as those found on electric bikes scooters and some other electric vehicles the electromagnets are on the center part of the motor and the permanent magnets on outer part 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 con troller to apply in sequence current to each of the 3 motor windings in order to cause the rotor to spin To do this the controller must know where the rotor is in relation to the elec tromagnets so that current can be applied to the correct winding at any given point in time The simplest and most reliable method is to use three Hall sensors inside the motor The diagram below shows the direction of the current in each of the motor s windings depend ing on the state of the 3 hall sensors Aavanced Digital Motor Controllers User Manual 67 Brushless Motor Connections and Operation Robote W 1 23 45 6 1 2 3 4 5 6 U NG WO a 0V 5 oe d d FIGURE 39 Hall sensors sequ
92. arameter Syntax AEPPR cc nn EPPR Where cc Channel number nn PPR value Allowed Range 1 to 5000 Default Value 100 Example EPPR 2 200 Sets PPR for encoder 2 to 200 Advanced Digital Motor Controllers User Manual 131 Serial RS232 USB Operation IRo boteQ KDC1 Differential Gains Table for Motor 1 This is the same as KPC1 but applies to the Differential Gain for motor 1 Syntax AKDC1 pp nn KDC1 pp Where pp point 1 to 5 in range table nn Differential Gain 10 Default Value 2 0 2 0 2 0 2 0 2 0 KDC2 Differential Gains Table for Motor 2 This is the same as KDC1 but applies to the Differential Gain for motor 2 Syntax AKDC2 pp nn KDC2 pp Where pp point 1 to 5 in range table nn Differential Gain 10 Default Value 2 0 2 0 2 0 2 0 2 0 KIC1 Integral Gains Table for Motor 1 This is the same as KPC1 but applies to the Integral Gain parameter for motor 1 Syntax AKIC1 pp nn KIC1 pp Where pp point 1 to 5 in range table nn Integral Gain 10 Default Value 2 0 2 0 2 0 2 0 2 0 KIC2 Integral Gains Table for Motor 2 This is the same as KIC1 but applies to the Integral Gain parameter for motor 2 Syntax AKIC2 pp nn KIC2 pp Where pp point 1 to 5 in range table nn Integral Gain 10 Default Value 2 0 2 0 2 0 2 0 2 0 KPC1 Proportional Gains Table for Motor 1 This parameter lets you load the 5 points of the proportional gain c
93. are enabled or disabled in the controller configura tion For example more time is available for scripting if the controller is handling a single motor in open loop than if two motors are operated in closed loop with encoders At the end of the allocated time the script execution is suspended motor control functions are performed and scripts resumed An execution speed averaging 50 000 lines of MicroBasic code or higher per second can be expected in most cases No protection against user error is performed at execution time For example writing or reading in an array variable with an index value that is beyond the 1024 variables available in the controller may cause malfunction or system crash Nesting more than 64 levels of sub routines i e subroutines called from subroutines will also cause potential problems It is up to the programmer to carefully check the script s behavior in all conditions Print Command Restrictions A print function is available in the language for outputting script results onto the serial or USB port Since script execution is very fast it is easy to send more date to the serial or USB port than can actually be output physically by these ports The print command is therefore limited to 32 characters per 1ms time slot Printing longer strings will force a 1ms pause to be inserted in the program execution every 32 characters Advanced Digital Motor Controllers User Manual 149 MicroBasic Scripting
94. as Speed Sensors leeren 74 Speed Sensor and Motor Polarity llle 75 Controlling Speed in Closed LOOP kk eee eee eee eens 76 Control Loop Description erii ek mr Rr m Re 76 PID tuning in Speed Mode sse ese RR eR RR Rr n Pha aces RA 77 Error Detection and Protection s ses weet ee bee anrea RR Ran 78 Closed Loop Position Mode lees hh nnn 79 Mode Descriptor xs uuum hem hoe kk Re RE RR REOR EE RC ERR 79 Selecting the Position Mode leeeeeee nnn nnn 79 Position Feedback Sensor Selection 2 0 cece eee 79 Sensor MOUNTING s idee Fite eee eee ede REOR Ee dea ee oe eee 80 Error Detection and Protection lere rrr ee ee ee eee 82 Adding Safety Limit Switches 0 0 cece eee eee 82 Using Current Trigger as Protection llle 83 Operating in Closed Loop Position Mode leeren 83 Control Loop Description 2na a RR R3 E Em ninh 85 PID tuning in Position Mode 2 cece eee 86 Serial RS232 USB Operation maana na xs rb mpi Rex eR RE Ronde ed 87 Use and benefits of Serial Communication 0 000 eee 87 Serial Port Configurations x ker ERR RR RR RO AE RE REOR 88 Connector RS232 Pin Assignment llle 88 Cable config ratlori ves y xm e RR Rr RR RERO EUR E ba ra 88 Extending the RS232 Cables paaa GRABA AN GR REGE 89 USB ConfiQUratlOn s sss x tm oce k mE E REGE Ee RUNE meis 90 Command Priorities ux ee E BNG i eta ERR Bead eee NG 90 USB vs Serial Communicat
95. ation based on the measured heatsink temperature Create new functions Scripting can be used for adding functions or operating modes that may be needed for a given application For example a script can compute the motor power by mul tiplying the measured Amps by the measured battery Voltage and regularly send the result via the serial port for Telemetry purposes Autonomous operation MicroBasic Scripts can be written to perform fully autonomous operations For example the complete functionality of a line following robot can easily be written and fitted into the controller Script Structure and Possibilities Scripts are written in a Basic Like computer language Because of its literal syntax that is very close to the every day written English this language is very easy to learn and simple scripts can be written in minutes The MicroBasic scripting language also includes support for structured programming allowing fairly sophisticated programs to be written Several shortcuts borrowed from the C language are also included in the scripting lan guage and may be optionally used to write shorter programs Advanced Digital Motor Controllers User Manual 147 MicroBasic Scripting Robote The complete details on the language can be found in the MicroBasic Language Reference on page 155 Source Program and Bytecodes Programs written in this Basic like language are interpreted into an intermediate string of Byt
96. be handled with care When setting a configuration parameter the new value of the parameter must be given in addition to the Configuration Item and Index GetConfig ConfigurationItem Index value SetConfig ConfigurationItem Index Accel2 GetConfig _MAC 2 Read Acceleration parameter for Motor 2 PWMFreq GetConfig PWMF Read Controller s PWM frequency SetConfig _MAC 2 Accel2 2 Make Motor2 acceleration twice as slow TABLE 26 Command Set Arguments Get Argument Description General _CAD Address none Controller Address _MXMD MixedMode none Mixed Mode OVL Over Voltage none Overvoltage Limit PWMF PWMFrequency none PWM Frequency _THLD Threshold none Short Circuit detection threshold _UVL Under Voltage none Undervoltage Limit Command _ACS Enable none Enable Ana Center Safety _AMS Enable none Enable Ana Min Max Safety _CLIN ChNbr Linearity Channel Command Linearity _CPRI PriorityNbr PriorityLevel PriorityLevel Command Priority _DFC ChNbr DefaultCommand Channel Default Command value _ECHOF EchoOff none Disable Enable RS232 amp USB Echo _PMS Enable none Enable Pulse Min Max safety _RWD RS232 WdogTimeout none RS232 Watchdog 0 to disable Digital Inputs _DINA InputNbr Action InputNbr Digital Input Action _DINL InputNbr Action InputNbr Digital Input Active Level _DOA OutputNbr Action InputNbr Digital Output Action _DOL OutputNbr Acti
97. ble echo RWD Serial Data Watchdog This is the RS232 USB watchdog timeout parameter It is used to detect when the control ler is no longer receiving commands and switch to the next priority level The watchdog value is a number in ms 1000 1s The watchdog function can be disabled by setting this value to 0 The watchdog will only detect the loss of real time commands that start with Y All other traffic on the serial port will not refresh the watchdog timer As soon as a valid command is received motor operation will resume at whichever speed motors were run ning prior to the watchdog timeout Syntax RWD nn RWD Where nn Timeout value in ms Allowed Range 0 to 65000 Default Value 1000 Examples ARWD 1000 Set watchdog to 1s ARWD 0 Disable watchdog TELS Telemetry String 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 Upon the power up the controller will load the query history buffer and it will automatically start sending operating parameters based on the information in this string Strings up to 48 char acters long can be stored in this parameter Syntax TELS string TELS Advanced Digital Motor Controllers User Manual 119 Serial RS232 USB Operation IRo boteQ Where string string of AS
98. bugging scripts The simulator works exactly the same way as the controller with the following exceptions e Execution speed is different Controller configurations and operating parameters are not accessible from the sim ulator Controller commands cannot be sent from the simulator The four Timers operate differently in the simulator In the simulator any attempt to read a Controller configuration example Amps limit or a Controller Runtime parameter e g Volts Temperature will cause a prompt to be displayed for the user to enter a value Entering no value and hitting Enter will cause the same value that was entered last for the same parameter to be used If this is the first time the user is prompted for a given parameter O will be entered if hitting Enter with no data When a function in the simulator attempts to write a configuration or a command then the console displays the parameter name and parameter value in the console Script execution in the simulator starts immediately after clicking on the Simulate button and the console window opens Simulated scripts are stopped when closing the simulator console 150 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ 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 trans ferred into the control
99. ced Digital Motor Controllers User Manual VO Configuration and Operation Robote 58 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Power Output Circuit Operation SECTION 5 Motor Operating Features and Options 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 rap idly pulsed on and off using Pulse Width Modulation PWM technique in order to deliver more or less power to the motors The PWM ratio that is applied is the result of computa tion that combines the user command and safety related corrections In closed loop opera tion the command and feedback are processed together to produced a the adjusted motor command The diagram below gives a simplified representation of the controller s opera tion Configuration Configuration Configuration Configuration Y Y Y Y Lommands Acceleraton Channel Motor Safety Power Configuration Decceleration Mixing Command Checks Output Y gt Y Pa RWM Short Motor Detect Outs Feedback Channel g Mixing 5 ara Configuration Estop Amps Limit Switches Temperature a Voltages FIGURE 35 Simplified diagram of Power Stage operation Advanced Digital Motor Controllers User Manual 59 Motor Operating Features and Option
100. ck Aln ane ane Selectable Action ases ases Min Selectable Action FIGURE 27 Analog Input processing chain Advanced Digital Motor Controllers User Manual 51 VO Configuration and Operation Robote 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 5 Digital Input Action List on page 50 Min Max and Center adjustment The raw analog capture is then scaled into a number ranging from 1000 to 1000 based on user defined Minimum Maximum and Center values for the input For example setting the minimum to 500mv the center to 2000mV and the maximum to 4500mV will produce the output to change in relation to the input as shown in the graph below Output 1000 4 min Analog Capture ctr max Voltage 11 1000 FIGURE 28 Analog Input processing chain This feature allows to capture command or feedback values that match the available range of the input sensor typically a potentiometer For example this capability is useful for modifying the active joystick travel area The figure below shows a transmitter whose joystick s center position has been moved back so that the operator has a finer control of the sp
101. controller is powered from a power supply instead of batteries Undervoltage Protection In order to ensure that the power MOSFET transistors are switched properly the controller monitors the internal preset power supply that is used by the MOSFET drivers If the inter nal voltage drops below a safety level the controller s output stage is turned Off The rest of the controller s electronics including the microcomputer will remain operational as long as the power supply on VMot or Power Control is above 7V Additionally the output stage will be turned off when the main battery voltage on VMot drops below a user configurable level that is factory preset at 5V Temperature Based Protection The controller features active protection which automatically reduces power based on measured operating temperature This capability ensures that the controller will be able to work safely with practically all motor types and will adjust itself automatically for the vari ous load conditions When the measured temperature reaches 700C the controller s maximum power output begins to drop to reach 800C Above 800C the controller s power stage turns itself off completely Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Global Power Configuration Parameters Note that the measured temperature is measured on the heat sink near the Power Transis tors and will rise and fall faster than the outside surface
102. d Commands lees 159 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Timers COMMANAS sirs xim ecu ERE RU EUR NG NG Meow de 159 Option Compilation Options eee 159 Dim Variable Declaration eee 159 If Then Statement ck satin TRY tae eave eee ei eda aas 160 For aNextstatementz io accede oan ee Ger VEM RD PAR Bahan 161 While Do Statements a eee 162 Terminate Statement suis idus eee PETER ceeds Pinang 163 Exit Statement x2 ike eR exa ehm RE RR ERR RE Rc RE RR RR Ec 163 Continue Statement zx nis erbe Rer e RR eR GR ER REESE 163 GOTO Staterert Asmaan Kwak TRA thaws ec Vise t eco o RR e Be 164 GoSub Return Statements cee ee eee ees 164 TOBOO State MOA te iue tae ee dees eec Receta gr AA 165 Print Statement exp pna akan valid a ea eae ik GG eva veda eee 165 ADS EUFICHOF mu iei mac mue IYAN p RE RR e cies 165 OPS inssiiscfkwewe kon e Y RREGUREYGRG eave twee ESS 165 oru dee E Pcr 165 Operatori per uam eR RR CR Rc ela abe RE ec e dc 166 POPSRATON E P 166 Mod Operator iure um MERE RR ERROR E RR mee 166 And Operator iuter pu ure eee RATE A KORR RR MAE Aare DOR IC E PAR 166 Or Operator thse ees eee RR RR ARCU CR OR Rc RR RR OBS 166 XOr Operator mido ka EE iad sei edad idee ieee YU ee ees 166 Not Operator ss stieadntaeGiedan IEEE IDK AN saws EEGD ERES ens 166 True Lit ral 42m kommen RE ee RE ea Re 167 False Literall3
103. d Off Configuration Floating 1 Between 7 and VMotMax Controller is On See VMotMax value in Power Stage is Active datasheet 7V to 75V 2 Below undervoltage threshold Controller is On Power Stage is Off 7V to 75V 2 Between undervoltage and Controller is On overvoltage limits Power Stage is Active Note All 3 ground are connected to each other inside the controller The two VMot main battery wires are also connected to each other internally However you must never assume that connecting one wire of a given battery potential will eliminate the need to connect the other Note1 High voltage controllers above 75V are off if Power Control is not connected to a power source Note2 Valid for all controller models except SDCxxxx Never connect to a voltage source on SDCxxxx models Aavanced Digital Motor Controllers User Manual 17 Connecting Power and Motors to the Controller Robote Controller Powering Schemes Roboteq controllers operate in an environment where high currents may circulate in unex pected manners under certain condition Please follow these instructions Roboteq reserves the right to void product warranty if analysis determines that damage is due to improper controller power connection The example diagram on Figure 2 shows how to wire the controller and how to turn power On and Off All Roboteq models use a similar power circuit See the controller datasheet for the exact wiring diagram for yo
104. d by 200 RPM every second if speed is measured by encoder IDC 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 The D command accepts signal number that will turn ON or OFF all of the digital outputs at the same time The number can be a value from O to 255 and binary representation of that number has 1bit affected to its respective output pin Syntax IDS nn Where nn bit pattern to be applied to all output lines at once Examples IDS 03 will turn ON outputs 1 and 2 All others are off DO Reset Individual Digital Out bits The DO command will turn off the single output line selected by the number that follows Syntax IDO nn Where nn output number Examples IDO 2 will turn output 2 to O D1 Set Individual Digital Out bits The D1 command will activate the single output line that is selected by the parameter that follows Syntax ID1 nn Where nn output number Examples ID1 1 will turn ON output 1 EX Emergency Stop 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 Syntax IEX Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Runtime Commands G Individual Motor Command
105. d of scripts can be summarized in the flow chart below The amount of process ing can be simple or very complex but the script has a clear begin and end Processing FIGURE 51 Single execution scripts Continuous Scripts More often scripts will be active permanently reacting differently based on the status of analog digital inputs or operating parameters Amps Volts Temperature Speed Count and continuously updating the motor power and or digital outputs These scripts have 152 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ MicroBasic Scripting Techniques a beginning but no end as they continuously loop back to the top A typical loop construc tion is shown in the flow chart below Initialization Steps Time Input or Controller events Wait FIGURE 52 Continuous execution scripts Often some actions must be done only once when script starts running This could be set ting 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 con troller operating parameters If specific events are detected then the script jumps to steps related to these events Otherwise no action is taken Prior to looping back to the top of the loop it is highly recommended to insert a wait time The wait
106. d to generate an analog voltage ranging from OV to 5V depending on their position They will report an absolute position information at all times Modern position Hall sensors output a digital pulse of variable duty cycle These sensors provide an absolute position value with a high precision up to 12 bit and excellent noise immunity PWM output sensors are directly readable by the controller and therefore are a recommended choice Optical encoders report incremental changes from a reference which is their initial position when the controller is powered up or reset Before they can be used for reporting position the motors must be moved in open loop mode until a home switch is detected and resets the counter Encoders offer the greatest positional accuracy possible Sensor Mounting Proper mounting of the sensor is critical for an effective and accurate position mode opera tion Figure 44 shows a typical motor gear box and sensor assembly Position Feedback Position Sensor Gear box FIGURE 44 Typical motor potentiometer assembly in Position Mode The sensor is composed of two parts a body which must be physically attached to a non moving part of the motor assem bly 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 t
107. d until the error has disappeared the motor channel is reset to open loop mode Adding Safety Limit Switches The Position mode depends on the position sensor providing accurate position information If the sensor is damaged or one of its wires is cut the motor may spin continuously in an attempt to reach a fictitious position In many applications this may lead to serious mechanical damage To limit the risk of such breakage it is recommended to add limit switches that will cause the motor to stop if unsafe positions have been reached independent of the sensor read ing Any of the controller s digital inputs can be used as a limit switch for any motor chan nel An alternate method is shown in Figure 45 This circuit uses Normally Closed limit switches in series on each of the motor terminals As the motor reaches one of the switches the lever is pressed cutting the power to the motor The diode in parallel with the switch allows the current to flow in the reverse position so that the motor may be restarted and moved away from that limit The diode polarity depends on the particular wiring and motor orientation used in the appli cation 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
108. e channel to be enabled This is a safety feature to make sure that there is no cur rent flowing into the armature unless an excitation current is being detected Outputting current into the armature without excitation will cause serious damage without this protec tion Syntax SXM nn SXM Where nn current in Amps 10 Allowed Range 10 1 0A to 250 25 0A 146 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Script Structure and Possibilities SECTION 10 MicroBasic Scripting One of the controller s most powerful and innovative features is the ability for the user to write programs that are permanently saved into and run from the controller s Flash Mem ory This capability is the equivalent of combining the motor controller functionality and this of a PLC or Single Board Computer directly into the controller Script can be simple or elab orate and can be used for various purposes Complex sequences MicroBasic Scripts can be written to chain motion sequences based on the status of analog digital inputs motor position or other measured parameters For exam ple motors can be made to move to different count values based on the status of pushbuttons and the reaching of switches on the path Adapt parameters at runtime MicroBasic Scripts can read and write most of the controller s configuration settings at runtime For example the Amps limit can be made to change during oper
109. e condition The number that can be entered is the value in volts multiplied by 10 e g 450 45 0V Syntax Where Allowed Range Default Value Example OVL nn OVL nn Volt 10 10 0V to Max Voltage rated in controller Data Sheet Maximum voltage rated in controller Data Sheet OVL 400 Set Overvoltage limit to 40 0V Advanced Digital Motor Controllers User Manual 137 Serial RS232 USB Operation IRo boteQ UVL Undervoltage Limit This parameter 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 Syntax AUVL nn UVL Where nn Volt 10 Allowed Range 5 0V to Max Voltage rated in controller Data Sheet Default Value 50 5 0V Example AUVL 100 Set undervoltage limit to 10 0 V THLD Short Circuit Detection Threshold This configuration parameter sets the threshold level for the short circuit detection There are 4 sensitivity levels from 0 to 3 Syntax ATHLD nn THLD Where nn 0 Very high sensitivity 0 1 Medium sensitivity 2 Low sensitivity 3 Short circuit protection disabled Default Value 1 Medium sensitivity Example THLD 1 Set short circuit detection sensitivity to medium Notes You should never disable the short circuit protection MXMD Separate or Mixed Mode Select This configuration parameter selects the mixed mode operation It is applicable to dual channel controll
110. e considered as the center or the O value The min max and center are useful to set the range of a joystick or of a feed back sensor Internally to the controller commands and feedback values are converted to 1000 0 1000 Syntax AACTR cc nn ACTR cc Where nn 0 to 5000mV Default Value 2500mV Example ACTR 3 2000 Set Analog Input 3 Center to 2000mV ADB Analog Deadband This parameter selects the range of movement change near the center that should be con sidered as a O command This value is a percentage from O to 50 and is useful to allow some movement of a joystick around its center position before any power is applied to a motor Syntax ADB cc nn ADB cc 122 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Analog Input Configurations Where ce Analog channel number nn Deadband in Allowed Range 0 to 50 Default Value 5 on all inputs Example ADB 6 10 Sets Deadband for channel 6 at 1096 AINA Analog Input Usage This parameter selects whether an input should be used as a command feedback or left unused When selecting command or feedback it is also possible to select which channel this command or feedback should act on Feedback can be position feedback if potentiom eter is used or speed feedback if tachometer is used Embedded in the parameter is the motor channel to which the command or feedback should apply Syntax AINA cc nn mm
111. e construct All keywords are reserved by the language and may not be used as variables or label names Below is a list of all Micro Basic keywords And AndWhile As Boolean Continue Dim Do Else Elself End Evaluate Exit Explicit False For GoSub GoTo If Integer Loop Mod Next Not Option Or Print Return Step Terminate Then To ToBool True Until While XOr Operators Micro Basic provides a large set of operators which are symbols or keywords that specify which operations to perform in an expression Micro Basic predefines the usual arithmetic and logical operators as well as a variety of others as shown in the following table Category Operators Arithmetic Mod Logical boolean and bitwise And Or XOr Not True False Increment decrement Shift lt lt gt gt Relational lt gt lt gt lt gt 158 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction Category Operators Assignment lt lt gt gt Indexing Micro Basic Functions Micro Basic currently support only one function called Abs see Abs Function on page 165 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 Timers Commands The following is a set of functions f
112. e controller only with a rechargeable battery as supply to the Motor Power wires thick black and red wires If a transformer or power supply is used damage to the controller and or power supply may occur during regeneration See Using the Controller with a Power Supply on page 25 for details Important Warning Avoid switching Off or cutting open the main power cables while the motors are spinning Damage to the controller may occur Always ground the Power Control wire to turn the controller Off 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 regenera tion As discussed in Power Regeneration Considerations on page 24 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 While this process should not be harmful to the controller it may be to the power supply unless one or more of the protective steps below is taken Use a power supply that will not suffer damage in case a voltage is applied at its output that is higher than its own output voltage This information is seldom pub lished in commercial power supplies so it is not always possible to obtain positive reassurance that the supply will survive such a condition e Avoid deceleration that is quic
113. e default configura tion and then reload your custom configuration The EEPROM error signals a hardware fault with the controller s configuration storage device If the problem persists please contact Roboteq for repair Advanced Digital Motor Controllers User Manual 189 Using the Roborun Configuration Utility Robote Applying Motor Commands The command sliders will cause the command value to be applied to the controller Click ing on the 7 7 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 The Mute checkbox can be selected to stop all commands from being sent to the con troller When this is done only parameter reads are performed When commands are muted and if the watchdog timer is enabled the controller will detect a loss of commands arriving from the serial port and depending on the priorities it will switch back to the RC or Analog mode If a USB Joystick is connected to the PC and the Enable box is checked the slider will update in real time with the captured joystick position value This makes it possible to oper ate the motor with the joystick The Configure Joystick button lets you perform addi tional adjustments such as inverting and swapping joystick input Command Je Mute Q k Joystick 128 Stop Enable 194 a E Config ene EJE FIGURE 74
114. e eee 38 Connecting the Encoder iie ur Rr Rr HERR Eder 39 Cable Length and Noise Considerations saaaa a 39 Motor Encoder Polarity Matching aan 40 Command MOSS eas edu RR deu xh Rare ERG EO ER RR ade Anes 41 Input Command Modes and Priorities celles 41 USB vs Serial Communication Arbitration llle 43 Commands issued from MicroBasic scripts aaa 43 Operating the Controller in RC mode leeeeeee nn 44 Input RC Channel Selection esee nne 45 Input RC Channel Configuration llle 45 Automatic Joystick Range Calibration llle 45 Deadband InserBlori sss ssa rimi stew eb eee exe ewes 45 Command Exponentiation 2 ee eee eee 45 Reception Watchdog ees ce te ie cect en eae ele We aca EA RR alec 45 Using Sensors with PWM Outputs for Commands llle eee 46 Operating the Controller In Analog Mode 1 cece eee eee ee eee 46 Input Analog Channel Selection 0 0c ce eee 46 Input Analog Channel Configuration eee eee 47 Analog Range Calibration puma paa ra eek am dee eee a 47 Using Digital Input for Inverting direction eee ees 47 Safe Start in Analog Mode cece eee teens 47 Protecting against Loss of Command Device 47 Safety Switclies sasanka Ee Red Re ARAR Beek ee 47 Monitoring and Telemetry in RC or Analog Modes esses 48 Using the Controller in Serial USB
115. e is necessary This procedure is described in Closed Loop Speed Mode on page 73 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 If this protection is disabled there will be no way of stopping it other than pressing the emergency stop button or disconnecting the power Connecting External Thermistor to Analog Inputs Using external thermistors the controller can be made to supervise the motor s tempera ture and cut the power output in case of overheating Connecting thermistors is done according to the diagram shown in Figure 15 Use a 10kOhm Negative Coefficient Thermis tor NTC with the temperature resistance characteristics shown in the table below Rec ommended part is Vishay NTCLE100E3103JBO0 Digikey item BC2301 ND TABLE 3 Recommended NTC characteristics Temp oC 25 0 25 50 75 100 Resistance kOhm 129 32 5 10 00 3 60 1 48 0 67 5V Internal Resistors and Converter 33kOhm 10kOhm NTC Thermistor 20kOhm 10kOhm Ground FIGURE 15 NTC Thermistor wiring diagram Thermistors are non linear devices Using the circuit described on Figure 15 the c
116. e multiple value with typically one value applying to a different chan nel 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 0A AMIN 4 2000 Sets low range of analog input 4 to 2000 Important Notice Saving configuration into EEPROM can take up to 20ms per parameter The control ler will suspend the loop processing during this time potentially affecting the con troller operation Avoid saving configuration to EEPROM during motor operation Reading Configurations oon Configuration parameters are read by issuing the character followed by the command name and with an optional channel number parameter If no parameter is sent the control ler will give the value of all channels If a channel number is sent the controller will give the value of the selected channel The reply to parameter read command is the command name followed by followed by the parameter value When the reply contains multiple values then the different values are Advanced Digital Motor Controllers User Manual 115 Serial RS232 USB Operation IRo boteQ n n separated by The list below describes every configuration command of the controller For example ALIM Read Amps limit for all channels Reply ALIM 750 650 ALIM 2 Read Amps limit for channel 2 Reply ALIM 650 Important Warning Configuration commands can
117. ecode instructions that are then downloaded and executed in the controller This two step structure ensures that only useful information is stored in the controller and results in significantly higher performance execution over systems that interpret Basic code directly This structure is for the most part entirely invisible to the programmer as the source editing is the only thing that is visible on the PC and the translation and done in the background just prior to downloading to the controller The controller can store 8192 Bytecodes This translates to approximately 1500 lines of MicroBasic source Variables Types and Storage Scripts can store signed 32 bit integer variables and Boolean variable Integer variables can handle values up to 2 147483 647 Boolean variables only contain a True or False state The language also supports single dimensional arrays of integers and Boolean variables In total up to 1024 Integer variables and up to 1024 Boolean variables can be stored in the controller An array of n variables will take the storage space of n variables The language only works with Integer or Boolean values It is not possible to store or manipulate decimal values This constraint results in more efficient memory usage and faster script execution This constraint is usually not a limitation as it is generally sufficient to work with smaller units e g millivolts instead of Volts or milliamps instead of Amps to achieve the same
118. ed Integral or Gain Optical Encoder Differential Gain FIGURE 43 PID algorithm used in Speed mode PID tuning in 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 The ultimate goal in a well tuned PID is a motor that reaches the desired speed quickly without overshoot or oscillation Because many mechanical parameters such as motor power gear ratio load and inertia are difficult to model tuning the PID is essentially a manual process that takes experimenta tion The Roborun PC utility makes this experimentation easy by providing one screen for chang ing the Proportional Integral and Differential gains and another screen for running and monitoring the motor First run the motor with the preset values Then experiment with different values until a satisfactory behavior is found In Speed Mode the Integral component of the PID is the most important and must be set first The Proportional and Differential components will help improve the response time and loop stability In the case where the load moved by the motor is not fixed tune the PID with the mini mum 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 pos sible loads is large it may not be possible to find satisfactory tun
119. eed in the forward direction than in the reverse position New Desired Center Position Min Forward Min Reverse Max Max Reverse Forward FIGURE 29 Calibration example where more travel is dedicated to forward motion 52 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Analog Inputs Configurations and Use The Min Max and Center values are defined individually for each input They can be easily entered manually using the Roborun PC Utility The Utility also features an Auto calibration function for automatically capturing these values See Automatic Analog and Pulse input Calibration on page 182 Deadband Selection The adjusted analog value is then adjusted with the addition of a deadband This parameter selects the range of movement change near the center that should be considered as a 0 command This value is a percentage from O to 50 and is useful for example to allow some movement of a joystick around its center position before any power is applied to a motor The graph below shows output vs input changes with a deadband of approximately 4096 Output 1000 1000 Input 41000 P 1000 FIGURE 30 Effect of deadband on the output Note that the deadband only affects the start position at which the joystick begins to take effect The motor will still reach 10096 when the joystick is at its full position An illustration of
120. eet tad BINA eee decr er ae e e n ace 167 4 Op6atOl saba GM kka BUKANA da bee eed EGG Na oda ee E 167 OPEratO isses oa ee mina E tows cowie ee bg Ri E 167 lt lt Operator i ete eR RE A Ec RR IR RR A 168 SR OPEO i aA EERE ew ket aid ares a lace ERE iR an LAG 168 lt gt Operator epi rece a re Race ACE ee ARES RE ec eR dec 168 LS Tos o PEPPER 168 S OperdtOrzz sss heic a bees ee x REN X XE EE RE Ya Rede 168 lt Operator ssscseeacmk en kr er RASPARE RA SERPEN ARAS 168 zh M CETT 169 gt Operator aa aakala ex rr REESE EA E EE EG 169 OPEO tm ntcedan twee Rein Coane Dimer ed tha ANDRADA 169 SONG sso ne gna X EUER REOR PEREDE Cee eRR OR NESS ES 169 YESODOELAtOL wand claws aad Un Deen Peed Aio Rae or rt at 169 Operator oer p GRE ERE we eee VR RUE aede 170 ed N0 0 C METH 170 gt gt Operator xa aa chee ida eee ieee PADA eas 170 LOPETA AA 170 Getalle 4 0 BEBANG ec eed ee ee E he eet 170 SO ICOM MMA tasega ea a E e raea aa aac daa E der derer oe 172 SetGontig GetConflga s xs spr e reip Ix a ac bene eax 172 SetTimerCount GetTimerCount llle ens 176 SetTimerState GetTimerState 6 ee eee 176 Aavanced Digital Motor Controllers User Manual Robote SECTION 11 Using the Roborun Configuration Utility aan 177 SystemihRequiremierits Xx nka eee ee HARAP AG E REG NANANA GA 177 Downloading and Installing the Utility ccce 177 The Robor n Interface elec IRR RR eee 178 Header Content x
121. ence Roboteq s brushless DC motor controllers only work with motors equipped with Hall sen sors While sensorless techniques exist these can only accurately detect the rotor position once the motor is spinning and therefore are not usable in any system requiring precise control at slow speed Number of Poles One of the key characteristics of a brushless motor is the number of poles of permanent magnets it contains A full 3 phase cycling of motor s electromagnets will cause the rotor to move to the next permanent magnet pole Thus increasing the number of poles will cause the motor to rotate more slowly for a given rate of change on the winding s phases A higher or lower number of poles makes no difference to the controller since its function is always to create a rotating field based on the Hall sensor position However the number of poles information can be used to determine the number of turns a motor has done It can also be used to measure the motor speed The Roboteq controllers can measure both The number of poles on a particular motor is usually found in the motor s specification sheet The number of poles can also be measured by applying a low DC current around 1A between any two wires of the 3 that go to the motor and then counting the number of cogs you feel when rotating the motor by hand for a full turn The number of poles is a configuration parameter that can be entered in the controller con figuration see BPOL N
122. er Downloading and Installing the Utility The Configuration Utility must be obtained from the Support page on Roboteq s web site at www roboteq com Download the program and run the file setup exe inside the Roborun Setup folder Follow the instructions displayed on the screen Advanced Digital Motor Controllers User Manual 177 Using the Roborun Configuration Utility Robote grams gt Roboteq The controller does not need to be connected to the PC to start the Utility The Roborun Interface Header Tabs Status After the installation is complete run the program from your Start Menu gt Pro The Roborun utility is provided as a tool for easily configuring the Roboteq controller and running it for testing and troubleshooting purposes r I R Roborun c Jt 3 ili Work Offi Motor Control Utility oisi Rev 1 1 5 22 10 View Pinout Control Unit H Type Controller Model HDC2450 Configuration Run Console Scripting 7 v v RsusB Pulse Qo FETs0ff o o o 2786 Cmd O NC 0 Pint v 2791 Cmd2 0 NC 0 Pin2 Hest OverVolt UnderVolt Short Gur 9 o qu a jit T lad Fi ta 0 NC 0 NC 0 Pina eo 02 Q5 Qo Qo Qo Qo Qoo Goo oos a eec a cies eEnc28 Gro Ges Gr Qro G 90 dous Qoous douse oms eor 0o Dinis Din19 Qoo oous 0 MTmp2 0 Ping Command ma f i IE Mute Q Ce Joystick 48 Stop
123. er Acceleration ms 200 sere oss Aabangan Save Profie to Disk Use Feedback ig 1 12 Decceleration ms 200 meo Operating Mode Open Loop Speed Pulses Rev 2000 ra 22 S RPM 100 3000 D i Closed toop Ferentelere Restore Factory Defautts Min Limit 2147483648 Action at Min No Action Max Limit 134217727 Action at Max No Action ju Encoder 2 Nan FeaT Add Remove Lock Pulses Rev 1000 RPM 100 6000 Min Limit 2147483648 Action at Min No Action Max Limit 134217727 Action at Max No Action gt gt Digital Inputs b Xy Analog Inputs D 3 Pulse Inputs b amp Digital Outputs Apply In Out Labels Found COMI COM2 COM2 is Open Firmware ID Roboteq v1 1 RCB500 05 24 2010 FIGURE 56 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 When selecting a tree item the value of that item will show up as an underscored value Clicking on it enables a menu list or a freeform field that you can select to enter a new configuration values After changing a configuration an orange star appears next to that
124. er Action Action _ATGD Channel AmpTrigger Delay Channel Amps Trigger Delay _ATRIG Channel Amp Trigger Channel Amps Trigger Value _CLERD Channel LoopErrorDetec Channel Close Loop Error Detection tion _ICAP Channel Capped Int Channel PID Integral Cap _KD Channel DiffGain Channel PID Differential Gain _Kl Channel IntGain Channel PID Integral Gain _KP Channel PropGain Channel PID Proportional Gain _MAC Channel Acceleration Channel Motor Acceleration _MDEC Channel Deceleration Channel Motor Deceleration _MMOD Channel OperatingMode Channel Motor Operating Mode MVEL Channel DefPositionVel Channel Motor s Default Position Velocity 174 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Introduction TABLE 26 Command Set Arguments Get Argument Description MXPF Channel MaxPower Channel Motor Max Power MXPR Channel MaxPower Channel Motor Max Power _MXRPM Channel MaxRPM Channel Motor RPM at 100 _MXTRN Channel MaxTurns Channel Number of Motor Turns between Limits _PIDM Channel PIDMode Channel PID Mode Brushless Specific BHL BLHighLimit none BL Counter High Limit BHLA BLHiLimAction none BL Counter High Limit Action _BHOME BLHomeCount none BL Counter Load at Home Position _BLFB BLFeedback none Encoder or Hall Sensor
125. er action if these limits are reached The type actions are the same as these selectable for Digital Inputs and described in Digital Inputs Configurations and Uses on page 50 The count information is also used to measure rotation speed Using the Encoder Pulse Per Rotation PPR configuration parameter the output is a soeed measurement in actual RPM that is useful in closed loop speed modes where the desired speed is set as a numer ical value in RPM using a serial command The speed information is also scaled to produce a relative number ranging from 1000 to 1000 relative to a userconfigured arbitrary Max RPM value For example with the Max RPM configured as 3000 a motor rotating at 1500 RPM will output a relative speed of 500 Relative speed is useful for closed loop speed mode that use Analog or Pulse inputs as speed commands Configuring the encoder parameters is done easily using the PC Configuration Utility See Encoder Parameters on page 186 for details Hall Sensor Inputs On brushless motor controllers the Hall Sensors that are used to switch power around the motor windings are also used to measure speed and distance travelled Speed is evaluated by measuring the time between transition of the Hall Sensors A 32 bit up down counter is also updated at each Hall Sensor transition Speed information picked up from the Hall Sensors can be used for closed loop speed operation without any additional hardware Advan
126. er will appear like another Serial device to the PC This method was selected because of its simplicity particularly when writing custom software opening a COM port and exchanging serial data is a well documented technique in any programming language Note that Windows will assign a COM port number that is more or less random The Robo run PC utility automatically scans all open COM ports and will detect the controller on its own When writing your own software you will need to account for this uncertainty in the COM port assignment Important Warning Beware that because of its sophistication the USB protocol is less likely to recover than RS232 should an electrical disturbance occur We recommend using USB for configuration and monitoring and use RS232 for field deployment Deploy USB based system only after performing extensive testing and verifying that it operates reliably in your particular environment Command Priorities The controller will respond to commands from one of three possible sources Serial RS232 or USB Pulse e Analog One two or all three 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 select able priority scheme The priority mechanism is described in details in Input Command Modes and Priorities on page 41 USB vs Serial Communication Arbitration Commands may arrive through the RS232 or the USB port at t
127. erals of the Boolean type that map to the true and false state respectively Micro Basic supports only integer values ranged from 2 147483 648 0x80000000 to 2 147483 647 Ox7FFFFFFF Numbers can be preceded with a sign 4 or and can be written in one of the following formats Decimal Representation Number is represented in a set of decimal digits 0 9 120 5622 504635 Are all valid decimal numbers Hexadecimal Representation Number is represented in a set of hexadecimal digits 0 9 A F preceded by Ox OxA1 0x4C2 OxFFFF Are all valid hexadecimal numbers representing decimal values 161 1218 and 65535 respectively Binary Representation Number is represented in a set of binary digits 0 1 preceded by Ob 05101 051110011 05111001010 Are all valid binary numbers representing decimal values 5 115 and 458 respec tively Advanced Digital Motor Controllers User Manual 155 MicroBasic Scripting Robote Strings Strings are any string of printable characters enclosed in a pair of quotation marks Non printing characters may be represented by simple or hexadecimal escape sequence Micro Basic only handles strings using the Print command Strings cannot be stored in variable and no string hanaling instructions exist Simple Escape Sequence The following escape sequences can be used to print non visible or characters Sequence V v NO Na No f n r t v Description Single quote
128. ers 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 Syntax AMXMD nn MXMD Where nn 0 Separate 1 Mode 1 2 Mode 2 Default Value 0 separate Example AMXMD 0 Set mode to separate 138 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Motor Channel Configuration and Set Points PWMF PWM Frequency This parameter sets the PWM frequency of the switching output stage It can be set from 1 kHz to 32 kHz The frequency is entered as kHz value multiplied by 10 e g 185 18 5 kHz Beware that a too low frequency will create audible noise and would result in lower performance operation Syntax PWMF Where Allowed Range Default Value Example PWIMF nn nn Frequency 10 10 to 320 1kHz to 32 kHz 180 18 0 kHz PWMEF 200 Set PWM frequency to 20kHz Motor Channel Configuration and Set Points This section covers all motor operating parameters mostly related to controller s power stage TABLE 22 Motor Channel Configuration and Set Points Command Set Arguments a a Description ALIM Channel AmpLimit Channel Motor Amps Limit ATGA Channel AmpTrigger Action Channel Amps Trigger Action ATGD Channel AmpTrigger Delay Channel Amps Trigger
129. essage when Controller is detected Answering Yes the Roborun will read all the configuration parameters that are stored into the controller s memory Note If two or more controllers are connected to the same PC Roborun will only detect one Roborun will normally first detect the one assigned to the lowest COM port number however this is not entirely predictable It is recommended that you only connect one con troller at a time when using the PC utility 180 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Configuration Tab Configuration Tab The configuration tab is used to read modify and write the controller s many possible oper ating modes It provides a user friendly interface for viewing and editing the configuration parameters described in Set Read Configuration Commands on page 115 R Roborun FoR Ex ili Work Offi Motor Control Utility gig Rev 1 1 5 22 10 View Pinout Control Unit H Type Controller Model HDC2450 Configuration Run I Console Scripting Inputs Outputs Power Output Auto Load Configuration in Controller 4 Commands b 3 General Load from Controller b Ei Command Priorities D 4 Motori Output b Y Command Adjustments 4 Ja Motor2 Output Save to Controller b Qj Command Safety D 48 Amps Limits b 8 Telemetry D did Power Adjust Load Profile from Disk 4 hig Encoders 4 Q Acceleration ncod
130. etallic chassis for ground and run the positive wire along the sur face e Adda capacitor 10 000uF or higher near the controller Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Electrical Noise Reduction Techniques Electrical Noise Reduction Techniques As discussed in the above section the controller uses fast switching technology to control the amount of power applied to the motors While the controller incorporates several cir cuits to keep electrical noise to a minimum additional techniques can be used to keep the noise low when installing the controller in an application Below is a list of techniques you can try to keep noise emission low Keep wires as short as possible Loop wires through ferrite cores e Add snubber RC circuit at motor terminals Keep controller wires and battery enclosed in metallic body Battery Current vs Motor Current The controller measures and limits the current that flows through the motors and not the battery current Current that flows through the motor is typically higher than the battery current This counterintuitive phenomenon is due to the flyback current in the motor s inductance In some cases the motor current can be extremely high causing heat and potentially damage while battery current appears low or reasonable The motor s power is controlled by varying the On Off duty cycle of the battery voltage 16 000 times per second to t
131. example where ElseIf takes place If score gt 90 Then grade 1 ElseIf score gt 80 Then grade 2 ElseIf score gt 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 Next is the same syntax as Basic For Next statement e C Style For Next This is a new style of For Next statement optimized to work with Roboteq con trollers and it is recommended to be used It is the same semantics as C for loop but with a different syntax For var expression AndWhile condition Evaluate stmt lt block gt Next The c style for loop is executed by initialize the loop variable then the loop contin ues while the condition is true and after execution of single loop the evaluate state ment is executed then continues to next loop Dim arr 10 As Integer For i 0 AndWhile i lt 10 arr i 1 Next The previous example illustrates how to initialize array elements to 1 The following example illustrates how to use Evaluate to print even values from 0 10 inclusive For i 0 AndWhile i lt 10 Evaluate i 2 Print i n Next Advanced Digital Motor Controllers User Manual 161 MicroBasic Scripting Robote Whi
132. extended time the integral would allow to accumulate This parameter can be used to dampen the effect of the integral parameter without reducing the gain Syntax AICAP cc nn ICAP cc Where ce Motor channel nn Integral cap in Allowed Range 10 to 100 Default Value 100 Advanced Digital Motor Controllers User Manual 141 Serial RS232 USB Operation IRo boteQ KD Flat Differential Gain This is the Differential Gain for that channel The value is set as the gain multiplied by 10 Syntax AKD cc nn KD Where cc Motor channel nn Gain 10 Allowed Range O to 250 2 50 Default Value 200 2 0 Example AKD 1 155 Set motor channel 1 Differential Gain to 15 5 KI Flat Integral Gain This parameter sets the Integral Gain of the PID for that channel The value is set as the gain multiplied by 10 Syntax AKI cc nn KI Where cc Motor channel nn Gain 10 Allowed Range O to 250 2 50 Default Value 200 2 0 Example AKI 1 155 Set motor channel 1 Integral Gain to 15 5 KP Flat Proportional Gain This parameter sets the Proportional Gain for that channel The value is entered as the gain multiplied by 10 Syntax AKP cc nn KP Where ce Motor channel nn Gain 10 Allowed Range O to 250 2 50 Default Value 200 2 0 Example AKP 1 155 Set motor channel 1 Proportional Gain to 15 5 142 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 l
133. f the inputs or the joystick position at the time when clicking on the Done button The Center value can also be automatically computed to be the middle between Min and Max when enabling the Auto Center checkbox Clicking on Reset resets the Min Max and Center sliders and lets you restart the operation Range Editor Alnt Aln1 Input 3 2 nnn Minimum 0 O Center 2764 f Maximum 4275 t Reset Auto Center Save FIGURE 59 Auto calibration window After clicking on the Done button the capture values will appear in the Min Max and Center nodes in the tree with the orange next to them indicating that they have changed but not yet be saved in the controller At this point they can be adjusted further manually and saved in the controller Input Output Labeling Each analog digital or pulse input output is given default label e g DIN1 AIN2 Alter natively it is possible to assign or a user defined label name e g Limit1 eStop to each of these signals This label will then appear in the Run Tab next to the LED or Value box The label will also appear in the Pin View window See Figure 54 Pinout View pop up window on page 179 Custom labels make it much easier to monitor the controller s activity in the Run tab 4 gt Analog Inputs 4 2 Alni Cmd1 FIGURE 60 Labeling an Input Output To label an Input or Output simply select it in the tree A text field
134. faster than the Max RPM the return value here will exceed 1000 However a larger value is ignored by the controller for its internal operation Syntax SR cc Reply SR vv vv Where cc channel number VV speed relative to max T Temperature Reports the temperature at each of the Heatsink sides and on the internal silicon chips The reported value is in degrees C with a one degree resolution Syntax T cc Reply T tm t1 t2 Where cc temperature channel tm internal ICs t1 channel side t2 channel2 side Notes On some controller models additional temperature values are reported These are measured at different interval 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 Advanced Digital Motor Controllers User Manual 107 Serial RS232 USB Operation IRo boteQ TM Read Time Reports the current time in controller models equipped with Real Time clocks Note that time is kept whether the controller is On or Off but only if the controllers is connected to a power supply Syntax TM Reply TMzhh mm ss Where hh hours mm minutes ss seconds TRN Control Unit type and Controller Model Reports two strings identifying the Control Unit type and the Controller Model type This query is useful for adapting the user software application
135. fer the controller will only display the query result e g A 10 20 It will not display the query itself Syntax Reply Qa Where QQ is reply to query in the buffer C Clear Buffer History This command will clear the history buffer of all queries that may be stored in it If the con troller 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 110 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Query History Commands nn Start Automatic Sending This command will initiate the automatic retrieving and execution of queries from the his tory buffer The number that follows the command is the time in milliseconds between rep etition A single query is fetched and executed at each time interval Syntax 8 nn Reply QQ at every nn time intervals Where QO is reply to query in the buffer nn time in ms Range nn 1 to 32000ms Advanced Digital Motor Controllers User Manual 111 Serial RS232 USB Operation IRo boteQ Maintenance Commands This section contains a few commands that are used occasionally to perform maintenance functions TABLE 14 Maintenance Commands Command Argument Description DFU Key Enter Firmware Update via USB EELD none Load Parameters from EEPROM EERST Key Restore Factory Defaults EESAV none
136. 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 for USB fitted models To update the controller firmware click on the Update button and you can let controller automatically process the update after you have browsed for and selected the new firm ware file The log and checkboxes show the progress of the operation a Update Controller Firmware o a V Checking the controller Log i ee Checking file C cvs_projects RobotARM RIDES00 E Device is Restarted TOU E MCIoA bin asst Searching for device Checking COM1 device not found Checking COM2 device found Controller found on COM2 Resetting the controller done Waiting for device restart FIGURE 77 Update Controller Firmware window When updating via USB click on the Update firmware with USB This will cause the COM port to close and the device to disappear from PC utility The controller then enters a spe cial 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 After completion cycling power will restart the controller It will then be found by the PC utility Updating the Controller Logic The controller has a couple of programmable logic parts wh
137. hat the controller has the time to perform the position control algorithm If the gearing ratio is too high however the positioning mode will be very slug gish A good ratio should be such that the output shaft rotates at 1 to 10 rotations per second 60 to 600 RPM when the motor is at full speed The mechanical coupling between the motor and the sensor must be as tight as possible If the gear box is loose the positioning will not be accurate and will be unstable potentially causing the motor to oscillate Some sensors such as potentiometers have a limited rotation range of typically 270 degrees 3 4 of a turn which will in turn limit the mechanical motion of the motor potenti ometer assembly Consider using a multi turn potentiometer as long as it is mounted in a Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Sensor Mounting manner that will allow it to turn throughout much of its range when the mechanical assembly travels from the minimum to maximum position When using encoders best results are achieved when the encoder is mounted directly on the motor shaft Important Notice Potentiometers are mechanical devices subject to wear Use better quality potenti ometers and make sure that they are protected from the elements Consider using a solid state hall position sensor in the most critical applications Optical encoders may also be used but require a homing procedure t
138. he controller The single channel version of the controller incorporates a hardware setting inside the con troller which ensures that both channels switch in a synchronized manner and respond to commands sent to channel 1 Warning Use this wiring only with S versions Single Channel of the controller Pwr Ctrl 12V to 40V GND Controller FIGURE 3 Wiring for Single Channel Operation Important Warning Before pairing the outputs attach the motor to one channel and then the other Ver ify that the motor responds the same way to command changes Aavanced Digital Motor Controllers User Manual Connecting Power and Motors to the Controller Robote Power Fuses For low Amperage applications below 30A per motor it is recommended that a fuse be inserted in series with the main battery circuit as shown above and in the Figure 2 on page 18 The fuse will be shared by the two output stages and therefore must be placed before the Y connection to the two power wires Fuse rating should be the sum of the expected cur rent on both channels Note that automotive fuses above 40A are generally slow will be of limited effectiveness in protecting the controller and may be omitted in high current appli cation The fuse will mostly protect the wiring and battery against after the controller has failed Important Warning Fuses are typically slow to blow and will thus allow temporary excess current to flow t
139. he controller model are mapped as described in the table below TABLE 10 RS232 Signals on DB15 and DB25 connectors Pin Input or Number Output Signal Description 2 Output Data Out RS232 Data from Controller to PC 3 Input Data In RS232 Data In from PC 5 Ground Controller ground Cable configuration The RS232 connection requires the special cabling as described in Figure 49 The 9 pin female connector plugs into the PC or other microcontroller The 15 pin or 25 pin male connector plugs into the controller It is critical that you do not confuse the connector s pin numbering The pin numbers on the drawing are based on viewing the connectors from the front Most connectors brands have pin numbers molded on the plastic 88 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Serial Port Configuration DB9 Female DB15 Male To PC To Controller 10 Q1 O6 90 RX Data 2 fa nB85L2LMM nr O7 100 TX Data 39 5 AA Pm O8 nO 40 O4 O9 120 GND 59 5 130 O6 140 O7 15O 08 DB9 Female DB25 Male To PC To Controller 10 O1 O6 140 Data Out RX Data 2g a a ahahaiae aha Nata Out O7 150 Data In TX Data s3 hira a a ar 3 Data In Os 16 O 4 4 9 Os 170 9 GND 5 O_o GND GND i 18 O 19 O PE 200 O7 210 Qe 220 BS O 10 230 On 240 0O12 250 013 FIGURE 49 PC to controller RS232 cable connector wiring diagram The 9 pin
140. he indexer square brackets Arrays indices are zero based so index of 5 refer to the 6th element of the array arr 0 10 Set the value of the first element in the array to 10 a arr 5 Store the 6th element of the array into variable a Terminology In the following sections we will introduce Micro Basic commands and how it is used and here is the list of terminology used in the following sections Micro Basic commands and functions will be marked in blue and cyan respectively Anything enclosed in is mandatory and must be supplied Advanced Digital Motor Controllers User Manual 157 MicroBasic Scripting Robote e Anything enclosed in is optional except for arrays where the square brackets is used as indexers e Anything enclosed in and separated by characters are multi choice options Any items followed by an ellipsis may be repeated any number of times e Any punctuation and symbols except those above are part of the structure and must be included var is any valid variable name including arrays arr is any valid array name expression is any expression returning a result 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 languag
141. he motor from 096 motor off to 100 motor on Because of the inductive flyback effect during the Off time current continues to flow at nearly the same peak and not the average level as during the On time At low PWM ratios the peak current and therefore motor current can be very high as shown in Figure 5 Instant and average current waveforms on page 24 The relation between Battery Current and Motor current is given in the formula below Motor Current z Battery Current PWM ratio Example If the controller reports 10A of battery current while at 10 PWM the current in the motor is 10 0 1 100A Advanced Digital Motor Controllers User Manual Connecting Power and Motors to the Controller Robote FIGURE 4 Current flow during operation FIGURE 5 Instant and average current waveforms The relation between Battery Current and Motor current is given in the formula below Motor Current Battery Current PWM Ratio Example If the controller reports 10A of battery current while at 1096 PWM the current in the motor is 10 0 1 100A Important Warning Do not connect a motor that is rated at a higher current than the controller Power Regeneration Considerations When a motor Is spinning faster than it would normally at the applied voltage such as when moving downhill or decelerating the motor acts like a generator In such cases the current will flow in
142. he same time They are exe cuted as they arrive in a first come first served manner Commands that are arriving via USB are replied on USB Commands arriving via the UART are replied on the UART Redi rection symbol for redirecting outputs to the other port exists e g a command can be made respond on USB even though it arrived on RS232 Script generated Commands Commands that are issued from a user script are handled by the controller exactly as serial commands received via USB or RS232 Care must be taken that conflicting commands are not sent via the USB serial at the same time that a different command is issued by the script Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 IRo boteQ Communication Protocol Description Script commands are also subject to the serial Watchdog timer Motors will be stopped and command input will switch according to the Priority table if the Watchdog timer is allowed to timeout Communication Protocol Description The controller uses a simple communication protocol based on ASCII characters Com mands are not case sensitive a is the same as A Commands are terminated by carriage return Hex OxOd v The underscore character is interpreted by the controller as a carriage return This alter nate character is provided so that multiple commands can be easily concatenated inside a single string All other characters lower than 0x20 space have no effect
143. hrough them for a time the higher the excess current the faster the fuse will blow This characteristic is desirable in most cases as it will allow motors to draw surges during acceleration and braking However it also means that the fuse may not be able to protect the controller Wire Length Limits The controller regulates the output power by switching the power to the motors On and Off at high frequencies At such frequencies the wires inductance produces undesirable effects such as parasitic RF emissions ringing and overvoltage peaks The controller has built in capacitors and voltage limiters that will reduce these effects However should the wire inductance be increased for example by extended wire length these effects will be amplified beyond the controller s capability to correct them This is particularly the case for the main battery power wires thick red and black cables 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 If the controller must be located at a long distance from the power source the effects of the wire inductance may be reduced by using one or more of the following techniques Twisting the power and ground wires over the full length of the wires e Use the vehicle s m
144. i nic da fe tartan ep ety RP ER ERE Res 179 Status Bar Content evi iss ez eda Rae Sie LAU ac ER We EE ANG 179 Program Launch and Controller Discovery celere 180 Contiguration Tab zs s nie etos ie is eim ac stews etas Y Wb ees 181 Entering Parameter Values lille nne 182 Automatic Analog and Pulse input Calibration 182 Input Outp t Labeling MR nh Re AER RE DR 183 Loading Saving Controller Parameters ns 184 Locking amp Unlocking Configuration Access 184 Configuration Parameters Grouping amp Organization 185 Commands Parameters 2 cece ee enhn 185 Encoder Parameters issus a edie ote ededwe dave eevee ee 186 Digital Input and Output Parameters llle ees 187 Analog Input Parameters ss orn 187 Pulse Input Parameters au iacent a ed Rx hada x RR neon 187 Power Settings ste b dex Gee Ue EE RR ae Em deck 187 Ur 189 Status and Fault Monitoring sses sssri llle 189 Applying Motor Commands 0c eee e eee eee eee eee 190 Digital Analog and Pulse Input Monitoring 0 eeee eee 190 Digital Output Activation and Monitoring cliens 190 Using the Chart Recorder cece eee nnn 190 S enEnI WI Io PTT 192 Text Mode Commands Communication aaa 192 Updating the Controller s Firmware 2 cece eee eee eee eee eee 193 Updating the Controller Logic 2 sssaaa eee eee 193
145. ich can also be updated in the field Updating the logic must only be done only when the power stage is off and the con troller is powered only with the power control wire No I O must be connected on the front connectors either To update the logic click on the Update Power Board Logic or Update Controller Logic select the file and click on the Program button The log shows the steps that are taking place during the process The process last approximately 30 sec do not cancel the programming in the middle of programming even if it looks that there is no progress Can cel only after over a minute of inactivity Never turn off the power while programming is in progress Advanced Digital Motor Controllers User Manual 193 Using the Roborun Configuration Utility Robote Update Power Board Logic Logic File Select File Utility Log Progam Cos FIGURE 78 Update Power Board Logic window After updating the logic you should turn off and turn on the controller in order for the changes to be fully accounted for 194 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Scripting Tab Scripting Tab One of the controller s most powerful and innovative features is the ability for the user to write programs that are permanently saved into and run from the controller s Flash Mem ory This capability is the equivalent of combining the motor controlle
146. imit Action EHOME Channel HomeCount Channel Encoder Counter Load at Home Position ELL Channel EncLowLimit Channe Encoder Low Limit ELLA Channel EncLoLimAction Channe Encoder Low Limit Action EMOD Channel EncoderUse Channe Encoder Use EPPR Channel EncoderPPR Channe Encoder PPR KDC1 PointNbr Ch1DiffGainCurve Point KD Curve Points for Motor1 KDC2 PointNbr Ch2DiffGainCurve Point KD Curve Points for Motor2 KIC1 PointNbr Ch1IntGainCurve Point KI Curve Points for Motor1 KIC2 PointNbr Ch2IntGainCurve Point KI Curve Points for Motor2 KPC1 PointNbr Ch1PropGainCurve1 Point KP Curve Points for Motor1 KPC2 PointNbr Ch2PropGainCurve Point KP Curve Points for Motor2 EHL Encoder High Count Limit This parameter is the same as the ELL except that it defines an upper count boundary at which to trigger the action 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 Low Limit Count is the desired position when a command of 000 is received Advanced Digital Motor Controllers User Manual 129 Serial RS232 USB Operation IRo boteQ Syntax AEHL cc nn EHL Where cc Channel number nn Counter value Default Value 20000 EHLA Encoder High Limit Action This parameter lets you select what kind of action should be taken when the upper bound ary of the counter is reached The
147. ing values Advanced Digital Motor Controllers User Manual 77 Closed Loop Speed Mode Robote Note that the controller uses one set of Proportional Integral and Differential Gains for both motors and therefore assumes that similar motor mechanical assemblies and loads are present at each channel On some controller models it is possible to set different gains for each parameter depend ing on the actual measured speed Up to 5 values can be set On these models use Flat PID or Multi Range PID in the PC configuration screen to select the desired mode In slow systems use the integrator limit parameter to prevent the integrator to reach satu ration prematurely and create overshoots 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 Three levels of sensitivity are provided in the controller configuration 1 250ms and Error gt 100 2 500ms and Error gt 250 3 1000ms and Error 5 500 When an error is triggered the motor channel is stopped until the error has disappeared the motor channel is reset to open loop mode Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Mode Description
148. ion Arbitration 90 Script generated Commands llle eere 90 Communication Protocol Description 0c ce es 91 Character EChOzs e whew se neisa cag ecnesedaves Meee ieee RASS 91 Command Acknowledgement ee eee eee eee 91 Command Eros 9 iex teen NG PAN eee need webs UR OR RN es 91 Watchdog time OUt i424 duke ke ENN PERE Pee eee OES 91 Controller Present Check zs uw downbeat nio esa RR o a 92 Commands Types ss serrr cers eR m dem em ee ee Rm de de 92 huntirie commands vieles ehe eR a 3 RR DEI NE 92 Runtime queries aa sas iiae ao aa nnn 92 Maintenance cCOommanNdS saie anaiei a E ee ee eee eee a E 92 Set Read Configuration cCommandS s a s sasas eee eee eee 92 Runtme COMMANS 22 2045 kaaa aah nupi eee bee e Rus os EUR E e pes 93 DC Set Decel ratiorn a ctore AA dae ae cabs 94 DS Set all Digital Qut DIIS ss sessi iweni kui n EE RE RE Pa eee cn 94 DO Reset Individual Digital Out bits 2 eee 94 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote D1 Set Individual Digital Out bits aan 94 EX Ernmiergency StOD sies esu i ovine x es BENDA GRE AKEN 94 G Individual Motor Command 2 00 c eee eee ees 95 H Load Home counter lore ep ete RR et 95 MG Emergency Stop Release eee 95 M Multiple Motor Command 0 cece ee eee 95 P Go to Absolute Desired Position 0 0 cece eee 96 S Motor Positio
149. is sectioned This can be done by adding resistors at each end of the potentiometer so that the full OV or the full 5V will never be present during normal operation when the potenti ometer is moved end to end Using this circuit shown below the Analog input will be pulled to OV if the two top wires of the pot are cut and pulled to 5V if the bottom wire is cut In normal operation using the shown resistor values the analog voltage at the input will vary from 0 2V to 4 8V Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Connecting Tachometer to Analog Inputs 220 Ohm 45V Internal Resistors and Converter 5K Ohm Pot 20kOhm 33kOhm 220 Ohm Ground FIGURE 13 Potentiometer wiring in Position mode The controller s analog channels are configured by default so that the min and max com mand range is from 0 25V to 4 75V These values can be changed using the PC configura tion 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 con sidered invalid if the voltage is lower than 0 1V or higher than 4 9 These values cannot be changed Connecting Tachometer to Analog Inputs When operating in closed loop speed mode tachometers can be connected to the control ler to report the measured motor speed The tachome
150. ition and substracts it from the desired position to compute the position error The resulting error value is then multiplied by a user selectable Proportional Gain The resulting value becomes one of the components used to command the motor The effect of this part of the algorithm is to apply power to the motor that is proportional with the dis tance between the current and desired positions when far apart high power is applied with the power being gradually reduced and stopped as the motor moves to the final posi tion The Proportional feedback is the most important component of the PID in Position mode A higher Proportional Gain will cause the algorithm to apply a higher level of power for a given measured error thus making the motor move quicker Because of inertia however a faster moving motor will have more difficulty stopping when it reaches its desired position It will therefore overshoot and possibly oscillate around that end position Output Analog Position Sensor or Optical Encoder Differential Gain FIGURE 47 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 This change will be a relatively large number every time an abrupt change occurs on the desired position value or the measured position value The value of that change is then multiplied by a userselectable Differential Gain and added to the output The
151. ke a look to Arrays section see Arrays on page 157 Variable and arrays names should follow specification stated in the Variables section see Variables on page 157 If Then Statement Line If If condition Then stmt Else stmt e Block If If condition Then lt block gt ElseIf condition Then lt block gt ElseIf lt condition gt Then lt block gt Else lt block gt End If An If Then statement is the basic conditional statement If the expression in the If statement is true the statements enclosed by the If block are executed If the expression is false each of the ElseIf expressions is evaluated If one of the ElseIf expressions evaluates to true the corresponding block is executed If no expression evaluates to true and there is an E1se block the E1se block is executed Once a block finishes executing execution passes to the end of the If Then statement The line version of the If statement has a single statement to be executed if the If expression is true and an optional statement to be executed if the expression is false For example Dim a As Integer Dim b As Integer a 10 b 20 Block If statement If a lt b Then a b Else b a End If 160 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction Line If statement If a lt b Then a b Else b a Below is an
152. ker than the natural deceleration due to the friction in the motor assembly motor gears load Any deceleration that would be quicker than natural friction means that braking energy will need to be taken out of the sys tem causing a reverse current flow and voltage rise See Important Warning on page 64 Place a battery in parallel with the power supply output This will provide a reservoir into which regeneration current can flow It will also be very helpful for delivering high current surges during motor acceleration making it possible to use a lower current power supply Batteries mounted in this way should be connected for the first time only while fully charged and should not be allowed to discharge The power supply will be required to output unsafe amounts of current if connected directly to a discharged battery Consider using a decoupling diode on the power Advanced Digital Motor Controllers User Manual 25 Connecting Power and Motors to the Controller Robote supply s output to prevent battery or regeneration current to flow back into the power supply Place a resistive load in parallel with the power supply with a circuit to enable that load during regeneration This solution is more complex but will provide a safe path for the braking energy into a load designed to dissipate it To prevent current from flowing from the power supply into the load during normal operation an active switch would enable the load when
153. l 27 Connecting Sensors and Actuators to Input Outputs Robote 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 l Os provide command feed back and or safety information to the controller When the controller operates in modes that do not use these l Os these signals are ignored or can become available via the USB RS232 port for user application Below is a summary of the available signals and the modes in which they are used by the controller The actual number of signal of each type voltage or current specification and their position on the I O connector is given in the controller datasheet TABLE 2 Controller s IO signals and definitions Signal VO type Use Activation DOUT1 Digital Output Activated when motor s is powered to Activated when motor s is reversed DOUTn l Activated when overvoltage Miror Status LED User activated RS232 USB DIN1 Digital Input Safety Stop to Emergency sto DINn canis Motor Stop deadman switch Invert motor direction Forward or reverse limit switch Run MicroBasic Script Load Home counter AIN1 Analog Input Command for motor s ki Speed or position feedback n Trigger Action similar to Digital Input if under or over user selectable threshold PIN1 Pulse Input Command for motor s BN Speed or position feedback n
154. le o 0 Sop Conf DO Da Capture 400 Pla E ESEE EE TE BELLA ELEM qoo KA Channel 0 Value Mn Max Cr wi H Bl Motor Command 1 x 41 801 s ra E Bl Motor Power 1 z e 2 x p 40 i E EE a50 1900 as O ACC L 20 AV X El Speed 1 j5 3 79 p d f B Encoder Count 1 v 119934 6476 475487 3 Y TF U Batt Amps 1 so 0 1 g c E Wl Heatsink Temp 2 i 27 3 ET 27 T TO M Controler vot 33 Bi Be G 80 E paa L 23 BR Pause Clear Chart ae ee a D fe Save 3 Clear Log Found COMI COM2 CON2 is Open Firmware ID Roboteq v1 1 RCE500 05 24 2010 FIGURE 73 Run tab Each group of monitored parameters can be disabled with a checkbox at the upper left cor ner of their frame By default all are enabled Disabling one or more will increase the cap ture resolution in the chart and log of the remaining ones Status and Fault Monitoring Status LEDs show the real time state of key operating flags The meaning of each LED is displayed next to it and can vary from one controller to another The Fault LEDs indicate all fault conditions Any one LED that is lit will cause the controller to disable the power to all motor output channels The meaning of each LED is displayed next to it and can vary from one controller to another The Config Fault LED indicates that an invalid configuration is read from the controller This would be an extremely unlikely occurrence but if it happens restore th
155. le Do Statements While End While Statement While condition lt block gt End While Example a 10 While a gt 0 Print a a An ac End While Print Loop ended with a a n Do While Loop Statement Do While condition lt block gt 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 gt 0 Print a a n aa Loop Print Loop ended with a a n Do Until Loop Statement Do Until lt condition gt lt block gt Loop Unlike Do While Loop statement Do Until Loop statement exist the loop when the expression evaluates to true a 10 Do Until a 0 Print a a n d Loop Print Loop ended with a a n Do Loop While Statement Do lt block gt Loop While lt condition gt Do Loop While statement grantees that the loop block will be executed at least once as the condition is evaluated and checked after executing the block 162 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction a 10 Do Print a a n ru Loop While a 0 Print Loop ended with a a n Do Loop Until Statement Do lt block gt Loop Until lt condition gt Unlike Do Loop While statement Do Loop Until statement exist the loop when the expression evaluates to true
156. le acceleration This feature is necessary in order to minimize the surge current and mechanical stress during abrupt speed changes This parameter can be changed by using the PC utility Acceleration can be different for each motor A different value can also be set for the acceleration and for the deceleration The acceleration value is entered in RPMs per second In open loop installation where speed is not actually measured the acceleration value is relative to the Max RPM parame ter For example if the Max RPM is set to 1000 default value and acceleration to 2000 this means that the controller will go from O to 100 power in 0 5 seconds Important Warning Depending on the load s weight and inertia a quick acceleration can cause consider able current surges from the batteries into the motor A quick deceleration will cause an equally large or possibly larger regeneration current surge Always experiment with the lowest acceleration value first and settle for the slowest acceptable value Forward and Reverse Output 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 bat tery 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 Moto
157. ler model s datasheet Important Warning Keep the Hall sensor wires away from the motor wires High power PWM switching on the motor leads will induce spikes on the Hall sensor wires if located too close On hub motors where the Hall sensor wires are inside the same cable as the motor power wires separate the two sets of wires the nearest from the motor as possible Important Notice Make sure that the motor sensors have a digital output with the signal either at 0 or at 1 as usually is the case Sensors that output a slow changing analog signals will cause the motor to run imperfectly Hall Sensor Wiring Order The order of the Hall sensors and these of the motor connections must match in order for the motor to spin Unfortunately there is no standard naming and ordering convention for brushless motors It often is the case that the motor will correctly operate when wiring the controller s sensor inputs HA HB HC and the controller s U V W outputs in the same order as what is marked the motor or leads if such an order is provided Aavanced Digital Motor Controllers User Manual 69 Brushless Motor Connections and Operation Robote If this is not the case then the wire order must be determined by trial and error To do this you can either connect the motor wires permanently and then try different combination of Hall sensor wiring or you can connect the Hall sensors permanently and try different com bina
158. ler s flash memory where it will remain permanently unless overwrit ten 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 A progress bar will appear for the duration of the transfer which can be from a fraction of a second to a few seconds When the download is completed successfully no message is displayed and control is returned to the editor An error message will appear only if the controller is not ready to receive or if an error occurred during the download phase Downloading a new script while a script is already running will cause the running script to stop execution All variables will also be cleared when a new script is downloaded Executing MicroBasic Scripts Once stored in the Controller s Flash memory scripts can be executed either Manually or automatically every time the controller is started 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 e Ir Start or Resume Script e Ir0 Pause Script execution e r1 Resume Script from pause point All integer and Boolean variables have val ues they had at the time the script was paused e Ir2 Restarts Script from start Set all integer variables to O sets all Boolean vari ables to False Clears and st
159. limit count is reached on the hall sensor counter of brushless motors The list of action is the same as in the DINA digital input action list See DINA Digital Input Action on page 120 Embedded in the parameter is the motor channel s to which the action should apply Syntax BLLA nn BLLA Where aa DIN Action List Default Value 0 no action Advanced Digital Motor Controllers User Manual 135 Serial RS232 USB Operation Robote BLSTD Brushless Stall Detection This parameter controls the stall detection of brushless motors If no motion is sensed i e counter remains unchanged for a preset amount of time while the power applied is above a given threshold a stall condition is detected and the power to the motor is cut until the command is returned to 0 This parameter allows three combination of time amp power sen sitivities Syntax Where Default Value Example BLSTD nn BLSTD nn 0 Disabled 1 250ms at 10 Power 2 500ms at 2596 Power 3 1000ms at 5096 Power 2 BLSTD 2 Motor will stop if applied power is higher than 1096 and no motion is detected for more than 250ms BPOL Number of Poles of Brushless Motor This parameter is used to define the number of poles of the brushless motor connected to the controller This value is used to convert the hall sensor transition counts into actual RPM and number of motor turns Syntax Where Default Value BPOL nn BP
160. loc ity and decelerates at a controlled rate to stop precisely at the end position The graph below shows the speed and position vs time during a position move Advanced Digital Motor Controllers User Manual 83 Closed Loop Position Mode Robote FIGURE 46 Position End Position Start Position Speed Time Position Mode Velocity Acceleration Deceleration Time In this mode the command is a value ranging from 1000 to 1000 and can be issued from the serial USB analog input pulse input or from a MicroBasic script The feedback sensor range is scaled to a 1000 to 1000 value as well On analog and pulse sensors the scaling is done using the min max center configuration parameters When encoders are used for feedback the encoder count is also converted into a 1000 to 1000 range In the encoder case the scaling uses the Encoder Min and Max configuration parameters See Serial RS232 USB Operation on page 87 for details on these configuration parameters Beware that encoders counters produce incremental values The encoder counters must be reset using the homing procedure before they can be used as position feedback sen sors When turning the controller on the default acceleration deceleration and velocity are parameters retrieved from the configuration EEPROM In most applications these parame ters can be left unchanged and only change in commands used to control the change
161. ls String parameters are entered in plain text and they are checked against the maximum number of characters that are allowed for that string If entering a string that is longer the string is truncated to the maximum number of allowed characters Automatic Analog and Pulse input Calibration Analog and Pulse inputs can be configured to have a user defined minimum maximum and center range These parameters can be viewed and edited manually by expanding the Range subnode The minimum maximum and center values can also be captured automatically by clicking on the Calibrate link 4 gt Analog Inputs 4 y Bint Cmd1 Conversion Type Relative Input Use Motor Command 1 4 S Range Calibrate Input Min mV 100 Input Center mV 2500 Input Max mV 4900 Input Deadband 5 Action on Min No Action Action on Max No Action FIGURE 58 Min Max Center parameters and auto calibration for Analog amp Pulse Inputs 182 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Configuration Tab 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 mini mum and maximum detected values It is possible to further manually adjust further these settings by moving the sliders The Center value will be either the value o
162. ments The first to select the motor channel the second to set the velocity The motor channel may be omitted in single channel controllers The velocity is set in actual RPMs in system with speed sensor encoder or brushless hall sensors In systems without speed sensors the velocity parameter will be relative to the Max RPM configuration parameter Syntax IS nn mm Where nn mm speed value in RPM Examples IS 2500 set motor1 position velocity to 2500 RPM IS 12500 set motor1 position velocity to 2500 RPM CB Set Brushless Counter This command loads the brushless counter with the value contained in the command argu ment Syntax ICB nn Where nn counter value Example ICB 1000 Loads 1000 in brushless counter ICB 0 Clears brushless counter C Set Encoder Counters This command loads the encoder counter for the selected motor channel with the value contained in the command argument Syntax IC nn mm Where nn channel number mm counter value Example IC 2 1000 Loads 1000 in encoder counter 2 IC 10 Clears encoder counter 1 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Runtime Commands VAR Set User Variable This command is used to set a 32 bit variable that can be read from within a user script It is used to pass up to 32 individual bits or a single 32 bit signed number to the user script Syntax IVAR nn Where nn value Advanced Digital
163. mit Action This parameter lets you select what kind of action should be taken when the low limit count is reached on the encoder The list of action is the same as in the DINA digital input action list see DINA Digital Input Action on page 120 Embedded in the parameter is the motor channel s to which the action should apply Syntax AELLA cc aa mm ELLA cc Where ce Input channel number aa DIN Action List mm mot1 16 mot2 32 Default Value 0 no action for each encoder EMOD Encoder Usage This parameter defines what use the encoder is for The encoder can be used to set com mand or to provide feedback speed or position feedback The use of encoder as feedback devices is the most common Embedded in the parameter is the motor to which the encoder is associated Syntax AEMOD cc aa mm EMOD cc Where cc Channel number aa 0 Unused 1 Feedback 2 Command mm mot1 16 mot2 32 Example AEMOD 1 17 Encoder used as feedback for channel 1 EPPR Encoder PPR Value This parameter will set the pulse per revolution of the encoder that is attached to the con troller The PPR is the number of pulses that is issued by the encoder when making a full turn For each pulse there will be 4 counts which means that the total number of a counter increments inside the controller will be 4x the PPR value Make sure not to confuse the Pulse Per Revolution and the Count Per Revolution when setting up this p
164. motors at once The command can include 1 or 2 parameters to set the speed of one or both motors from sin gle command The commands are given in values from 1000 to 1000 and represent a power level in open loop speed mode desired speed in percent of max RPM in the closed loop speed mode or a desired relative position in the closed loop position mode If only one parameter is sent the value is applied to channel 1 When two parameters follow the runtime command they apply to the first and the second channel Syntax IM nn mm Where nn mm command value in 1000 range Advanced Digital Motor Controllers User Manual 95 Serial RS232 USB Operation IRo boteQ Examples IM 500 set motor1 to 500 IM 500 600 set motor1 to 500 and motor2 to 600 IM 0 600 stop motor1 and set motor2 to 600 IM 0 0 stop both motors P Go to Absolute Desired Position This command is used in position mode when encoder is used for position feedback to make the motor moved to a specified encoder count value This mode is not yet imple mented in version 1 2 of the firmware The position mode currently only accepts destina tion positions as relative values ranging from 1000 to 1000 using the G Go command S Motor Position Mode Velocity This runtime command accepts actual RPM values and works in the closed loop position mode and determines the speed at which the motor should move from one position to the next This command requires two argu
165. mputes the logical AND for its oper ands that is the result is true if and only if both operands are true expression And expression Or Operator The Or operator functions only as a binary operator For numbers it computes the bitwise OR of its operands For boolean operands it computes the logical OR for its operands that is the result is false if and only if both its operands are false expression Or expression XOr Operator The xor operator functions only as a binary operator For numbers it computes the bit wise exclusive OR of its operands For boolean operands it computes the logical exclu sive OR for its operands that is the result is true if and only if exactly one of its operands is true expression XOr expression Not Operator The Not operator functions only as a unary operator For numbers it performs a bitwise complement operation on its operand For boolean operands it negates its operand that is the result is true if and only if its operand is false Not expression 166 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction True Literal The True keyword is a literal of type Boolean representing the boolean value true False Literal The False keyword is a literal of type Boolean representing the boolean value false Operator The increment operator increments its operand by 1 The increment operator can appear before or afte
166. n 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 Brush less motor controllers use the hall sensor for measuring actual speed and acceleration will also be in actual RPM s When using the controller without speed sensor the acceleration value is relative to the Max RPM configuration parameter which itself is a userprovide number for the speed nor mally expected speed at full power Assuming that the Max RPM parameter is set to 1000 and acceleration value of 10000 means that the motor will go from 0 to full speed in exactly 1 second regardless of the actual motor speed Syntax IAC nn mm Where nn motor channel mm acceleration value in 0 1 RPM s Examples IAC 12000 Increase Motor 1 speed by 200 RPM every second if speed is measured by encoder AC220000 Time from 0 to full power is 0 5s if no speed sensors are present and Max RPM is set to 1000 Advanced Digital Motor Controllers User Manual 93 Serial RS232 USB Operation IRo boteQ DC Set Deceleration Same as AC but for speed changes from fast to slow Syntax IDC nn mm Where nn motor channel mm deceleration value in 0 1 RPM s Examples IDC 12000 Reduce Motor 1 spee
167. n Mode Velocity 2 cee eee ees 96 CB Set Brushless Counter ec ees 96 C Set Encoder Counters 24 04 2s chews Dha PNG PANDA daw eia 96 VAR Set User Variable naaa aui wees swede wee n Bem RR BUR EUR mala 97 Runtime QUENES 2 2 x Rx CR CR e Rn cn NUNG n soe KANG AN NG 98 A Motor Amps i icccc cere ee KGG ABG ee eee eee RR ERR ERREUR 99 AI Analog Inplit sa ennt o RR nina AA KA n RUA linen AG 99 BA Battery AMPS ss sewo cee E 100 BS Read BL Motor Speed in RPM 00 eee eee ees 100 BSR Read BL Motor Speed as 1 1000 of Max lees 100 C Encoder Counter Absolute 2 cece 101 CB Absolute Brushless Counter 0 0 0 cece eee eee ees 101 CBR Read Brushless Count Relative 0 00 cee eee eee 101 CIA Read Internal Analog Command cece eee eens 101 CIP Read Internal Pulse Command 0c cece eee eee eee 102 CIS Read Internal Serial Command 000 eee eee ee 102 CR Encoder Counter Relative 2 cee eens 102 D Digital INPUTS s xut ncn wide wae ee ecce RR ei aces 102 DI Read Individual Digital Inputs llle 103 DO Digital Output Status llle nnn 103 E Read Closed Loop ETO s s el RR RR ER ER 104 s Feedback lu iced t ubRI rr EFE EE ate ka ed die tiene a exe 104 FF Fault Flag sx hm Rt Rm nth RE ROCA ERROR n RR n 104 FID Firmware D zi utei c Re REERRE Ed ERI EP MEI YE 104 FS Status Flagasz sss cw Roe Sean DONA npa eem t eio bo io dc 105 WK LOCK StatUS Diana
168. n its status The total number of Digital output channels varies from one controller model to another and can be found in the product datasheet Advanced Digital Motor Controllers User Manual 103 Serial RS232 USB Operation IRo boteQ E Read Closed Loop Error In close loop modes Speed or Position returns the difference between the desired speed or position and the measured feedback This query can be used to detect when the motor has reached the desired speed or position In open loop mode this query returns 0 Syntax E Reply E nn Where nn error F Feedback In 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 in 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 Syntax F cc Reply F n1 n2 Where cc channel number n1 n2 feedback values FF Fault Flag Reports the status of the 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 FF cc Reply FF f1 f2 2 f3 4 fn 2 Where f1 overheat f2 overvoltage
169. n would generate 10 000 60 200 4 2 133 3 kHz which is well within the 1MHz maximum supported by the encoder input An encoder with a 200 Pulses per Revolutions is a good choice for most applications A higher resolution will cause the counter to count faster than necessary and possibly reach the controller s maximum frequency limit An encoder with a much lower resolution will cause speed to be measured with less preci sion Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Connecting the Encoder Connecting the Encoder Encoders connect directly to pins present on the controller s connector The connector pro vides 5V power to the encoders and has inputs for the two quadrature signals from each encoder The figure below shows the connection to the encoder 5V Controller GND ENC1B ENC2B FIGURE 21 Controller connection to typical Encoder 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 must 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 Encoder Ferrite Core Controller FIGURE 22 Use ferrite core on cable length beyond 2 or 60cm Important Warning Excessive cable length will cause electrical
170. nabled the controller will select which mode to use based on a user select able priority scheme Setting the priorities is done using the PC configuration utility See Commands Parame ters on page 185 This scheme uses a priority table containing three parameters and let you select which mode must be used in each priority order During operation the controller reads the first priority parameter and switches to that command mode If that command mode is found to be active that command is then used If no valid command is detected the controller switches to the mode defined in the next priority parameter If no valid command is recog nized in that mode the controller then repeats the operation with the third priority parame ter If no valid command is recognized in that last mode the controller applies a default command value that can be set by the user typically 0 Advanced Digital Motor Controllers User Manual 41 Command Modes Robote Serial USB Analog FIGURE 23 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 consid ered inactive and the next lower priority level will be selected as soon as the watchdog timer expires Note that disabling the watchdog will cause the serial mode to be always active after the first command is received and
171. nclosure and lowers the amps limit to 50A when the average temperature exceeds 500C Amps limit is set at 100A when temperature is below 500 Notice that as temperature is changing slowly the loop update rate has been set at a relatively slow 100ms rate top Temperaturel getvalue TEMP 1 Temperaturel getvalue TEMP 1 TempAvg Temperaturel Temperature2 2 if TempAvg gt 50 then setconfig _ALIM 1 500 setconfig _ALIM 2 500 else setconfig _ALIM 1 1000 setconfig _ALIM 2 1000 end if wait 100 goto top 154 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ MicroBasic Language Reference MicroBasic Language Reference Introduction Comments Boolean Numbers The Roboteq Micro Basic is high level language that is used to generate programs that runs on Roboteq motor controllers It uses syntax nearly like Basic syntax with some adjustments to speed program execution in the controller and make it easier to use 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 True and False are lit
172. nd Set Analog Input Mode 0c eee eee 125 APOL Analog Input Polarity 2 cee eee 125 Pulse Input Configuration Liu fsck nG dele ad ER A Saeed deed 126 PCTR Pulse Center Range 2 cece eee eee eee 126 PDB Pulse Input Deadband 2 0 cee eee eee 126 PINA Pulse Input USE ccc nce ace NG rhon nh m eee cn 127 PLIN Pulse Linearitys s ia kee cab RR eke Rx Rn 127 PMAX Pulse Max Range c cece eee ee eee eee 127 PMAXA Action at Pulse Max 2 2 cece ee eee eee 128 PMIN Pulse Min Range 2 2 cece eee eee eee 128 Aavanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote PMINA Action at Pulse Min llle 128 PMOD Pulse Mode S l ct scssi pana PAA BEA ARKA DAANG ii 128 PPOL Pulse Input Polarity eee eee 129 Encoder Operations aa a eee pe ee i RN RR RT Rc 129 EHL Encoder High Count Limit 129 EHLA Encoder High Limit Action e eee eee eee 130 EHOME Encoder Counter Load at Home Position 130 ELL Encoder Low Count Limit eee eee eee eee 130 ELLA Encoder Low Limit Action eere 131 EMOD Encoder Sage xs enm mx cxx pm ec RR em ens 131 EPPR Encoder PPR ValS s sa ssim or ERR eee eG eee as 131 KDC1 Differential Gains Table for Motor 1 lees 132 KDC2 Differential Gains Table for Motor2 eee eee 132 KIC1 Integral Gains Table for Moto
173. nd or cause the motors not to run Care must be exercised in the configuration process to avoid possible redundant or con flictual use Digital Inputs Configurations and Uses Each of the controller s digital Inputs can be configured so that they are active high or active low Each output can also be configured to activate one of the actions from the list in the table below In multi channel controller models the action can be set to apply to any or all motor channels TABLE 5 Digital Input Action List Applicable Action Channel Description No Action Input causes no action Safety Stop Selectable Stops the selected motor s channel until command is moved back to O or command direction is reversed Emergency stop All Stops the controller entirely until controller is powered down or a special command is received via the serial port Motor Stop deadman Selectable Stops the selected motor s while the input is active switch Motor resumes when input becomes inactive Invert motor direction Selectable Inverts the motor direction regardless of the command mode in used Forward limit switch Selectable Stops the motor until command is changed to reversed Reverse limit switch Selectable Stops the motor until the command is changed forward Run script NA Start execution of MicroBasic script Load Home counter Selectable Load counter with Home value 50 Advanced Digital Motor Controllers User Manual
174. nfiguration to EEPROM reset load default etc Set Read Configuration commands These start with for read and for write They are used to read or configure all the operating parameters of the controller e g set or read amps limit See Set Read Config uration Commands on page 115 for the full list and description of these commands 92 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Runtime Commands Runtime Commands Runtime commands are commands that can be sent at any time during controller opera tion and are taken into consideration immediately Runtime commands start with and are followed by 1 or 2 letters Runtime commands are also used to refresh the watchdog timer to ensure safe communication TABLE 11 Runtime Commands Command Arguments Description AC Channel Acceleration Set Acceleration DC Channel Deceleration Set Deceleration DS Value Set all Digital Out bits DO BitNumber Reset Individual Digital Out bits D1 BitNumber Set Individual Digital Out bits EX None Emergency Shutdown G Channel Command Set Motor Command H Channel Load Home counter MG None Release Shutdown Command1 Command2 Set Command for 1 or 2 channels P Channel Position Set Position S Channel Velocity Set Velocity CB Counter Set Brushless Counter C Channel Counter Set Encoder Counters VAR Value Set User Variable AC Set Acceleratio
175. nnel that action should apply 4 gt Digital Inputs 4 gt Dint Limt Active Level High Action No Action FIGURE 69 Digital Input parameters For Digital Output you can set the Active Level and the trigger source that will activate the Output Analog Input Parameters See Analog Input Configurations on page 122 for details on this group of parameters For Analog inputs all the parameters that can be selected include the enabling and conver sion 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 Pulse Input Parameters See Pulse Input Configuration on page 126 for details on this group of parameters For Pulse inputs the tree lets us enable that input and select what it is used for and what type of capture it is to make The range deadband and actions to take on when Min and Max are reached is also selectable Power Settings See General Power Stage Configuration Commands on page 137 for details on this group of parameters The power output tree sets parameters that relate to the motor driver and power stage of the controller There is one tree for setting parameters that apply to all channels of the con troller These are the PWM Frequency the low and high side Voltage Limits the Short Cir cuit Protection and the mixed mode 498 General PWM Frequency kHz 18 0 4 4 Voltage Limits Ove
176. noise to be captured by the controller and cause erratic functioning that may lead to failure In such situation stop operation immediately Advanced Digital Motor Controllers User Manual 39 Connecting Sensors and Actuators to Input Outputs Robote Motor Encoder Polarity Matching When using encoders for closed loop speed or position control it is imperative that when the motor is turning in the forward direction the counter increments its value and a posi tive speed value is measured The counter value can be viewed using the PC utility If the Encoder counts backwards when the motor moves forward correct this by either 1 Swapping Channel A and Chamnel B on the encoder connector This will cause the encoder module to reverse the count direction or 2 Swapping the leads on the motor This will cause the motor to rotate in the opposite direction 40 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Input Command Modes and Priorities SECTION 3 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 e Pulse R C radio PWM Frequency e Analog signal O to 5V One two or all three command modes can be enabled at the same time When multiple modes are e
177. nput M cc P p1 p2 cc motor channel p1 p2 0 to 1000 power level Q P 1 R Pz800 For Sepex controllers this query will report the applied power on the Armature and Field excitation Report the value of each of the enabled pulse input captures The value is the raw number in microseconds Syntax Reply Where Allowed Range Notes PI cc PI n1 n2 n3 n4 nn ce Pulse capture channel number n1 nn value each channel O to 65000us The total number of Pulse input channels varies from one controller model to another and can be found in the product datasheet 106 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Runtime Queries S Encoder Speed RPM Reports the actual speed measured by the encoders as the actual RPM value Syntax S cc Reply S Ww w Where cc channel number vv speed in RPM Notes To report RPM accurately the correct Pulses per Revolution PPR must be stored in the encoder configuration SR Encoder Speed Relative Returns the measured motor speed as a ratio of the Max RPM configuration parameter see MRPM Max RPM Value on page 144 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 return value to this query will be 500 which is 5096 of the 3000 max Note that if the motor spins
178. nput pa p ru gt Feedback FIGURE 33 Pulse Input processing chain Except for the capture all other steps are identical to these described for the Analog cap ture mode See Min Max and Center adjustment on page 52 Deadband Selection on page 53 Exponent Factor Application on page 54 Use of Pulse Input After the pulse input has been fully processed it can be used as a motor command or if the controller is configured to operate in closed loop as a feedback value typically speed or position Each input can therefore be configured to be used as command or feedback for any motor channel s The mode and channel s to which the analog input applies are selected using the PC Configuration Utility Advanced Digital Motor Controllers User Manual 55 VO Configuration and Operation Robote Digital Outputs Configurations and Triggers The controller s digital outputs can individually be mapped to turn On or Off based on the status of user selectable internal status or events The table below lists the possible assignment for each available Digital Output Action Output activation Typical Use No action Not changed by any internal controller Output may be activated using events Serial commands or user scripts Motor s is on When selected motor channel s has Brake release power applied to it Motor s is When selected motor channel s has Back up warning indicator reversed power applied
179. ns This parameter is used to select the PID mode for that channel The controller supports two PID modes a flat PID where the PID parameters are the same across the speed range and a multilevel PID where different PID values can be set and will change dynami cally across the speed range Syntax Where APIDM cc nn PIDM cc nn 0 flat PID 1 multi range PID Aavanced Digital Motor Controllers User Manual 145 Serial RS232 USB Operation IRo boteQ Sepex Specific TABLE 23 Command Set Arguments Get Argument Description SXC CurvePoint Value Point Sepex Curve Points SXM MinimumCurrent none Minimum Field Current SXC Sepex Motor Excitation Table This parameter is used on Sepex controllers to generate the field excitation power based on the power level that is currently applied to the armature channel There are 5 values in this parameter for 0 25 50 75 and 100 When running depending on the power level that is applied on the armature the power level on the excitation will be inter polated from that table Syntax ASXC pp nn SXC pp Where pp point 1 to 5 in table nn power level in Allowed Range O to 100 Example ASXC 150 SXC 2 62 SXC 3 75 SXC 4 87 SXC 5 100 Loads table with 5096 6296 7596 8796 10096 SXM Sepex Minimum Excitation Current This parameter sets the minimum current that must be measured in the field output for the armatur
180. ns 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 bat tery minus terminal e 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 If motors are spinning because the robot is pushed or because of inertia they will act as generators and will turn the controller On possibly in an unsafe state ALWAYS ground the Power Control wire terminal to turn the controller Off and keep it Off Important Warning Unless you can ensure a steady voltage that is higher than 7V in all conditions it is recommended that the battery used to power the controller s electronics be separate from the one used to power the motors This is because it is very likely that the motor batteries will be subject to very large current loads which may cause the volt age to eventually dip below 7V as the batteries charge drops The separate backup power supply should be connected to the Power Control input This warning applies to all controllers except the SDCxxxx models Connecting the Motors Refer to the datasheet for information on how to wire the motor s to a particular motor controller model After connecting the motors apply a minimal amount of power using the Roborun PC util ity with the controller configu
181. nt vs Motor Current 2 cee ees Power Regeneration Considerations llle Using the Controller with a Power Supply eee eee ees Connecting Sensors and Actuators to Input Outputs Controller CONNECTIONS zx sam eae ak KAN SY eka EURO EUR RR Controller s Inputs and Outputs 6 eee Connecting devices to Digital Outputs leere Connecting Resistive Loads to Outputs 0 cee eee Connecting Inductive loads to OUtpUtS 6 eee Connecting Switches or Devices to Inputs shared with Outputs Connecting Switches or Devices to direct Digital Inputs Aavanced Digital Motor Controllers User Manual Robote SECTION 3 SECTION 4 Connecting a Voltage Source to Analog Inputs aa aaa 31 Connecting Potentiometers to Analog Inputs 2 0 20 cee eee 32 Connecting Potentiometers for Commands with Safety band guards 32 Connecting Tachometer to Analog Inputs 2 ee eee eee 33 Connecting External Thermistor to Analog Inputs 34 Using the Analog Inputs to Monitor External Voltages 35 Connecting Sensors to Pulse Inputs llle 36 Connecting to RC RadioS 0c cece eee nnn 36 Connecting to PWM Joysticks and Position Sensors 36 Connecting Optical Encoders lessen nnn 36 Optical Incremental Encoders Overview eee eee eee 36 Recommended Encoder Types 2 00 e cee eee eee e
182. ntroller If no errors are found during the translation the code is automatically transferred in the controller s flash memory Build button Clicking on this button will cause the source code to be immediately interpreted in low level instructions that are understandable by the controller A window then pops up show ing the result of the translation The code is not downloaded into the controller This com mand is generally not needed It may be used to see how many bytes will be taken by the script inside the controller s flash Advanced Digital Motor Controllers User Manual 195 Using the Roborun Configuration Utility Robote Simulation button Clicking on the Simulate button will cause the source code to be interpreted and run in simulation mode on the PC This function is useful for simplifying script development and debug The simulator will operate identically to the real controller except for all commands that normally read or write controller configuration and operation data For these com mands the simulated program will prompt the programmer for values to be entered manu ally or output data to the console Executing Scripts Scripts are not automatically executed after the transfer To execute manually you must click on the Run tab and send the r command via the console Unless a script includes print statements it will run silently with no visible signs Clicking on r O will stop a script Ir or r 1
183. ntrollers User Manual Version 1 2 January 8 2011 lIRoboteQ Maintenance Commands Example EERST 321654987 EESAV Save Configuration in EEPROM Controller configuration that have been changed using any Configuration Command can then be saved in EEPROM Once in EEPROM it will be loaded automatically in the control ler every time the unit is powered on If the EESAV command is not called after changing a configuration the configuration will remain in RAM and active only until the controller is turned off When powered on again the previous configuration that was in the EEPROM is loaded This command uses no parameters Syntax EESAV Notes Do not save configuration while motors are running Saving to EEPROM takes several milliseconds during which the control loop is suspended LK Lock Configuration Access This command is followed by a userselected 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 Syntax LK secretkey Where secretkey 32 bit number 1 to 4294967296 Examples LK 12345 LK 2343567345 Notes The controller must be unlocked for this command to work The O value is reserved as the unlocked key RESET Reset Controller This command will cause the c
184. o at which a short circuit is detected Since the controller can handle very large current during its normal operation Only direct short circuits between wires will cause sufficiently high current for the detection to work Short circuits inside motors or over long wires my go undetected Mixing Mode Select Mixed mode is available as a configuration option in dual channel controllers to create tank like steering when one motor is used on each side of the robot Channel 1 is used for mov ing the robot in the forward or reverse direction Channel 2 is used for steering and will change the balance of power on each side to cause the robot to turn Figure 36 below illus trates how the mixed mode motor arrangement Advanced Digital Motor Controllers User Manual Robote Motor Operating Features and Options Motor 1 Controller Motor 2 FIGURE 36 Effect of commands to motor examples in mixed mode 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 8 Mixing Mode characteristics Input Mode 1 Mode 2 Mode 3 Throttle Steering M1 M2 M1 M2 M1 M2 0 0 0 0 0 0 0 0 0 300 300 300 300 300 300 300 0 600 600 600 600 600 600 600 0 1000 1000 1000 1000 1000 1000 1000 0 300 300 300 300 300 300
185. o be used in order to determine the zero position 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 detec tion is triggered The motor will then stop until the error disappears the controller is set to Open Loop or the controller is reset Determining the right polarity is best done experimentally using the Roborun utility see Using the Roborun Configuration Utility on page 177 and following these steps 1 Loosen the sensor s axle from the motor assembly 2 Configure the position sensor input channel as position feedback for the desired motor channel 3 Click on the Run tab Verify that the analog and pulse values change as you rotate the sensor Turn the sensor until the 0 value is reached 4 Set the and D gain of the PID to O 5 Configure the controller in Position Mode using the PC utility 6 From the Run tab with a hand ready to disconnect the Motor Power cable SLOWLY move the sensor off the center position and observe the motor s direction of rotation 7 f the motor turns in the direction in which the sensor was moved the polarity is cor rect The sensor axle may be tighten to the motor assembly 8 Ifthe motor turns in the direction away from the sensor then the polarity is reversed The wire polarity on the motor should be exchanged If using a potentiometer as sen sor
186. o statement GoTo Target_Label Print This will not be printed n Target_Label Print This will be printed n GoSub Return Statements GoSub used to call a subroutine at specific label Program execution is transferred to the specified label Unlike the GoTo statement GoSub remembers the calling point Upon encountering a Return statement the execution will continue the next statement after the GoSub statement GoSub lt label gt Return Consider the following example Print The first line GoSub PrintLine Print The second line GoSub PrintLine Terminate PrintLine Print Mn Return The program will begin with executing the first print statement Upon encountering the GoSub statement the execution will be transferred to the given PrintLine label The pro gram prints the new line and upon encountering the Return statement the execution will be returning back to the second print statement and so on 164 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 I Ro boteQ Introduction ToBool Statement Converts the given expression into boolean value It will be return False if expression evaluates to zero True otherwise ToBool expression 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 expre
187. on eee eee ees 141 ICAP Integral Cap sias x E RR ER REFERRE Ome EG 141 KD Flat Differential Gain Inh 142 KI Flat Integral Gain ee nne 142 KP Flat Proportional Gain 2 eee ees 142 MAC Motor Acceleration Rate 2 cece eee eee 143 MDEC Motor Deceleration Rate esee 143 MMOD Operating Mode 1 cece ee ees 143 Aavanced Digital Motor Controllers User Manual Robote MVEL Default Position Velocity aa 144 MXPF Motor Max Power Forward 0000 eee eee eee eee 144 MXPR Motor Max Power ReVerse 00 llle eene 144 MRPM Max RPM Value eeeeeer RR Rh nn 144 MXTRN Turns between Limits aan 145 PIDM PID ModS 2x 5 2 2m enne oe cannes nete ERE E 145 S e esnsu tc ELS 146 SXC Sepex Motor Excitation Table lel 146 SXM Sepex Minimum Excitation Current llle 146 SECTION 10 MIGrOBAaSIG S ChIPtING xui he xd onte ac wg Seer maaga Ng 147 Script Structure and Possibilities 00 147 Source Program and Bytecodes eese 148 Variables Types and Storage lees 148 Variable content after Reset eee eee 148 Controller Hardware Read and Write Functions 148 Timers and Walt sisi hate p eR ex Rey x Ma ac Ra ne ee nuns 149 Execution Time Slot and Execution Speed llss 149 Prot ctioris cerr elucet ew UR RACER E HG ATE E ee E 149 Print Command Restrictions
188. on InputNbr Digital Output Action Advanced Digital Motor Controllers User Manual 173 MicroBasic Scripting Robote TABLE 26 Command Set Arguments Get Argument Description Analog Inputs _ACTR nputNbr Center InputNbr Analog Center _ADB nputNbr Deadband InputNbr Analog Deadband _AINA InputNbr Action InputNbr Analog Input Actions _ALIN nputNbr Linearity InputNbr Analog Linearity _AMAX nputNbr Max InputNbr Analog Max _AMAXA nputNbr Action InputNbr Action on Analog Input Max _AMIN nputNbr Min InputNbr Analog Min _AMINA nputNbr Action InputNbr Action on Analog Input Min _AMOD nputNbr Mode InputNbr Analog Input Mode _APOL InputNbr Polarity InputNbr Analog Input Polarity Pulse Inputs _PCTR InputNbr Center InputNbr Pulse Center _PDB InputNbr Deadband InputNbr Pulse Deadband _PINA InputNbr Action InputNbr Pulse Input Actions _PLIN InputNbr Linearity InputNbr Pulse Linearity _PMAX InputNbr Max InputNbr Pulse Max _PMAXA InputNbr Action InputNbr Action on Pulse Input Max _PMIN InputNbr Min InputNbr Pulse Min _PMINA InputNbr Action InputNbr Action on Pulse Input Min _PMOD InputNbr Mode InputNbr Pulse Input Mode PPOL InputNbr Polarity InputNbr Pulse Input Polarity Motor _ALIM Channel AmpLimit Channel Motor Amps Limit _ATGA Channel AmpTrigger Channel Amps Trigg
189. onds is the number of milliseconds to count SetTimerState GetTimerState These two functions used to set get timer state started or stopped SetTimerState index lt state gt GetTimerState lt index gt Where index is the timer index 1 4 and state is the timer state 1 means timer reached O and or stopped O means timer is running 176 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 IRo b oteQ System Requirements SECTION 11 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 193 System Requirements To run the utility the following is needed e PC compatible computer running Windows 98 ME 2000 XP Vista or Windows7 AUSB connector for controllers with USB connectivity e An unused serial communication port on the computer with a 9 pin female connec tor for controllers using RS232 communication An Internet connection for downloading the latest version of the Roborun Utility or the Controller s Software 5 Megabytes of free disk space If the PC is not equipped with an RS232 serial port one may be added using a USB to RS232 convert
190. onfigured to operate in closed loop as a feedback value typically speed or position Each input can therefore be configured to be used as command or feedback for any motor channel s The mode and channel s to which the analog input applies are selected using the PC Configuration Utility Pulse Inputs Configurations and Uses The controller s Pulse Inputs can be used to capture pulsing signals of different types TABLE 7 Analog Capture Modes Catpure Mode Description Typical use Disabled Pulse capture is ignored forced to 0 Pulse Measures the On time of the pulse RC Radio 54 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Pulse Inputs Configurations and Uses TABLE 7 Analog Capture Modes Catpure Mode Description Typical use O eee a MELIA DUAGALSUZL G GLUUI LUUS UIUUILLLLLULLULKXLUPUU ZOLLLILSAXIC ULLLULLLL LKALK L CLULLL BLGULZC LIZ OA AIALL LILRG I GOU Duty Cycle Measures the On time relative to the Hall position sensors and joysticks with full On Off period pulse output Frequency Measures the repeating frequency of Encoder wheel pulse The capture mode can be selected using the PC Configuration Utility The captured signals are then adjusted and can be used as command or feedback accord ing to the processing chain described in the diagram below Capture Min Max Center Deadband Exponent Use n Select Pulse i gt Command I
191. ontrol ler s User Manual See Serial RS232 USB Operation on page 87 170 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Introduction GetValue OperatingItem Index Current2 GetValue BATAMPS 2 Read Battery Amps for Motor 2 Sensor GetValue _ANAIN 6 Read voltage present at Analog Input 1 Counter GetValue _BLCOUNTI Read Brushless counter TABLE 24 Command Short Arguments Description _ABCNTR _C Channel Read Absolute Encoder Count _ABSPEED S Channel Read Encoder Motor Speed in RPM _ANAIN _Al InputNbr Read Analog Inputs _BATAMPS _BA InputNbr Read Battery Amps _BLCNTR _CB none Read Absolute Brushless Counter _BLRCNTR _CBR none Read Brushless Count Relative _BLRSPEED _BSR none Read BL Motor Speed as 1 1000 of Max _BLSPEED _BS none Read BL Motor Speed in RPM CMDANA _CIA Channel Read Internal Analog Command CMDPLS _CIP Channel Read Internal Pulse Command CMDSER _CIS Channel Read Internal Serial Command _DIGIN _D InputNbr Read All Digital Inputs _DIGOUT _DO none Read Current Digital Outputs _DIN _DI InputNbr Read Individual Digital Inputs FEEDBK F none Read Feedback _FLTFLAG ABE none Read Fault Flags LOCKED _LK none Read Lock status _LPERR E none Read Closed Loop Error _MOTAMPS _A InputNbr Read Motor Amps _MOTCMD _M Channel Read Actual Motor Command _MOTPWR _P Channel Read A
192. ontroller will read the following values according to the temperature For best precision the analog input must be configured to read in Relative Mode Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Using the Analog Inputs to Monitor External Voltages The analog input must be configured so that the minimum range voltage matches the desired temperature and that an action be triggered when that limit is reached For exam ple 500mV for 800C according to the table The action can be any of the actions in the list An emergency or safety stop i e stop power until operator moves command to 0 would be a typical action to trigger Volts 4 5 4 3 5 3 2 5 2 i7 1 5 1 0 5 0S SSS SSS e a e e A SD OD FO HAD PH DO d Q OX HM HD O O BP BN SPH PP 050g 9 5 4 9 oC FIGURE 16 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 It is recommended that you ver ify and calibrate your circuit if it is to be used for safety protection Using the Analog Inputs to Monitor External Voltages The analog inputs may also be used to monitor the battery level or any other DC voltage If the voltage to measure is up to 5V the voltage can be brought directly to the input pin To measure higher voltage inse
193. ontroller to reset similarly as if it was powered OFF and ON This command must be used with care and must be followed by a 9 digit safety key to pre vent accidental reset Syntax RESET safetykey Where safetykey 321654987 Example RESET 321654987 STIME Set Time This command sets the time inside the controller s clock inside H Type controller The clock inside the controller will then keep track of time as long as the controller remains under power If the controller is disconnected time will keep running for several minutes To keep track of time indefinitely keep the controller attached to the battery at all times and switch it off using the power control wire In this case the controller draws no current but still has enough voltage present to keep the clock running Advanced Digital Motor Controllers User Manual 113 Serial RS232 USB operation l lRoboteQ Syntax STIME hh mm ss Where hh hours mm minutes ss seconds Examples STIME 0 35 12 STIME 0 1 0 UK Unlock Configuration Access This command will release the lock and make the configuration readable again The com mand must be followed by the secret key which will be matched by the controller internally against the key that was entered with the LK command to lock the controller If the keys match the configuration is unlocked Syntax IUK secretkey Where secretkey 32 bit number 1 to 4294967296 Examples UK 12345 UK 2343567345
194. ontrollers reports the actual speed measured using the motor s Hall sensors as the actual RPM value Syntax BS Reply BS nn Where nn speed in RPM Notes To report RPM accurately the correct number of motor poles must be loaded in the BLPOL configuration parameter BSR Read BL Motor Speed as 1 1000 of Max One brushless motor controllers returns the measured motor speed as a ratio of the Max RPM configuration parameter See MRPM Max RPM Value on page 144 The result is a value of between 0 and 1000 Note that if the motor spins faster than the Max RPM the return value here will exceed 1000 However a larger value is ignored by the controller for its internal operation Syntax BSR Reply BSR nn Where nn speed relative to max Notes To report an accurate result the correct number of motor poles must be loaded in the BLPOL configuration parameter 100 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Runtime Queries C Encoder Counter Absolute Returns the encoder value as an absolute number The counter is a 32bit counter with a range of 2000000000 counts Syntax C cc Reply C nn nn Where cc channel number nn absolute counter value CB Absolute Brushless Counter One brushless motor controllers returns the running total of Hall sensor transition value as an absolute number The counter is a 32bit counter with a range of
195. ops the 4 timers If the controller is connected to a microcomputer it is best to have the microcomputer start script execution by sending the r command via the serial port or USB Scripts can be launched automatically after controller power up or after reset by setting the Auto Script configuration to Enable in the controller configuration memory When enabled if a script is detected in Flash memory after reset script execution will be enabled and the script will run as when the r command is manually entered Once running scripts can be paused and resumed using the commands above Important Warning Prior to set a script to run automatically at start up make sure that your script will not include errors that can make the controller processor crash Once set to auto matically start a script will always start running shortly after power up If a script contains code that causes system crash the controller will never reach a state where it will be possible to communicate with it to stop the script and or load a new one If this ever happens the only possible recovery is to connect the controller to a PC via the serial port and run a terminal emulation software Immediately after receiving the Firmware ID type and send r 0 to stop the script before it is actually launched Alternatively you may reload the controller s firmware Advanced Digital Motor Controllers User Manual 151 MicroBasic Scripting Robote Script
196. or 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 Reports the raw value in mV of each of the analog inputs that are enabled Input that is dis abled will report O Syntax Reply Where Allowed Range Notes Al cc Alzn1 n2 n3 n4 nn ce Analog Input number n1 nn millivolt for each channel 0 to 5000MV The total number of Analog input channels varies from one controller model to another and can be found in the product datasheet Advanced Digital Motor Controllers User Manual 99 Serial RS232 USB Operation IRo boteQ BA Battery Amps Measures and reports the Amps flowing from the battery Battery Amps are often lower than motor Amps Syntax BA cc Reply BA a1 a2 Where cc motor channel a1 a2 Amps 10 for each channel Examples O BA R BA 100 200 Notes Single channel controllers will report a single value Sepex controllers report a single value with the battery current for both the Armature and Field excitation Some power board units measure the Motor Amps and Calculate the Battery Amps while other models measure the Battery Amps and calcu late 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 BS Read BL Motor Speed in RPM One brushless motor c
197. or Controllers User Manual 125 Serial RS232 USB Operation IRo boteQ Pulse Input Configuration These configuration commands are used to define the operating mode for the pulse inputs TABLE 18 Pulse Input Configuration Command Set Arguments Get Argument Description PCTR InputNbr Center InputNbr Pulse Center PDB InputNbr Deadband InputNbr Pulse Deadband PINA InputNbr Action InputNbr Pulse Input Actions PLIN InputNbr Linearity InputNbr Pulse Linearity PMAX InputNbr Max InputNbr Pulse Max PMAXA InputNbr Action InputNbr Action on Pulse Input Max PMIN InputNbr Min InputNbr Pulse Min PMINA InputNbr Action InputNbr Action on Pulse Input Min PMOD InputNbr Mode InputNbr Pulse Input Mode PPOL InputNbr Polarity InputNbr Pulse Input Polarity PCTR Pulse Center Range 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 Syntax PCTR cc nn PCTR cc Where nn 0 to 65000us Default Value 1500us PDB Pulse Input Deadband This sets the deadband value for the pulse capture It is defined as the percent number from 0 to 5096 and defines the amount of movement from joystick or sensor around the center position before its converted value begins to change Syntax PDB cc nn PDB cc Where cc Pulse channel
198. or interacting with the timers SetTimerCount Set number of milliseconds for timer to count SetTimerState Set state of a specific timer GetTimerCount Read timer count GetTimerState Read state of a specific timer Option Compilation Options Micro Basic by default treats undeclared identifiers as integer variables If you want the compilers checks that every variable used in the program is declared and generate compila tion error if a variable is not previously declared you may use Option explicit compiler option by pacing the following at the beginning of the program Option Explicit Dim Variable Declaration 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 Dim var As Integer Boolean The following example illustrates how to declare Integer variable Dim intVar As Integer Advanced Digital Motor Controllers User Manual 159 MicroBasic Scripting Robote 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 Dim arr n As Integer Boolean The following example illustrates how to declare array of 10 integers Dim arr 10 As Integer To access array elements get set you may need to ta
199. ositive black is negative or ground Controllers with tabs screw terminals or copper bars have their connector identified in print on the controller Advanced Digital Motor Controllers User Manual 15 Connecting Power and Motors to the Controller Robote Controller Power The controller uses a flexible power supply scheme that is best described in Figure 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 A diode circuit that is included in most controller models is designed to automatically select one power source over the other and lets through the source that has the highest voltage Mot1 Mot1 VBatt Vmot Channel 1 MOSFET Power Stage GND Power Control Microcomputer amp amp Backup MOSFET Drivers GND GND VBatt Vmot Channel 2 MOSFET Power Stage Mot2 Mot2 not included in SDCxxxx controllers not included in high voltage models FIGURE 1 Representation of the controller s Internal Power Circuits When powered via the Power Control input only the controller will turn On but motors will not be able to turn until power is also present on the VMot wires or Tab The Power Control input also serves as the Enable signal for the DC DC converter
200. ounter Low Limit BLLA BLLoLimAction none BL Counter Low Limit Action BLSTD StallDetection none BL Stall Detection BPOL NumberOfPoles none Number of Poles of BL Motor BHL Brushless Counter High Limit This parameter allows you to define a minimum brushless count value at which the control ler will trigger an action when the counter rises 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 Low Limit Count is the desired position when a command of 1000 is received Syntax ABHL nn BHL Where nn Counter value Default Value 2000 Example ABHL 10000 Set brushless counter high limit BHLA Brushless Counter High Limit Action This parameter lets you select what kind of action should be taken when the upper bound ary of the brushless counter is reached The list of action is the same as in the DINA digital input action list See DINA Digital Input Action on page 120 Syntax ABHLA nn BHLA cc Where aa DIN Action List Default Value 0 no action BHOME Brushless Counter Load at Home Position 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
201. ple ADOA 1 33 DOL Digital Outputs Active Level This parameter configures whether an output should be set to ON or to OFF when it is trig gered Syntax ADOL bb DOL Where bb L1 L2 2 L3 4 L4 8 L5 16 L6 32 and where Ln 0 input is active high 1 input is active low Advanced Digital Motor Controllers User Manual 121 Serial RS232 USB Operation IRo boteQ Default Value 0 All outputs active high Example ADOL 9 All outputs switch on when activated except outputs 1 and 4 which switch off when activated l e 9 1 ouput1 8 output4 Analog input Configurations This section covers the various configuration parameter applying to the analog inputs TABLE 17 Analog Input Configurations Command Set Arguments Get Argument Description ACTR InputNbr Center InputNbr Analog Center ADB InputNbr Deadband InputNbr Analog Deadband AINA InputNbr Action InputNbr Analog Input Actions ALIN InputNbr Linearity InputNbr Analog Linearity AMAX InputNbr Max InputNbr Analog Max AMAXA InputNbr Action InputNbr Action on Analog Input Max AMIN InputNbr Min InputNbr Analog Min AMINA InputNbr Action InputNbr Action on Analog Input Min AMOD InputNbr Mode InputNbr Analog Input Mode APOL InputNbr Polarity InputNbr Analog Input Polarity ACTR Set Analog Input Center 0 Level This parameter is the measured voltage on input that will b
202. pplied Power Level _PLSIN PI InputNbr Read Pulse Inputs _RELCNTR _CR Channel Read Encoder Count Relative _RELSPEED _SR Channel Read Encoder Motor Speed as 1 1000 of Max _STFLAG _FS none Read Status Flags _TEMP T SensorNumber Read Case amp Internal Temperatures TIME TM Channel Read Time _VAR _VAR none Read User Variable _VOLTS M SensorNumber Read Internal Voltages Advanced Digital Motor Controllers User Manual 171 MicroBasic Scripting Robote SetCommand This function is used to send operating commands to the controller at runtime The func tion requires a Command Item an optional Index and a Value as parameters The Com mand Item can be any one from the table below Details on the various commands their effects and acceptable ranges can be found in the Controller s User Manual See Serial RS232 USB Operation on page 87 SetCommand CommandItem Value SetCommand GO 1 500 Set Motor 1 command level at 500 SetCommand DSET 2 Activate Digital Output 2 TABLE 25 Command Short Arguments Description _ACCEL _AC Channel Acceleration Set Acceleration _DECEL _DC Channel Deceleration Set Deceleration _DOUT _DS Value Set all Digital Out bits _DRES _DO BitNumber Reset Individual Digital Out bits _DSET _D1 BitNumber Set Individual Digital Out bits _ESTOP _EX None Emergency Shutdown _GO _G Channel Command Set Motor Command HOME ZH Channel Load Home
203. precision as when working with decimals The language does not support String variables and does not have string manipulation functions Basic string support is provided for the Print command Variable content after Reset All integer variables are reset to O and all Boolean variables are reset to False after the con troller is powered up or reset When using a variable for the first time in a script its value can be considered as 0 without the need to initialize it Integer and Boolean variables are also reset whenever a new script is loaded When pausing and resuming a script all variables keep the values they had at the time the script was paused Controller Hardware Read and Write Functions The MicroBasic scripting language includes special functions for reading and writing con figuration parameters Most configuration parameters that can be read and changed using the Configuration Tab in the Roborun PC utility or using the Configuration serial commands can be read and changed from within a script The GetConfig and SetConfig functions are used for this purpose The GetValue function is available for reading real time operating parameters such as Ana log Digital input status Amps Speed or Temperature 148 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Script Structure and Possibilities The SetCommand function is used to send motor commands or to activate the Digital Out puts
204. put actions see DINA Digital Input Action on page 120 Embedded in the parameter is the motor channel s to which the action should apply Syntax APMINA cc aa mm PMINA cc Where ce Input channel number aa DIN Action List mm mot1 16 mot2 32 Default Value No action on all channels PMOD Pulse Mode Select This parameter is used to enable disable the pulse input and select its operating mode which can be pulse with measurement frequency or duty cycle Inputs can be measured with a high precision over a large range of time or frequency An input will be processed and converted to a command or a feedback value in the range of 1000 to 1000 for use by the controller internally Syntax APMOD cc nn PMOD cc 128 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Encoder Operations Where nn 0 Disabled 1 Pulse width 2 Frequency 3 Period PPOL Pulse Input Polarity Inverts the pulse capture polarity Syntax PPOL cc nn PPOL Where ce pulse channel number nn 0 not inverted 1 inverted Encoder Operations The following parameters are used to configure encoder and functions that are enabled by the encoders TABLE 19 Encoder Operation Command Set Arguments po Description EHL Channel EncHighLimit Channe Encoder High Limit EHLA Channel EncHiLimAction Channe Encoder High L
205. px cee Rm RR RR ce EE ENE A eet 115 Reading Configurations ellc Re RR RR YR E RR 115 Configuration Read Protection llle 116 Command Inputs Configuration and Safety 116 ACS Analog Center Safety aaa 117 AMS Analog within Min amp Max Safety 0 0 cece eee ee 117 BRUN MicroBasic Auto Start 2 cee eee es 117 CLIN Command Eineartty usce NG See ea PINAG Hd 117 CPRI Command Priorities 2 0 0 llle 118 DFC Default Command value 1 cece ees 118 ECHOF Enable Disable Serial Echo eee eee ee 119 RWD Serial Data Watchdog cee ees 119 TELS Telemetry SINING essa rinn nroa N ABAKA sidwws ARA NAKAYANAN 119 Digital Input Output Configurations eee 120 DINA Digital Input Action eee 120 DINL Digital Input Active Levels cee eee ee eee 121 DOA Digital Output Trigger ees 121 DOL Digital Outputs Active Level aaa 121 Analog Input Configurations 0 0 0 cece eee ees 122 ACTR Set Analog Input Center 0 Level cee ee eee 122 ADB Analog Deadband 222222 aaa eee 122 AINA Analog Input Usage 2 cee eee 123 ALIN Analog Linearity cee ee 123 AMAX Set Analog Input Max Range eee eee eee eee 124 AMAXA Action at Analog Max 2 cece cece eee eee 124 AMIN Set Analog Input Min Range cece eee eee 124 AMINA Action at Analog Min eee eee 124 AMOD Enable a
206. r 1 0000 eee e eee eee 132 KIC2 Integral Gains Table for Motor 2 000 cece eee eee eee 132 KPC1 Proportional Gains Table for Motor 1 eese 132 KPC2 Proportional Gains Table for Motor 2 cee eee 133 Brushless Specific Commands ss sss ER a YR RR KA 134 BHL Brushless Counter High Limit 134 BHLA Brushless Counter High Limit Action aa 134 BHOME Brushless Counter Load at Home Position 134 BLFB Encoder or Hall Sensor Feedback lees 135 BLL Brushless Counter Low Limit celles 135 BLLA Brushless Counter Low Limit Action cele 135 BLSTD Brushless Stall Detection llle 136 BPOL Number of Poles of Brushless Motor lees 136 General Power Stage Configuration Commands 137 CAD Controller Address esee nnn 137 OVL Overvoltage Limit 2 4 sciiicet e exc mx rr ee es 137 UVL Undervoltage Limit llle 138 THLD Short Circuit Detection Threshold lees 138 MXMD Separate or Mixed Mode Select a 138 PWMF PWM Frequency IR nh 139 Motor Channel Configuration and Set Points 139 ALIM SSArmp LIPnit cu aca hc c REA RC E RC C RE I ce tcs 140 ATGA Amps Trigger Action a 140 ATGD Amps Trigger Delay llle 140 ATRIG Amps Trigger Level llle 141 CLERD Closed Loop Error Detecti
207. r Control Modes For each motor the controller supports multiple motion control modes The controller s fac tory default mode is Open Loop Speed control for each motor The mode can be changed using the Roborun PC utility Open Loop Speed Control In this mode the controller delivers an amount of power proportional to the command information The actual motor speed is not measured Therefore the motor will slow down if there is a change in load as when encountering an obstacle and change in slope This mode is adequate for most applications where the operator maintains a visual contact with the robot Closed Loop Speed Control In this mode illustrated in Figure 38 optical encoder typical or an analog tachometer is used to measure the actual motor speed If the soeed changes because of changes in load the controller automatically compensates the power output This mode is preferred in pre cision motor control and autonomous robotic applications Details on how to wire the tachometer can be found in Connecting Tachometer to Analog Inputs on page 33 Closed Loop Speed control operation is described in Closed Loop Speed Mode on page 73 On Brushless motors speed may be sensed directly from the motor s Hall Sen sors and closed loop operation is possible without additional hardware 64 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 IRoboteQ Selecting the Motor Control Modes FIGURE 37
208. r Voltage Limit V 45 0 Under Voltage Limit V 5 0 Short Circuit Protection Quick Mixing Separate FIGURE 70 General Power Stage configuration parameters Advanced Digital Motor Controllers User Manual 187 Using the Roborun Configuration Utility Robote The parameters for each motor are typically duplicated so that they can be set separately for each motor Expanding the node shows that we can set the Amps limit that the control ler will actively control the power output in order to not exceed it An Amps trigger value which if reached for a preset amount of time will trigger a user selectable Action This feature can be used in order to implement stall protection or cur rent based limit switches The Power Adjust sets the maximum power that will be applied to the output at 10096 The maximum power can be different for the forward and reverse directions This feature can be used to limit the maximum speed in a given direction or to enable lower voltage motors to be used with the higher voltage battery The Acceleration parameter lets you set the Acceleration and Deceleration values In this tree also can be set the Operating Mode for that channel Open Loop Closed Loop Speed or Closed Loop Position 4 Motor Output 4 JB Amps Limits Amps Limit A 75 0 Amps Trigger A 75 0 Amps Trigger Action No Action 4 Power Adjust Max Power Fwd 100 Max Power Rev 100 4 3f Acceleration Acceleration ms 5
209. r channel nn 1 open loop speed 2 closed loop speed 3 closed loop position Default Value All motors in open loop speed mode Examples AMMOD 2 Advanced Digital Motor Controllers User Manual 143 Serial RS232 USB Operation IRo boteQ MVEL Default Position Velocity This parameter is the default speed at which the motor moves while in position mode Val ues are in RPMs To change velocity while the controller is in operation use the S runtime command Syntax MVEL cc nn MVEL cc Where cc Motor Channel May be omitted in single channel controllers nn Velocity value in RPM MXPF Motor Max Power Forward This parameter lets you select the scaling factor for the power output in the forward direc tion 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 5096 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 Syntax AMIXPF cc nn MXPF cc Where cc Motor channel nn power scaling Allowed Range 25 to 100 Default Value 10096 Example MXPF 2 50 Scale output power by 50 MXPR Motor Max Power Reverse This parameter is the same as the MXPF Motor Max Power Forward but applied when the motor is moving in the reverse direction Syntax MXPR cc nn MXPR cc Where cc Motor
210. r functionality and this of a PLC or Single Board Computer directly into the controller The scripting tab is used to write simulate and download custom scripts to the controller j R Roborun Work Offline View Pinout Control Unt H Type Controller Model Motor Control Utility Rev 1 1 5 22 10 lRobote D u dd amp 3a Console Scripting o X Build gt Simulate By Download To Device Hj Error List F AST Dim Initialized as Boolean Dim LEDState 6 as Integer top if Initialized then setcommand DOUT LEDState Count if Count 6 then Count 0 else LEDState 0 LEDState 1 LEDState 2 LEDState 3 LEDState 4 LEDState 5 end if ow won non MO P oO wait 10 goto top Found COMI COM2 FIGURE 79 Scripting tab COM2 is Open Firmware ID Roboteq v1 1 RCB500 05 24 2010 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 vary basic text editing features needed to write source code More information on the scripting language and its capabili ties can be found in the MicroBasic Language Reference on page 155 Download to Device button Clicking on this button will cause the source code to be immediately interpreted in low level instructions that are understandable by the co
211. r its operand var var 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 ta 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 The decrement operator can appear before or after its operand Via Vai The first form is a prefix decrement operation The result of the operation is the value of the operand after it has been decremented The second form is a postfix decrement operation The result of the operation is the value of the operand before it has been decremented a 10 Print a n Print a Xn Print a n Print a n Advanced Digital Motor Controllers User Manual 167 MicroBasic Scripting Robote The output of previous program will be the following 0 Co OO work Operator The left shift operator shifts its first operand left by the number of bits specified by its second operand expression expression The high order bits of left operand are discarded and the low order empty bits are zero filled Shift operations never cause overflows gt gt Operator
212. r sections in this man ual are applicable In addition the Hall sensors provide extra information about the motor s state compared to DC motors This information enables the additional features discussed below Stall Detection The Hall sensors can be used to detect whether the motor is spinning or not The control ler includes a safety feature that will stop the motor power if no rotation is detected while a given amount of power is applied for a certain time Three combinations of power and time are available e 250ms at 10 power 500ms at 25 power e 1s at 50 power If the power applied is higher than the selected value and no motion is detected for the corresponding amount of time the power to the motor is cut until the motor command is returned to O This function is controlled by the BLSTD Brushless Stall Detection parame ter see BLSTD Brushless Stall Detection on page 136 Do not disable the stall pro tection A stall condition is indicated with the Stall LED on the Roborun PC utility screen Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Brushless Motor Operation Speed Measurement using Hall Sensors The Hall sensor information is used by the controller to compute the motor s rotation speed Speed is determined by measuring the time between Hall sensor transitions This measurement method is very accurate but requires that the motor be well constructed and that
213. red in Open Loop speed mode Verify that the motor spins in the desired direction Immediately stop and swap the motor wires if not In Closed Loop Speed or Position mode beware that the motor polarity must match this of the feedback If it does not the motors will runaway with no possibility to stop other than switching Off the power The polarity of the Motor or of the feedback device may need to be changed Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Single Channel Operation Important Warning Make sure that your motors have their wires isolated from the motor casing Some motors particularly automotive parts use only one wire with the other connected to the motor s frame If you are using this type of motor make sure that it is mounted on isolators and that its casing will not cause a short circuit with other motors and circuits which may also be inadvertently connected to the same metal chassis 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 figure below 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 Without this synchronization the current will flow from one channel to the other and cause the destruc tion of t
214. ross the fuse and the switch SW2 Connect Case to Earth if connecting AC equipment note 5 If building a system which uses rechargeable batteries it must be assumed that periodi cally a user will connect an AC battery charger to the system Being connected to the AC main the charger may accidentally bring AC high voltage to the system s chassis and to the controller s enclosure Similar danger exists when the controller is powered via a power supply connected to the mains Advanced Digital Motor Controllers User Manual 19 Connecting Power and Motors to the Controller Robote The controllers are supplied with an Earth tab which permits earthing the metal case Con nect this tab to a wire connected to the Earth while the charger is plugged in the AC main or if the controller is powered by an AC power supply or is being repaired using any other AC equipment PC Voltmeter etc Avoid Ground loops when connecting O devices note 6 When connecting a PC encoder switch or actuators on the I O connector be very careful that you do not create a path from the ground pins on the O connector and the battery minus terminal Should the controller s main Ground wires thick black be disconnected while the VMot wires thick red are connected high current would flow from the ground pins potentially causing serious damage to the controller and or your external devices e Do not connect a wire between the I O connector ground pi
215. rt two resistors wired as voltage divider The figure shows a 10x divider capable of measuring voltages up to 50V Ext Voltage IN 5V Internal Resistors and Converter 47kOhm i 20kOhm 4 7kOhm 33kOhm Ground FIGURE 17 Battery voltage monitoring circuit Advanced Digital Motor Controllers User Manual 35 Connecting Sensors and Actuators to Input Outputs Robote 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 Connecting to RC Radios The pulse inputs are designed to allow direct connection to an RC radio without additional components Optional Power to Radio oy Out Controller Power R C Radio l R C Channel 2 5 T R C Radio Ground Controller Ground FIGURE 18 RC Radio powered by controller electrical diagram Connecting to PWM Joysticks and Position Sensors The controller s pulse inputs can also be used to connect to sensors with PWM outputs These sensors provide excellent noise immunity and precision When using PWM sensors configure the pulse input in Duty Cycle mode Beware that the sensor should always be pulsing and never output a steady DC voltage at its ends The absence of pulses is consid ered by the controller as a loss of signal See also Using Sensors with PWM
216. s 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 Commands arriving via the UART are replied on the UART Redirection symbol for redirecting outputs to the other port exists e g a command can be made to respond on USB even though it arrived on RS232 Commands issued from MicroBasic scripts When sending a Motor or Digital Output command from a MicroBasic script it will be interpreted by the controller the same way as a serial command RS232 or USB 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 Important Warning When running a script that sends motor command make sure you click Mute in the PC utility Otherwise the PC will be sending motor commands continuously and these will interfere with the script commands Script commands are also subject to the serial Watchdog timer and share the same priority level as Serial commands Use the Command Priorities on page
217. s Robote Global Power Configuration Parameters PWM Frequency The power MOSFETs are switched at 18kHz by default This frequency can set to another value ranging from 10 kHz to 32 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 results in no visible change in the motor operation and should be left untouched Overvoltage Protection The controller includes a battery voltage monitoring circuit that will cause the output tran sistors to be turned Off if the main battery voltage rises above a preset Over Voltage threshold The value of that threshold is set by default and may be adjusted by the user The default value and settable range is given in the controller model datasheet This protection is designed to prevent the voltage created by the motors during regenera tion to be amplified to unsafe levels by the switching circuit The controller will resume normal operation when the measured voltage drops below the Over Voltage threshold The controller can also be configured to trigger one of its Digital Outputs when an Over Voltage condition is detected This Output can then be used to activate a Shunt load across the VMot and Ground wires to absorb the excess energy if it is caused by regeneration This protection is particularly recommended for situation where the
218. s been detected Control Unit Identifies the processing unit used it the controller Controller Model Identifies the complete model number reference 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 DIN1 AIN2 or a user defined label e g Limit1 eStop User definition of label names for I O pins is done in the Configuration tab EdH Type Pinout S15 xi oes 15 16 17 18 19 20 21 22 23 24 Digital In DINI pine DIN4 DIN12 DIN14 DIN16 DINS oie DING DIN10 Pulse In RCI Rez 4 AnaIn ANAL ANAZ ANA4 ANAS ANA6 ANA ANAL Digital Out Encoder Enc2B EnciB Q9 9 69 65 69 9 69 65 69 65 62 Q sou 609060000096 06 oo Pin Te 3 4 6 7 8 10 11 12 Digital In DIN3 DIN DIN15 DIN17 DIN DIN9 DIN11 Pulse In C3 Ana In ANA ET ANAS ANA Digital Out pour bour pours Encoder Enc2A EnclA Com TxData RxData FIGURE 54 Pinout View pop up window Clicking in the Work Offline checkbox allows you to manually select a controller model and populate the Configuration and Run trees with the features and functions that are avail able for that model Working offline is useful for creating editing configuration profiles with out the need to have an actual controller attached to the
219. s the motor s actual RPM value When using analog or pulse as input command the command value will range from O to 1000 and 0 to 1000 In order for the max command to cause the motor to reach the desired actual max RPM an additional parameter must be entered in the encoder or brush less 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 or USB the command may be sent as a rela tive speed O to 1000 or actual RPM value Control Loop Description The controller performs the Closed Loop Speed mode using a full featured Proportional Integral and Differential PID algorithm This technique has a long history of usage in con trol systems and works on performing adjustments to the Power Output based on the dif ference measured between the desired speed set by the user and the actual position captured by the tachometer Figure 43 shows a representation of the PID algorithm Every 1 millisecond the controller measures the actual motor speed and subtracts it from the desired position to compute the speed error The resulting error value is then multiplied by a user selectable Proportional Gain The resulting value becomes one of the components used to command the motor The effect of this part of the algorithm is to apply po
220. signal will be considered as invalid and lost Pulses from PWM sensors can be applied to any Pulse input on the controller s connector Configure the input capture as Pulse or Duty Cycle A Pulse mode capture measures the On time of the pulse regardless of the pulse period A Duty Cycle mode capture measures the On time of the pulse relative to the entire pulse period This mode is typically more precise as it compensates for the frequency drifts o the PWM oscillator PWM signals are then processed exactly the same way as RC pulses Refer to the RC pulse paragraphs above for reference Operating the Controller In Analog Mode Analog Command is the simplest and most common method when the controller is used in a non remote human operated system such as Electric Vehicles Input Analog Channel Selection The controller features 4 to 11 inputs depending on the model type that can be used for analog capture Using different configuration parameters any Analog input can be used as command for any motor channel The controller s factory default defines two channels as 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 51 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011
221. sleeeeeee nnn SECTION 4 I O Configuration and Operation SECTION 5 Motor Operating Features and Options SECTION 6 Brushless Motor Connections and Operation SECTION 7 Closed Loop Speed Mode 2 eee cece cece nannu SECTION 8 Closed Loop Position Mod ccc eee ee eee ees SECTION 9 Serial RS232 USB Operation 0c eee eee ee SECTION 10 MicroBasic Scripting aaa SECTION 11 Using the Roborun Configuration Utility Connecting Power and Motors to the Controller cece eee eee Power ConnectionS 0c cece ee ee eee ee eee Controller POWeLl 553 aci bc RC CE aware eee ge ae en eet Controller Powering Schemes sis iac nA RI e eI RE RE rudes Mandatory Connections lessen nnn Connection for Safe Operation with Discharged Batteries note 1 Use precharge Resistor to prevent switch arcing note 2 Protection against Damage due to Regeneration notes 3 and 4 Connect Case to Earth if connecting AC equipment note 5 Avoid Ground loops when connecting I O devices note 6 Connecting the Motors iiss snc nuire BANNA RP RR UR es ER EHE RR RR RCM AUR Single Channel Operation eee ees Power FUSES i iiu ri ma hse bed Ree eee bee AA Peete seme dos Wite Lerigthilmitsse snip un o RR om Gretna RR RP REPRE TERTIUM E RES ER Electrical Noise Reduction Techniques 000c eee nanne eee eee Battery Curre
222. soeed sensor measures the actual motor speed and com pares it to the desired speed If the speed changes because of changes in load the control ler automatically compensates the power output This mode is preferred in precision motor control and autonomous robotic applications 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 Tachometer or Encoder Wiring Digital Optical Encoders may be used to capture accurate motor speed This capability is only available on controllers fitted with the optional encoder module Analog tachometers are another technique for sensing speed See Connecting Tachome ter to Analog Inputs on page 33 Tachometer or Encoder Mounting Proper mounting of the speed sensor is critical for an effective and accurate speed mode operation Figure 41 shows a typical motor and tachometer or encoder assembly Advanced Digital Motor Controllers User Manual 73 Closed Loop Speed Mode Robote Analog Tachometer or Optical Encoder Speed feedback FIGURE 41 Motor and speed sensor assembly needed for Close Loop Speed mode Tachometer wiring The tachometer must be wired so that it creates a voltage at the controller s analog input that is proportional to rotation speed OV at full reverse 5V a
223. ssion ToBool lt expression gt str expression ToBool expression The print statement consists of the Print keyword followed by a list of expressions sepa rated by comma You can use ToBool keyword to force print of expressions as Boolean Strings are C style strings with escape characters as described in the Strings section see Strings on page 156 a 3 b 5 Print a a b T b n Print Is a less than b ToBool a lt b n Abs Function Operator Operator Returns the absolute value of an expression Abs expression Example a 5 b Abs a 2 10 The operator can function as either a unary or a binary operator expression expression expression The operator can function as either a unary or a binary operator expression xpression xpression Advanced Digital Motor Controllers User Manual 165 MicroBasic Scripting Robote Operator The multiplication operator 4 computes the product of its operands expression expression Operator The division operator divides its first operand by its second expression expression 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 bit wise AND of its operands For boolean operands it co
224. t full forward and O when stopped Connecting the tachometer to the controller is as simple as shown in the diagram below 1kOhm Internal Resistors Max Speed Adjust and Converter 10kOhm pot Zero Adjust 100 Ohm pot 1kOhm FIGURE 42 Tachometer wiring diagram Brushless Hall Sensors as Speed Sensors On brushless motor controllers the Hall Sensors that are used to switch power around the motor windings are also used to measure speed and distance travelled Speed is evaluated by measuring the time between transition of the Hall Sensors A 32 bit up down counter is also updated at each Hall Sensor transition Speed information picked up from the Hall Sensors can be used for closed loop speed operation without any additional hardware 74 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Speed Sensor and Motor Polarity Speed Sensor and Motor Polarity The tachometer or encoder polarity i e which rotation direction produces a positive or negative speed information is related to the motor s rotation speed and the direction the motor turns when power is applied to it In the Closed Loop Speed mode the controller compares the actual speed as measured by the tachometer to the desired speed If the motor is not at the desired speed and direc tion the controller will apply power to the motor so that it turns faster or slower until reached Important Warning
225. t number The number is a 32 bit value and so can range from 1 to 4294967296 Create a Lock and Key to prevent unauthorized reading of the controller s configuration parameters Lock Key o Confirm Key V Remember device unlock key FIGURE 63 Lock creation window 184 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Configuration Parameters Grouping amp 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 exam ple 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 a4 Obtain Lock Key Ex Device Unlock Key Remember device unlock key FIGURE 64 Controller unlock window Note that configuration can be set even when the controller is locked only read cannot be performed Configuration Parameters Grouping amp Organization The total number of configuration parameters is quite large While most system will oper ate well using the default values when change is necessary viewing and editing parame ters is made easy thanks to a logical graphical organization of these parameters inside collapsable tree lists The configuration tab contains two trees The left tree includes all
226. ter can be a good quality brushed DC motor used as a generator The tachometer shaft must be directly tied to that of the motor with the least possible slack Since the controller only accepts a 0 to 5V positive voltage as its input the circuit shown in Figure 14 must be used between the controller and the tachometer a 10kOhm potentiom eter is used to scale the tachometer output voltage to 2 5V max reverse speed and 2 5V max forward speed The two 1kOhm resistors form a voltage divider that sets the idle voltage at mid point 2 5V which is interpreted as the zero position by the controller With this circuitry the controller will see 2 5V at its input when the tachometer is stopped OV when running in full reverse and 5V in full forward 1kOhm Internal Resistors Max Speed Adjust and Converter 10kOhm pot 33KOhm 1kOhm Ground FIGURE 14 Tachometer wiring diagram Advanced Digital Motor Controllers User Manual 33 Connecting Sensors and Actuators to Input Outputs Robote The tachometers can generate voltages in excess of 2 5 volts at full speed It is important therefore to set the potentiometer to the minimum value cursor all the way down per this drawing during the first installation Since in closed loop control the measured speed is the basis for the controller s power out put i e deliver more power if slower than desired speed less if higher an adjustment and calibration phas
227. ters The controller will therefore be able to take advantage of the better precision and better control available from a higher quality RC radio although it will work fine with lesser expensive radios as well Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Operating the Controller in RC mode Input RC Channel Selection The controllers features 5 or 6 inputs depending on the model type that can be used for pulse capture Using different configuration parameters any RC input can be used as com mand for any motor channels The controller s factory default defines two channels for RC capture 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 Pulse Inputs Configurations and Uses on page 54 Input RC Channel Configuration Internally the measured pulse width is compared to the reference minimum center and maximum pulse width values From this is generated a command number ranging from 1000 when the joystick is in the min position to 0 when the joystick is in the center posi tion to 1000 when the joystick is in the max position This number is then used to set the motor desired speed or position that the controller will then attempt to reach For best results reliability and safety the controller will also perform a series
228. the GND and 5V wires on the potentiometer may be swapped instead With pulse or analog sensors it is also possible to change the Input Polarity configuration parameter for that input If using an Optical Encoder ChA and ChB outputs can be swapped 9 Move the sensor back to the center point to stop the motor Cut the power if control is lost 10 If the polarity was wrong invert it and repeat steps 8 to 11 11 Tighten the sensor Important Safety Warning Never apply a command that is lower than the sensor s minimum output value or higher than the sensor s maximum output value as the motor would turn forever try ing to reach a position it cannot Configure the Min Max parameter for the sensor input so that a value of 1000 to 1000 is produced at both ends of the sensor travel Advanced Digital Motor Controllers User Manual 81 Closed Loop Position Mode Robote 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 Three levels of sensitivity are provided in the controller configuration 1 250ms and Error gt 100 2 500ms and Error gt 250 3 1000ms and Error 5 500 When an error is triggered the motor channel is stoppe
229. the effect of the deadband on the joystick action is shown in the Figure 31 below Deadband Min no action Min Reverse Forward Max Reverse Max Forward Centered Position FIGURE 31 Effect of deadband on joystick position vs motor command The deadband value is set independently for each input using the PC configuration utility Advanced Digital Motor Controllers User Manual 53 VO Configuration and Operation Robote Exponent Factor Application An optional exponential or a logarithmic transformation 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 stron ger 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 The graph below shows the output vs input change with exponential logarithmic and linear corrections Output 1000 Logarithmic Linear Exponential 1000 Input 41000 P 1000 FIGURE 32 Effect of exponential logarithmic correction on the output The exponential or log correction is selected separately for each input using the PC Config uration Utility Use of Analog Input After the analog input has been fully processed it can be used as a motor command or if the controller is c
230. tions and recommendations are provided for safe opera tion under all conditions SECTION 2 Connecting Sensors and Actuators to Input Outputs This section describes all the types of inputs that are available on all controller models and describes how to attached sensors and actuators to them This section also describes the connection and operation of optical encoders SECTION 3 Command Modes The controller can be operated using serial analog or pulse commands This section describes each of these modes and how the controller can switch from one command Advanced Digital Motor Controllers User Manual 13 aika Robote input to another Detailed descriptions are provided for the RC pulse and Analog command modes and all their configurable options 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 Motor Operating Features and Options This section reviews all the configurable options available to the motor driver section It covers global parameters such as PWM frequency overvoltage or temperature based pro tection as well as motor channel specific configurations These include Amps limiting acceleration deceleration settings or operating modes SECTION 6 Brushless Motor Connections and
231. tions of motor wiring There is a total of 6 possible combinations of wiring three sen sors on three controller inputs There are also 6 possible combinations of wiring three motor wires on three controller outputs Only one of the 6 combinations will work correctly and smoothly while allowing the controller to drive the motor in both directions Try the different combinations while applying a low amount of power 5 to 1096 Applying too high power may trigger the stall protection see below Be careful not to have the motor output wires touch each other and create a short circuit Once a combination that make the motor spin is found increase the power level and verify that rotation is smooth at very slow speed and at high speed and in both directions If the motor is spinning in the wrong direction simply swap any two of the three sensor wires and then repeat the steps above to find the correct combination of motor wires 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 com bination 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 Brushless Motor Operation Once the Hall sensors and motor power wires are correctly connected to the controller a brushless motor can be operated exactly like a DC motor and all othe
232. to Max Amps rating in Product Datasheet Default Value 7596 of Max Datasheet rating Example ALIM 1 455 Set Amp limit for Motor 1 to 45 5A ATGA Amps Trigger Action This parameter sets what action to take when the Amps trigger is activated The list is the same as in the DINA digital input actions see DINA Digital Input Action on page 120 Typical use for that feature is as a limit switch when for example a motor reaches an end and enters stall condition the current will rise and that current increase can be detected and the motor be made to stop until the direction is reversed Embedded in the parameter is the motor channel s to which the action should apply Syntax ATGA cc aa mm ATGA cc Where cc Input channel number aa DIN Action List mm mot1 16 mot2 32 Default Value No action on all motor channels ATGD Amps Trigger Delay This parameter contains the time during which the Amps Trigger Level ATRIG must be exceeded before the Amps Trigger Action ATGA is called This parameter is used to pre vent Amps Trigger Actions to be taken in case of short duration spikes Syntax ATGD cc nn ATGD cc Where ce channel number nn delay value in milliseconds Example AATGD 1 1000 Action that is define with ATRIGA will be triggered if motor Amps limit exceeds the value set with ATGL for more than 1000ms 140 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 l
233. to the controller model that is attached to the computer Syntax TRN Reply TRN Control Unit Id String Controller Model Id String Example Q TRN R TRNzZRCB500 HDC2450 V Volts Reports the voltages measured inside the controller at three locations the main battery voltage the internal voltage at the motor driver stage and the voltage that is available on the 5V output on the DSUB 15 or 25 front connector For safe operation the driver stage voltage must be above 12V The 5V output will typically show the controller s internal regu lated 5V minus the drop of a diode that is used for protection and will be in the in the 4 7V range The battery voltage is monitored for detecting the undervoltage or overvoltage con ditions Syntax V cc Reply V vdr vmot vbout Where vdr driver voltage in Volts 10 vmot main battery voltage in Volts 10 v5out 5V output on DSub connector in millivolts Examples Q V R V 135 246 4730 Q V3 R V 4730 108 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Runtime Queries VAR Read User Variable Read a dedicated 32 bit variable that can be read and written to from within a user script It is used to pass up to 32 individual bits or a single 32 bit signed number between user scripts and a microcomputer connected tot he controller Syntax VAR nn Reply VAR nn Where nn value Advanced Digital Motor Controllers User Manual 109
234. ueries must be separated with the colon character The string is normally terminated with the command to repeat st followed by the repeated rate in milliseconds See TELS Telemetry String on page 119 and Query History Commands on page 110 for details on Telemetry 4 5 Telemetry Telemetry String a v t 10 FIGURE 67 Telemetry Encoder Parameters nu See Encoder Operations on page 129 for details on this group of 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 Revolu tion Maximum Speed and actions to do when certain limit counts are reached 4 np Encoders 4 fp Encoder 1 Use Feedback 1 Pulses Rev 100 RPM 100 1000 Min Limit 2000000000 Action at Min No Action Max Limit 2000000000 Action at Max No Action FIGURE 68 Encoder parameters 186 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Configuration Parameters Grouping amp Organization Digital Input and Output Parameters See Digital Input Output Configurations on page 120 for details on this group of parame ters For Digital inputs you can set the Active Level and select which action input should cause when it is activated and on which motor cha
235. umber of Poles of Brushless Motor on page 136 This parame ter is not needed for basic motor operation and can be left at its default value It is needed if accurate speed reporting is required or to operate in Closed Loop Speed mode Hall Sensor Wiring Hall sensors connection requires 5 wires on the motor e Ground e Sensor Output e Sensor2 Output e Sensor3 Output e power supply 68 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Brushless Motor Introduction Sensor outputs are generally Open Collector meaning that they require a pull up resistor in order to create the logic level 1 Pull up resistor of 4 7K ohm to 5V are incorporated inside all controllers Additionally 1nF capacitors to ground are present at the controller s input in order to remove high frequency spikes which may be induced by the switching at the motor wires The controller s input buffers are Schmitt triggers to ensure a clean transition between high and low 5V Out HA HB HC GND FIGURE 40 Hall sensor inputs equivalent circuit all sensors can typically be powered over a wide voltage range The controller supplies 5V for powering the Hall sensors all sensor connection to the controller is done using Molex Microfit 3 0 connectors These high quality connectors provide a reliable connection and include a lock tab for secure operation The connector pinout is shown in the control
236. ur controller model F2 SW1 Main 1A On Off Switch 1A PwrCtrl Yellow White M1 Ground Black Motor 1 Green M1 Resistor 1K 0 5W White M2 Motor 2 Sw2 Emergency Green M2 Note 4 Cut off Switch Ground Black Earth Tab Note 5 Ground Black l O Connector Note 6 Do not Connect FIGURE 2 Brushed DC controller powering diagram Mandatory Connections It is imperative that the controller is connected as shown in the wiring diagram provided in the datasheet in order to ensure a safe and trouble free operation All connections shown as thick black lines are mandatory Connect the thick black wire s or the ground terminal to the minus terminal of the battery that will be used to power the motors Connect the thick red wire s or VMot terminal to the plus terminal of the battery The motor battery may be of 12V up to the maximum voltage specified in the controller model datasheet The controller must be powered On Off using switch SW1on the Power Control wire terminal Grounding this line powers Off the controller Floating or pulling this line to a voltage will power On the controller SW1 is a common SPDT 1 Amp or more switch Use a suitable high current fuse F1 as a safety measure to prevent damage to the wiring in case of major controller malfunction Littlefuse ATO or MAXI series 18 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ
237. urve when the multiple PID mode is selected The gain for each of the points is set the same way as for the KP Flat Gain configuration except that each of the 5 points sets the gain at 096 25 50 75 and 100 of the speed range When the motor is running as speed is changing the gain value is interpolated from that table and is applied to the PID 132 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ Encoder Operations Syntax AKPC1 pp nn KPC1 pp Where pp point 1 to 5 in range table nn Proportional Gain 10 Default Value 2 0 2 0 2 0 2 0 2 0 Example AKPC1 1 20 AKPC1 2 25 KPC1 3 30 KPC1 4 35 KPC1 5 40 Loads Proportional Gains table with 2 0 2 5 3 0 3 5 and 4 0 KPC2 Proportional Gains Table for Motor 2 This is the same as KPC1 but applies to the Proportional Gain for motor 2 Syntax KPC2 pp nn KPC2 pp Where pp point 1 to 5 in range table nn Proportional Gain 10 Advanced Digital Motor Controllers User Manual 133 Serial RS232 USB Operation IRo boteQ Brushless Specific Commands TABLE 20 Brushless Specific Commands Command Set Arguments an Description BHL BLHighLimit none BL Counter High Limit BHLA BLHiLimAction none BL Counter High Limit Action BHOME BLHomeCount none BL Counter Load at Home Position BLFB BLFeedback none Encoder or Hall Sensor Feedback BLL BLLowLimit none BL C
238. vidual Digital Inputs DO none Read Current Digital Outputs E none Read Closed Loop Error F none Read Feedback FF none Read Fault Flags FID none Read Firmware ID String FS none Read Status Flags LK none Read Lock status Channel Read Actual Motor Command P Channel Read Applied Power Level PI InputNbr Read Pulse Inputs S Channel Read Encoder Motor Speed in RPM SR Channel Read Encoder Motor Speed as 1 1000 of Max T SensorNumber Read Case amp Internal Temperatures TM Channel Read Time Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 Robote Runtime Queries TABLE 12 Runtime Queries Command Arguments Description TRN none Read Power Unit Tree filename V SensorNumber Read Internal Voltages VAR none Read User Variable A Motor Amps Measures and reports the motor Amps for all operating channels Note that the current flowing through the motors is often higher than this flowing through the battery Syntax Reply Where Examples Notes Al Analog Input A cc A a1 a2 cc motor channel a1 a2 Amps 10 for each channel Q A R Az100 200 QO 2A2 R A 200 Single channel controllers will report a single value Sepex controllers report the motor Amps and the Field excitation Amps Some power board units measure the Motor Amps and calculate the Battery Amps while other models measure the Battery Amps and calcu late the Mot
239. wer to the motor that is proportional with the dif ference between the current and desired speed when far apart high power is applied with the power being gradually reduced as the motor moves to the desired speed A higher Proportional Gain will cause the algorithm to apply a higher level of power for a given measured error thus making the motor react more quickly to changes in commands and or motor load The Differential component of the algorithm computes the changes to the error from one 1 ms time period to the next This change will be a relatively large number every time an abrupt change occurs on the desired speed value or the measured speed value The value of that change is then multiplied by a user selectable Differential Gain and added to the out put The effect of this part of the algorithm is to give a boost of extra power when starting the motor due to changes to the desired speed value The differential component will also greatly help dampen any overshoot and oscillation Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011 lIRoboteQ PID tuning in Speed Mode The Integral component of the algorithm performs a sum of the error over time This com ponent helps the controller reach and maintain the exact desired speed when the error is reaching zero i e measured speed is near to or at the desired value Proportional Gain Desired Speed Output Tachometer Measured Spe
240. will serve to activate the motors If no valid RC pulses reach the controller for more than 500ms the controller no longer considers it is in the RC mode and a lower priority command type will be accepted if pres ent Advanced Digital Motor Controllers User Manual 45 Command Modes lRoboteQ 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 These type of sensors are increasingly used inside joystick and will perform much more reliably and typically with higher precision than traditional potentiometers The pulse shape output from these devices varies widely from one sensor model to another and is typically different than this of RC radios They have a higher repeat rate up to a couple of kHz The min and max pulse width can reach the full period of the pulse Care must therefore be exercised when selecting a sensor The controller will accommo date any pulsing sensor as long as the pulsing frequency does not exceed 250Hz The sen sor should not have pulses that become too narrow or disappear altogether at the extremes of their travel Select sensors with a minimum pulse width of 10us or higher Alternatively limit mechanically the travel of the sensor to keep the minimum pulse width within the acceptable range A minimum of pulsing must always be present Without it the
241. will appear in which you can enter the label name Beware that while it is possible to enter a long label names with more than 8 letters will typically appear truncated in the Run tab Advanced Digital Motor Controllers User Manual 183 Using the Roborun Configuration Utility Robote Loading Saving Controller Parameters The buttons on the right of the Configuration tab let you load parameters from the control ler 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 Load from Controller Save to Controller Load Profile from Disk Save Profile to Disk Reset Defaults n FIGURE 61 Loading amp Saving parameters buttons Locking amp Unlocking Configuration Access The Add Remove Lock button is used to lock the configuration so that it cannot be read by unauthorized users Given the many configuration possibilities of the controller this locking mechanism can provide a good level of Intellectual Property protection to the sys tem integrator Add Remove Lock FIGURE 62 Add Remove lock button If the controller is not already locked clicking on this buttons pops up a window in which you can enter a secre
242. will resume a stopped script r 2 will clear all variables and restart a script 196 Advanced Digital Motor Controllers User Manual Version 1 2 January 8 2011
243. within a MicroBasic script or from an external microcomputer even though the controller may be currently responding to RS232 or Analog command because of a higher priority setting The returned value is the raw Pulse input value with all the adjustments performed to convert it to a command Min Max Center Deadband Linear ity Syntax CIP Reply CIP nn Where nn command value in 1000 range CIS Read Internal Serial Command Returns the motor command value that is issued from the serial input or from a MicroBasic script whether or not the command is actually applied to the motor This query can be used for example to read from an external microcomputer the command generated inside MicroBasic script even though the controller may be currently responding to a Pulse or Analog command because of a higher priority setting Syntax CIS Reply CIS nn Where nn command value in 1000 range CR Encoder Counter Relative Returns the amount of counts that have been measured from the last time this query was made Relative counter read is sometimes easier to work with compared to full counter reading as smaller numbers are usually returned Syntax CR cc Reply CR nn nn Where cc channel number nn counts since last read D Digital inputs Reports the status of each of the available digital inouts The query response is a single dig ital number which must be converted to binary and gives the status of each of
244. x Use precharge Resistor to prevent switch arcing note 2 Insert a 1K 0 5W resistor across the SW2 Emergency Switch This will cause the control ler s internal capacitors to slowly charge and maintain the full battery voltage by the time the SW2 switch is turned on and thus eliminate damaging arcing to take place inside the switch Make sure that the controller is turned Off with the Power Control wire grounded while the SW2 switch is off The controller s capacitors will not charge if the Power Control wire is left floating and arcing will then occur when the Emergency switch is turned on Protection against Damage due to Regeneration notes 3 and 4 Voltage generated by motors rotating while not powered by the controller can cause seri ous damage even if the controller is Off or disconnected This protection is highly recom mended in any application where high motion inertia exists or when motors can be made to rotate by towing or pushing vehicle parking e Use the main SW1 switch on the Power Control wire terminal to turn Off and keep Off the controller Insert a high current diode Digikey P N 10A01CT ND to ensure a return path to the battery in case the fuse is blown Smaller diodes are acceptable as long as their sin gle pulse current rating is 20 Amp e Optionally use a Single Pole Dual Throw switch for SW2 to ground the controller power input when OFF If a SPDT switch cannot be used then consider extending the diode ac
245. xpression An expression using the assignment operator such as z Operator The multiplication assignment operator var expression An expression using the assignment operator such as x y is equivalent to Advanced Digital Motor Controllers User Manual 169 MicroBasic Scripting Robote Operator The division assignment operator var expression An expression using the assignment operator such as lt lt Operator The left shift assignment operator var lt lt expression An expression using the lt lt assignment operator such as x lt lt y is equivalent to X x lt lt y gt gt Operator The right shift assignment operator var gt gt expression An expression using the gt gt assignment operator such as x gt gt y is equivalent to x x gt gt y Operator Square brackets are used for arrays see Arrays on page 157 GetValue This function is used to read operating parameters from the controller at runtime The func tion requires an Operating Item and an optional Index as parameters The Operating Item can be any one from the table below The Index is used to select one of the Value Items in multi channel configurations When accessing a unique Operating Parameter that is not part of an array the index may be omitted or an index value of O can be used Details on the various operating parameters that can be read can be found in the C

Download Pdf Manuals

image

Related Search

Related Contents

2004 Normas de Discapacidad-AENOR  MOEN T3111 Installation Guide  PROGRAMANDO A HP − 50g  User Manual - Smartec IT & Security Solutions  Slimline 5Q5 Slimline 7Q5  Princess 332714 vacuum cleaner  DMX-Player XS - DMX4ALL GmbH    UNÛF`S - unops  vacuum power brake booster guía de instalación de booster guide d  

Copyright © All rights reserved.
Failed to retrieve file