Home
YRMCKITRL78G14 User`s manual
Contents
1. Algorithm information Par System Monitor DESCRIPTION Default Parameters Setting 32767 RS true Write Speed Control Minimum Speed 5000 1500 true Me Ni KIE Ed KS see Maximun Speed rpm 20000 9000 true Position Control Acceleration rpm s 10000 2000 true Deceleration rpm s 10000 1500 true Polar couples Startup Current Apk 10 Maximum Current Apk 10 Stator Resistance Ohm 10 5 2 3 System Monitor This window shows the status of the RL78MCU self test results and also shows if there is a motor error The motor error alarm is also shown in the main Speed Control Window RENESAS RL78G14 Demo Kit User Interface Kit number YRMCKITRL78G14 Communication Settings Disconnect Algorithm information Parameters Setting Clock frequency 32MHz Flash occupation 15KB RAM occupation 2KB PWM modulation frequency 24KHz Sampling frequency 8KHz Speed Control Position Control March c Test 6 sc Test CPU Regs Test Clock Tast Motor Alarm 5 2 4 Main Control Window Speed Control This window provides the main control window for the board It includes the following features a RPM Control Allows manual control of the motor including speed and direction The speed reference can be varied using the RPM CONTROL pointer which can be ei
2. 7 Permanent magnets brushless motor model The synchronous permanent magnets motor sinusoidal brushless motor is widely used in the industry More and more home appliance makers are now using such brushless motor mainly because of the intrinsic motor efficiency The permanent magnet motor is made with few components e A stator formed by stacking sheared metal plates where internally the copper wiring is wound constructing the stator winding e A rotor in which permanent magnets are fixed e Two covers with ball bearings that keep together the stator and the rotor the rotor is free to rotate inside the stator 6699 a winding b winding Motor axis shaft 662 a winding magnetic axis How current flows into a winding cc c winding PMAC Motor Model The working principle is quite simple if we supply the motor with a three phase system of sinusoidal voltages at constant frequency in the stator windings flow sinusoidal currents which create a rotating magnetic field The permanent magnets in the rotor tend to stay aligned with the rotating field so the rotor rotates at synchronous speed The main challenge in driving this type of motor is to know the rotor position in real time so mainly implementation are using a position sensor or a speed sensor In our implementation the system is using either one or three shunts to detect the rotor position in real time Let s analyse
3. The full list of the progress and status is shown below ee Connect i Start Autoprocedure E P Blank check Code flash Not blank Erase need Erasing Erase Code flash PASS Blank check Data flash PASS Erase skipped Program Code flash 10 20 30 40 50 60 70 80 90 100 PASS Program Data flash 10 20 30 40 50 60 70 80 90 100 PASS Autoprocedure E P PASS End Autoprocedure E P Disconnect 17 IAR Embedded Workbench Usage The following section how to set up and use the IAR Embedded Workbench with the YRMCKITRL78G14 motor control kit Before connecting the USB cable to the board and the PC ensure that the jumpers are set as below Jumpers JP3 JP4 JP5 JP6 and JP7 Pins 1 2 connected Jumper JP1 and JP2 can be connected either as 1 3 or 4 6 Please note 1 Ifan external power supply is used JP1 and JP2 should both be set to position 1 3 which isolates the USB interface so that it is safe to connect to the PC 2 The IAR Embedded Workbench needs to have been registered and the license installed before it can be used The RL78 G14 motor control project included with this kit is designed to be compatible with IAR Embedded Workbench version 1 20 or later The IAR installation should be installed as the kickstart version which needs to be registered with IAR Please follow the installation and licensing instructions from
4. Flash programming Target power off Low voltage Target connect Permit Permit On 3 TOOLO D Not Permit 9 Not Permit Off Pin mask Peripheral break Target Power supply WAIT E TARGET RESET A timer Connect S Si Target NMI INTERNAL RESET B serial etc Not Connect Memory map Start address Length Type 0x0 960 Internal ROM Zi Ox00000 Ox3FFFF Internal ROM 256 Kbytes OxFSFOO OxFFEFF Internal RAM 24576 bytes Remove AlI The IAR debugger will open a progress window which will initially to connect to the board and then program the RL78 G14 Once this stage is complete the debugger window Will open as shown below Please note that the debugger window may contain different settings The user can configure the debugging environment by closing unwanted debugging function windows and opening new windows via the View drop down menu Project Debug Emulator Tools Window Help DS elx foku p AANA SD 5 nuezezoz x LEE E Workspace x x Disassembly x Debug D Goto H Files SS EE Disassembly 2 EB MCRPOB_R v 002EE 7182 SETI HL O Ha O Assembler Jdbebeeeesersacceseasecsesesasscesocacsanessassscsscestesseesecsssesssoessesses TPSO Ox00001 CKS0 fclk 32MHz Ha Gime library Private global variables and functions 002F0 F6 CSN AX He self Test bbbtbthbtbshsthdbrnstrstbebssheths
5. Scroll down and select the RL78 G14 device Enter the RFP workspace name Press the OK button Select a location to save the RFP workspace files use the browse button 1 Select the RL78 G14 device from the list 3 Select the RFP project location 2 Enter the RFP project name Please specify the location of the workspace b Design Documentation EW2012 FAE Training E New Components Quotes and orders lk Software l GUI m r Makenew Folder ok Press the Next button to select the communications interface Press the Select Tool drop down menu and select the communications port that the board is connected to as shown below Microcontroller Select Tool Select Interface UART chO Press the Next button to select the power supply setting The power supply should be set at 5 00V Default Power supply from E1 C Power target from the emulator Supply voltage Information on user power supply TT Wide Voltage Mode Voltage Press the Next button to complete the set up A status screen will open as shown below Press the Complete button to finish the setup procedure E Program File E Device Information File File name RSF 104LE pr5 File version W100 E Target Communication port UART ch0 Communication transfer rate 115 200bps Supply oscillator
6. define I START CUSTOM 3 0 lt X lt 5000 startup current in A pk AMP DIV define I MAX CUSTOM 3 0 lt X lt 5000 max current in A pk AMP DIV define R STA CUSTOM 40 0 lt X 5000 stator phase resist in Ohm OHM DIV define L SYN CUSTOM 30 0 lt X lt 5000 synchronous induct in Henry HEN DIV define STP TIM CUSTOM 800 300 lt X lt 10000 startup ramp time in ms define KP CUR CUSTOM 70 0 lt X lt 10000 K prop current control define KI_CUR_CUSTOM 200 0 lt X lt 10000 K integ current control define KP VEL CUSTOM 50 0 X 10000 K prop speed control define KI VEL CUSTOM 200 0 lt X 10000 K integ speed control Important note Any modifications to customize h will require re compilation and re loading of the program 16 Renesas Flash Programmer Usage The following section how to set up and use the Renesas Flash Programmer interface RFP with the YRMCKITRL78G14 motor control kit Before connecting the USB cable to the board and the PC ensure that the jumpers are set as below Jumpers JP3 JP4 JP5 JP6 and JP7 Pins 1 2 connected Jumper JP1 and JP2 can be connected either as 1 3 or 4 6 Please note that if an external power supply is used JP1 and JP2 should both be set to position 1 2 which isolates the USB interface so that it is safe to connect to the PC Please make sure that the USB cable is plugged into the PC and that the board is connected The R
7. 00 7 00 8 00 9 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 19 18 20 00 21 00 22 00 23 01 24 00 25 00 26 00 27 00 28 00 29 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 38 69 checksum Example 2 PC request of writing 4 words in the structure UIF_W starting from the third position UIF_W ram_tab 2 UIF_W ram_tab 5 Byte Code Meaning 0 OF Number of bytes in the frame OFh 15dec 1 3F Master string indicator 2 00 Station address it is always 0 in our boards 3 57 word writing operation W 4 42 data start address 2 address in UIF_W ram_tab 40h offset to add for ram reading writing 2 04 number of data 6 03 MSB of the first word of data value 03E8h 1000dec to be written in UIF W ram tab 2 UIF W var rif speed reference 7 E8 LSB of the first word of data 8 00 MSB of the second word of data value to be written in UIF W ram tab 3 not used 9 00 LSB of the second word of data 10 00 MSB of the third word of data value to be written in UIF_W ram_tab 4 not used 11 00 LSB of the third word of data 12 00 MSB of the fourth word of data value to be written in UIF_W ram_tab 5 not used 13 00 LSB of the fourth word of data 14 E7 checksum Board answer indicates that the request is received and processed Byte Code Meaning 0 05 Number of bytes in the frame 1 21 Slave string indicator 2 00 Station address it is always 0 in our boards 3 57 word w
8. If everything is correct then the command can be changed to Autoprocedure E P and the device can be programmed with the selected Hex file Microcontroller Disconnect To Device NS Blank Check Erase All Erase Program Verify File Compare Read Set Security Checksum Autoprocedure E P Set Option Bytes Set OCD Security ID Get Flash options Settings Press the large START button to execute the command File Microcontroller Help Microcontroller RSF1O04LE User Data area MORPOB RL78 hex User Boot area Command Signature Read Device name R5F104LE Device data 10 00 06 Code flash end addr OOOOFFFF Data flash end addr OOOF1FFF The RFP will open a progress bar and connect to the board and device The results of reading from the device should be as shown below If the larger RL78 G14 is used then the results will show the details from that device To program the Hex code select the Autoprocedure E P option from the Microcontroller menu and press the START button The results should be as shown below File Microcontroller Microcontroller R5F104LE User Data area MORPOB RL78 hex ker Boot area Command Autoprocedure E P Start PASS Connect Start Autoprocedure E P Blank check Code flash Not blank Erase need Erasing Erase Code flash PASS Blank check Data flash PASS Erase skipped Program Code flash 10
9. Internal current unit idm iqm intl6_t Measured d and q axis currents Internal current unit idr iqr intl6_t Reference d and q axis currents Internal current unit fa_s fb_s intl6_t Estimated alpha and beta axis stator flux fa_r fb_r intl6_t Estimated alpha and beta axis rotor flux omrif intl6_t Reference angular velocity Internal angular velocity unit omegae intl6 t Imposed angular velocity Internal angular velocity unit Speed est intl6 t Estimated angular velocity Internal angular velocity unit mec rpm intl6 t Mechanical speed rpm freq intl6 t Electrical frequency Hz 10 vbusf intl6_t DC link voltage filtered for visualization Internal voltage unit vdf vqf intl6_t D and q axis imposed voltages filtered for Internal voltage unit visualization idmf iqmf intl6_t Measured d and q axis currents filtered for Internal current unit visualization omegaef intl6_t Imposed angular velocity filtered for visualization Internal angular velocity unit omegae_s int32_t Amplified angular speed used during start up startup_phasel int32_t Amplified phase used during start up errint int32_t Speed PI integral memory idint iqint int32_t D q axis current PI integral memory flxa m 2 int32_t Alpha and beta axis flux calculation algorithm flxb_m 2 memories Label s Type Description Unit xvbm int32 t Vbus filter memory vbusmem int32 t Vbus visualization filter memory vdm vqm int32_t D q axis voltage vi
10. MOVW N 0xA39A AX UIF R var flg VETANIOO S IOO0 77 100 0032C 36E803 MOVWW HL 0x03E8 ne ee ee a DELAY100U5 100 100ns MCRPDB RILZEG14 2 0 Object board alam active 5 P m x Log Lu Tue Jun 12 2012 11 33 17 Download complete Tue Jun 12 2012 11 33 17 Loaded debugee C Users ParsonsD Documents Date Data REL combined data RL78 RL78G1 4 RL78G14 MC Kit Development Motor Control Kif Software MCRPO8YAR 1 21 or lateAMCRP0O8 RL78G14 2 D Objecf Debug Exe MCRPO8 RL78G14 2 0 Objec d87 Tue Jun 12 2012 11 33 18 Target reset Tue Jun 12 2012 11 33 18 RL78 E1 Executor E1 61c 7 Mar 2012 OCD Control Code V3 03 Device chipname R5F104PJ f104p file version E1 20b Boardinfo 00008004 product id 4100 version A firmware version 07 11 m Debug Log Build Ready NUM Other debugging windows can be opened to watch variables monitor registers view the Stack memory etc These can be selected by using the View menu tab at the top of the workbench and then selecting the required debugging function Please note that there are some other debugging function such as Events that are located under the Emulator tab Data is held for all debugging options whether displayed or not so that windows can be opened or closed as required to make the management of the workspace and the data viewed clearer Software breakpoints can be set in the C source or assembler windows by simply double clicking on t
11. R40 loeli R30 ES a2 RIL GQ 6a cibeto og La f 7 Ra2 can bonae supply Sdle tion Jumpers JP1 and eg location Note The figure shown above is with the jumpers in position 3 4 2 2 LED Description There are three LED s on the board that show the status of the power supply of the board DL7 is connected to the USB supply from the PC so it indicates that power is supplied to the USB port and therefore the complete communication section DL6 is connected to the 12V step down converter output VDRV12V and indicates that the inverter drive voltage is supplied DLS is connected to the 5V step down converter output logic supply it indicates that the control section is supplied The other LED s in the board DL1 DL2 DL3 and DL4 are driven via software from the RL78 G14 MCU These have the following functions but can be user programmable by editing the motor control project DLI This is set to indicate that the RL78 G14 is operating DL2 This is used to indicate a motor error o Flashes quickly when there is an error Off otherwise DL3 a Watchdog Ram Parity Illegal access reset is generated o Is set off when a normal power on or manual reset occurs DL4 Indicates the control loop interrupt timing Lit to indicate operation o The LED duty will change when idle or when the motor is running This point or I O pin can be monitored with an oscilloscope Segeegegesge ee ooo e o YRMCKITRL78
12. Sat 56 13 Internal Representation of Physical Quantities nnn unnnnnenneerenne eeeeaeeeeeeeseeeeesaeeeeaeeseneeseaees 57 14 List of variables used in Tmotorcontrol C A 58 15 Application Customisation nnn cece cece eeeeaeeeeeeecaeeesaaeeeeaaeseeeeeseaeeesaaeeeeaeeseeeescaeeesaeeseneessaees 61 16 Renesas Flash Programmer Usage 62 17 IAR Embedded Workbench Usage nnen ener enne ner enseneevenneeeenennenernenneneneennenenvennenn 70 18 Online technical support and information annen eeen ennnerenneereneerneneeenneenenenrenernnnenenneenenvenn 78 Revision HISTORY e ren ree mn mn enmon mmm E Om OO 79 General Precautions in the Handling of MPU MCU Products nennen eren eeennnenenneerenn 80 1 Installation and Set Up The following section provides the information to install the software projects and documentation for the YRMCKITRL78G14 motor control kit and to be able to set up the hardware in order to run the built in demonstration 1 1 Software Installation To install the software supplied with the kit Place the CD ROM into the PC drive The installation should start automatically If for any reason the CD fails to start automatically please run the setup exe file on the CD Windows Vista and 7 users may see User Account Control dialog box If applicable enter the administrator password and click lt OK gt It is recommended that the user has sufficient administration rights to install the software
13. Target Frequency MHz Internal OSC Multiply rate 1 00 Operation mode Chip Supply power 5 00 A Flash Options Disable Block Erase Invalid Disable Program Invalid Disable boot block cluster reprogramming Invalid End of boot block number 003 Start of flash shield block number 000 File name Show the program file to program in a flash memory Back Complete Detail The hex file to be programmed needs to selected Press the Browse button and locate the hex file to be programmed into the RL78 G14 Follow the instructions to select the file The file name should appear in the User Data area as shown below ER Renesas Flash Progran File Microcontroller Help Microcontroller R5F104LE User Data area MCRPO8_RL 8 hex Command Autoprocedure E P Start Next the command needs to be set Press the Microcontroller menu button and select the Autoprocedure E P option This will execute the following sequence when the large START button is pressed Blank Check the Device Erase the device if not blank Program the device with the Hex code selected If the user is unsure of the use of the RFP process then a different command such as Blank Check or Signature Read can be performed This will confirm that the communication interface is working and that the RFP can connect to the RL78 G14 on the board without corrupting or damaging the device
14. and JP9 can be connected or open Jumper JP8 and JP9 1 3 Operating the Demonstration Once the jumpers have been checked as described above and the motor is connected Follow the sequence described below to run the demonstration 1 3 1 Connecting the board Connect the USB lead to the PC and then connect it to the YRMCKITRL78G14 board The following LED should be lit on DL7 USB supply from the PC and the step up regulator DL6 12V step down converter output DLS 5V step down converter output logic supply The following LED s are controlled by the RL78G14 MCU DLI should blink at approximately 1 2 second interval RL78G14 running DL2 DL3 should be off DL4 should be on it is driven with an I O output with period equal to sampling period interrupt 1 3 2 Stand Alone Demonstration Mode Operation To start the demonstration sequence press the P4 button The board should follow the following sequence gt The motor should start and accelerate to a steady speed gt The motor will run at this speed and direction for approximately 10 seconds gt The motor shall then reverse direction Decelerate Stop Change direction gt Accelerate to the previous speed Continue operating for a further 10 seconds The motor shall then stop The sequence can be repeated by pressing the P4 button again The motor speed is defined by the Minimum and maximum speed settings When running from the hardware the demonstra
15. in the first parameter Default parameters setting in the setup and click on the button Write Now perform a hardware reset on the RL78G14 so the calibration procedure of the Current PI coefficient is enabled In the parameters list please set the current PI coefficients Kp and Ki to 1 as shown below Parameters Setting DESCRIPTION UNIT Reload Stator Resistance Ohm 10 Write Synchronous Inductance Henry 10000 Startup Time ms Current Loop Kp Current Loop Ki Speed Loop Kp Speed Loop Ki Free Free Initial Setting of the Current Kp and Ki gains for motor tuning Connect the oscilloscope probes to the Test Point TP1 and to the Ground of the board The next step is to generate a current step and capture the current PI controller response in order to tune the current PI coefficients To generate the current step and check the response on the oscilloscope please enter 1 in the parameter 17 PI Tuning trigger and click on the button Write This will generate a current step reference which amplitude is equal to the value specified as start up current In the oscilloscope you will observe the internal measurement of the obtained current normalized in such a way that when the signal is equal to 4V the current is equal to the requested one So the tuning procedure consists in varying the PI gains in order to make the signal equal to 4V in the fastest
16. nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropri
17. possible way without oscillation Please find below in the picture some examples of the different responses you may obtain System response too slow System response too fast gt Increase the PI parameters gt Decrease the PI parameters 13 5 7 9 1113 15 17 19 21 23 25 27 29 31 33 35 37 39 EARE EEE EZS ESS aor System calibrated 120 100 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 5 37 39 Test Point 1 TP1 Oscilloscope Tuning Outputs Keep in mind that the proportional gain is the responsible of the reactivity of the system while the integral gain allows reducing to zero the steady state error An excess of proportional gain will produce high frequency oscillations usually with audible noise while an excess of integral action will produce lower frequency oscillations Note also that if the gains are too low no answer is produced increasing the parameters at a certain level the current obtained will be enough to move the rotor which will align from this point in advance don t move the rotor by hand and you will see valid answers in the oscilloscope The final rise time will depend on the motor you are using but usually a rise time lesser than lms can be obtained After tuning the current PI parameters manually reset the board in order to return to the normal operation mode 6 6 Tuning the Speed Pi Parameters Speed PI proportional gain par
18. power is supplied until the reset process is completed In a similar way the states of pins in a product that is reset by an on chip power on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified 3 Prohibition of Access to Reserved Addresses Access to reserved addresses is prohibited The reserved addresses are provided for the possible future expansion of functions Do not access these addresses the correct operation of LSI is not guaranteed if they are accessed 4 Clock Signals After applying a reset only release the reset line after the operating clock signal has become stable When switching the clock signal during program execution wait until the target clock signal has stabilized When the clock signal is generated with an external resonator or from an external oscillator during a reset ensure that the reset line is only released after full stabilization of the clock signal Moreover when switching to a clock signal produced with an external resonator or by an external oscillator while program execution is in progress wait until the target clock signal is stable 5 Differences between Products Before changing from one product to another i e to one with a different type number confirm that the change will not lead to problems The characteristics of MPU MCU in the same group but having different type numbers may differ
19. s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters
20. the IAR installer and documentation 3 Itis not possible to run both the control GUI and the IAR debugger at the same time as they both use the same virtual UART USB interface To run the debugger and the GUI it is necessary to use the El connector for the RL78 G14 Care should be taken when using a high voltage external power supply as the El interface is not isolated Please make sure that the USB cable is plugged into the PC and that the board is connected The IAR Embedded Workbench will have been installed in the default or user location The default location is as follows Start Menu gt All programs gt IAR Systems gt IAR Embedded Workbench for Renesas RL78 1 20 gt IAR Embedded Workbench exe Double click on the file to open Note that Windows Vista and 7 users may have to use Run as administrator and the opening screen should open as below Please see section for the option detail to permanently enable Run as administrator File Edit View Project Tools Window Help Deg eel r y keeelie URS L Workspace x x D Files fe Bi find all the informati c et started tutorials mple projects user and reference ort information and www iar com resources 2 ze Read in depth articles from our software engineers and product managers see video em H presentations and check the webinar calendar or view the recordings GETTING STARTED USER GUIDES EXAMPLE PROJECTS Guidelines fo
21. 015625V which is enough for our purposes e Currents the currents are amplified by 1024 allowing us to manage currents up to 32A with the resolution of around mA e Resistances the resistances are amplified by 256 allowing us to manage resistances up to 128 Ohm with a good resolution e Inductances the inductances are amplified by 16384 and the maximum allowed inductance is lesser than 2 Henry e Magnetic flux it is amplified by 4096 and the maximum allowed flux is lesser than 8 Volt sec Weber e Time the time is represented with multiplies of the base quantity given by the sampling period when the sampling frequency is chosen to be 8kHz the time base is 125s e Angular velocity the angular velocity is calculated as the difference of two phase samples for each other 4 sampling periods so the amplification of the internal representation is 4 65536 2pi Sampling Frequency The complete list of the conversion constants can be found in the header file const def h 14 List of variables used in motorcontrol c The file motorcontrol c includes the motor control algorithm routines Please find below the description of the variables used Label s Type Description Unit flgx abyte t Char whose bits are used as flags cnt int uint8 t Counter for main loop synchronization ilum off uintl6_t A D conversion offsets of measured u v w p
22. 1 s W an D11 D10 Dni Dn0 k 1 7 2 n 5 3 2 Slave Control Codes Slave string liso an D1 Dm k where 1 frame total length 1 byte i slave string identifier OK answer NOK answer s station address 1 byte o operation code 1 byte a data address 1 byte n data number 1 byte Dx x th data byte 1 byte k checksum 1 byte Slave Command Code Operation e check answer w word reading answer word 2 byte W word writing answer word 2 byte Possible slave frames Responses Nok 1 s o k 1 5 Check 1 s c k 125 Word read 1 s w a n D11D10 Dn1Dn0 k l 7 2 n Word write 1 s W k 1 5 5 3 3 Communications Examples Example 1 PC request of reading 16 words from the structure UIF R starting from the second position UIF R ram tab 1 UIF R ram tab 16 Byte Code Meaning 0 07 Number of bytes in the frame 1 3F Master command string indicator 2 00 Station address it is always 0 in our boards 3 TI word reading operation w 4 41 data start address 1 address in UIF R ram tab 40h offset to add for ram reading writing 5 10 number of data words 0x10 16dec 6 39 checksum Board answer Number of bytes in the frame 27h 39dec Slave string indicator Station address it is always 0 in our boards word reading operation w data start address 1 address in UIF_R ram_tab 40h offset to add for ram reading number of data 10h 16de
23. 13 Speed Loop Kp and integral gain par 14 Speed Loop Ki should be tuned in the real application and under load conditions As starting values low values can be chosen they can be increased at medium working speed until instability arises high frequency instability is related to the proportional value too high low frequency instability is related to integral value too high When instability arises the value should be halved Some kind of tuning of speed parameters can be performed using high values of acceleration ramp and imposing speed reference variations as done with the current PIs The PI calibration procedure should be iterated till the desired system response is reached The speed reference could be changed depending on the motor application You can find below two graphs indicating an example of tuning procedure this procedure should be made using the real working environment Speed parameters can influence the success of the start up phase if the algorithm fails in this phase giving alarm n 3 try modifying the speed proportional gain first and then the integral gain Speed Pi Integral calibration Flow Chart Speed Pi Proportional calibration Flow Chart Start Speed I calibration Set speed to Y 1000rpm Set speed to 1000rpm Reduce accekraton ramp Speed Oscillation Reduce I parameter by 1 4 Increase I parameter Reduce P parameter by 1 4
24. Control Mi STOP UPDATE Position Contro RPM CONTROL PROPERTY MONITOR i e A aaa mm 7000 Motor speed Motor speed ImposedF Direct Curr Torque Cur Direct Volt Quadratur Orpm 0 0 Hz OmA OmA oov oov DC Bus Vol Alarm Code 13 6V o The motor can be controlled by the RPM CONTROL section by either moving the point to the desired speed and direction or setting the speed in the text box The DEMO button performs the same operation as described previously Once the motor is in operation the graphs will start to update together with the measured values in the PROERTY MONITOR window as shown below Motor Control Demonstrate RENESAS RL78G14 Demo Kit User Interface e Kit number YRMCKITRL78G14 tENESAS Communication Settings SPEED VOLTAGE CURRENT 8000 rpm 20 v 400 mA Algorithm information 4000 rpm 200 mA Parameters Setting po 0 mA 4000 rpm 200 mA System Monitor 8000 rpm ep e 2 a y e r 400 MA 4 sec Speed Control Reference Quadrature Position Control RPM CONTROL 0 Motor speed Imposed F Direct Curr Torque Cur Direct Volt Quadratur 73 2 Hz 0mA 35 mA o 2V 2 3v Alarm Code Save data to file d Alarm Codes There are three alarm codes used in the GUI and embedded software 1 EEPROM error alarm 2 Inverter error 3 Loss o
25. FP will have been installed in the default location Start Menu gt All programs gt Renesas gt Renesas Flash Programmer V 1 03 00 gt Renesas Flash Programmer V 1 03 00 exe Double click on the file to open Note that Windows Vista and 7 users may have to use Run as administrator and the opening screen should open as below File Microcontroller Help Microcontroller User Data area Create new workspace Open latest workspace C Users ParsonsD Documents Data Data REL combined data RL78 RL78G 14 RL78C Open RFP workspace Click the Next button to start the set up process The following screen should open UPD70F3134A Device version ES2 0 or later UPD70F3134B Device version ES2 0 or later UPD70F3184 UPD70F3186 UPD70F3474 For CSIBO CSIBO HS UARTAD UPD70F3474 For CSIB3 CSIB3 HS UARTAO UPD70F3474A For CSIBO CSIBO HS UARTAO UPD70F3474A For CSIB3 CSIB3 HS UARTAO UPD70F3474B For CSIBO CSIBO HS UARTAO C Users ParsonsD AppData Local Renesas Fash Progran Browse Net Cancel Press the Microcontroller drop down tab and select the RL78 option This should now show all the RL78 devices The kit can support two RL78 G14 devices The 64 pin RSF104LE or the 100 pin RSF104PJ Please make sure to confirm the device fitted to the board The default should be the 100 pin device Select the following settings 1 Z 3 4
26. G14 LED Locations 2 3 Communications Debug Programming Interface Jumper Management Using the communication interface based on the uPD78F0730 USB MCU it is possible to run the following a Control GUI b Program the RL78G14 using the Renesas Flash Programmer RFP software c Debug the RL78G14 using the IAR Embedded Workbench TK interface Please note that these functions cannot be operated at the same time as they all share the same USB interface on the board Also that it is advised that no other peripheral devices are connected to the USB port or hub when using the motor control kit Selection of GUI or Programming debugging is provided by jumpers JP3 JP4 JP5 JP6 and JP7 as shown below The settings are also included on the board for reference JP6 1 2 a JP7l1 212 3 GUI OCD Jumper JP3 4 5 6 and JP7 locations GUI or TK settings Jumpers JP3 to JP7 PROGRAMMING TK VIRTUAL UART GUI OCD GUI OCD Jumper JP3 4 5 6 and JP7 configuration settings NOTE It is also possible to debug the RL78G14 using the El emulator through the dedicated connector J5 Care should be made when operating from an external power supply as this interface cannot be isolated AAA LAKA ee C co E1 OCD Interface connector location 2 4 Internal External Power Stage Selection The board offers the option of using either an internal MosFet power stage or the complete interface to connect an external power sta
27. IDE so that it is not necessary to configure or make changes to any of the build options These can obviously be viewed for reference just select the Options menu as described above and click on any of the Note It is recommended that no changes are made to any of the build settings as the resulting build results could not be guaranteed The project can be built from the build ICON 988 in the workspace or from the Rebuild All option in the Project drop down menu me The project should build without errors as shown below posoosvssososnosooovoosvosseosooso svsssoso 4999009999940900699946099906609444900 e DISCLAIMER Ha CJAssembler Files This softvare is supplied by Renesas Electronics Corporation and is only E startup sB7 e intended for use vith Renesas products No other uses are authorized Ebmultiply s87 Camc library This softvare is ovned by Renesas Electronics Corporation and is protected under B MCRP08_RL78G14_2_0_MCLib 167 all applicable lavs including copyright lavs CI Selt Test Lan si DE be clocktestasm 4 THIS SOFTWARE IS PROVIDED AS IS AND RENESAS MAKES NO WARRANTIES Dat PL mech tal sem REGARDING THIS SOFTWARE WHETHER EXPRESS IMPLIED OR STATUTORY B stl_RL 8_ peripheral crcasm 4 INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY FITNESS FOR A a st PLO registertestasm PARTICULAR PURPOSE AND NON INFRINGEMENT ALL SUCH HAR
28. RANTIES ARE EXPRESSLY Ha amp st PL registertest cs asm GE 4 TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW NEITHER RENESAS Lo s 9 pen ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE eo cl FOR ANY DIRECT INDIRECT SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES B globvarc e FOR ANY REASON RELATED TO THIS SOFTWARE EVEN IF RENESAS OR ITS popo AFFILIATES HAVE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES main c D por_tab c Renesas reserves the right without notice to make changes to this Esti supporte software and to discontinue the availability of this software useritc By using this software you agree to the additional terms and D d E Output conditions found by accessing the following link EBLibReplacements87 e http wwv renesas com disclainer MCRP08_RL78G14_2_0_Objectd87 D MCRP08_RL78G14_2_0_Objecthex B MCRP08_AL78G14_2_0_Objectmap File Name Avsetup c Version 22 0 Device s RL78GI4 Tool Chain RL78 IAR Embedded Workbench V1 20 x os none H N Platform YRMCKITRL78Gi V2 0 e Description main application Object build Operation Limitations History DD NM YVYY Version Description 07 02 2012 Vi 0 First Release Prototype i 01 06 2012 Vi 2 Updated prototype release to include motor control library plus added build option for RL78G14 6 pin device 2 15 06 2012 V2 0 Production release plus rebuild for nev IAR EV release modified file organisation to supp
29. RL78G14 Motor Control Kit YRMCKITRL78G14 D011181 Rev 1 00 User Manual June 15 2012 Introduction This document describes the Motor Control Kit YRMCKITRL78G14 based on RL78 G14 This platform drives a 3 phase Permanent Magnet Synchronous Motor Brushless Motor by using an advanced sensor less Field Oriented Control algorithm The phase currents measurement is done via three shunts which offer a very low cost solution avoiding any expensive current sensor The main focus applications for this type of algorithm are compressors air conditioning fans and so on The platform allows easy custom applications development including an on board small motor and a user friendly PC graphical user interface The platform can be powered directly by the PC USB interface or via an external power supply and in this case the USB communication can be optically isolated An external power stage can be managed in order to control higher power motors Target Device RL78 G14 series A 1 Contents ll _Installati n arnid Set Upinnt eren aten deeg deed kod ra fae pane a A ee 4 1 1 Software Installato MAar aaraa aoea A a aa nania aaia Eini radiaani 4 1 1 1 Virtual UART USB Driver Installation on Windows XP nnen ennnenenneneeneeenenenenneerenvenn 5 1 1 2 Virtual UART USB Driver Installation on Windows 7 8 1 1 3 Confirmation of USB Driver InstallatioN es ereen eennenenneereneeenenenenneenene
30. US or VDRV voltages to the external power stage It is recommended that the jumpers are removed to avoid shorting the power supplies together when an external power unit is used unless it is necessary to either supply or these voltages to the 3 Control MCU overview The RL78 G14 is a family of MCU s featuring the high performance RL CPU core Single cycle instruction execution with enhanced hardware support for multiply divide and MAC operations Below is a summary of the RL78G14 features RL78G14 CPU High speed 32MHz clock High performance 41MIPS 32MHz Low current consumption only 4 6mA 32MHz MUL DIV MAC hardware instructions Barrel shifter MEMORY AND PACKAGES 16KB Flash 2 5KB RAM to 256KB Flash 24KB RAM Up to 8KB Data Flash 30pin to 100pin package options FEATURES 1 64MHz internal oscillator 64MHz 16bit Timers o 3 phase 16bit PWM timer with dead time Timer RD o Multifunction timer with encoder interface Timer RJ o Timer Array Unit TAU and multifunction Timer RG 10 bit A D converter up to 12 channels 2channel 8bit DAC Window Comparator Event Link and Data Transfer controllers ELC amp DTC Real Time Clock Independent Windowed Watchdog Self Test functions RAM SFR Protect ADC System Clock Monitor RAM Parity Port Verify Large capacity flash memory units capable of high speed operation are included as on chip memory significantly reducing the cost of configuring syste
31. WN 5V EXTERNAL POWER STAGE RL78G14 El interface connector Internal External power stage selection okok ok soko oo Communications mode Jumper selection ENCODER User Switches RL78G14 INTERFACE P4 is at the MICROCONTROLLER ISOLATION COMMUNICATION bottom connections YRMCKITRL78G14 Board Overview 2 1 Power Supply Selection There are two main ways to supply power to the board 1 The first is to use the PC USB supply and in this case the current you can give to the motor is limited by the USB interface In this mode the USB interface is not isolated 2 The second is to use an external voltage DC source to supply the board The recommended operating voltage range is between 15Vdc and 48Vdc max at 3Amps DC A power supply with more current could be used to increase the available for the motor However it recommended that the power MosFets are kept to a working temperature of approx 60 C so that some form of air cooling will be needed In this setting the USB communications interface will be isolated from the inverter The selection between the two possibilities is made using jumpers JP1 and JP2 as shown below EXTERNAL SUPPLY SELECTION USB SUPPLY SELECTION Power supply Selection Jumpers JP1 and JP2 configuration settings 4413 on t w U4 feon amal C zi pen Etat Ste Raaen ieS gig Sai R26 RIS Uig Ge a CEA A R41 a NEW e Hat
32. Write to save the new parameter value Note The value 3 in the picture below means 0 3 Amperes Parameters Setting x DESCRIPTION CC CC Deceleration rpm s 10000 Polar couples 3 Startup Current Apk 10 Maximum Current Apk 10 Stator Resistance Ohm 10 Synchronous Inductance Henry 10000 Startup Time Current Loop Kp Current Loop Ki Setting the start up current during motor tuning 6 3 Maximum Current Maximum current specifies the maximum current to be imposed It should be set accordingly the inverter and the motor specifications and as required by the application Click the button Write to save the new parameter value The value 3 in the picture below means 0 3 Amperes Parameters Setting x DESCRIPTION L LC i Deceleration rpm s 10000 2000 true Polar couples 4 Startup Current Apk 10 Maximum Current Apk 10 Stator Resistance Ohm 10 Synchronous Inductance Henry 10000 Current Loop Kp Current Loop Ki Setting the maximum current for motor tuning 6 4 Synchronous Inductance Synchronous Inductance represents the average synchronous inductance of the motor it is an equivalent quantity that represents the auto and mutual interactions between the phase currents it is usually low in surface magnets motors it can be neglected for the first tuning of the motor but a wrong value will introduce a phase error proportional t
33. are gt Search automatically for updated driver software Windows will search your computer and the Internet for the latest driver software for your device unless you ve disabled this feature in your device installation settings gt Browse my computer for driver software Locate and install driver software manually Please select the correct file location 32bit 64bit as indicated previously for the appropriate Operating system Then click Next G l Update Driver Software Renesas Starter Kit Virtual UART COM8 Browse for driver software on your computer Search for driver software in this location Vi Include subfolders gt Let me pick from a list of device drivers on my computer This list will show installed driver software compatible with the device and all driver software in the same category as the device Click Install when the driver has been found Would you like to install this device software Name Renesas Electronics Corporation Ports C Publisher Renesas Electronics Corporation Always trust software from Renesas Electronics Corporation You should only install driver software from publishers you trust How can I decide which device f is safe to install Click Close when the installation is complete Windows has successfully updated your driver software Windows has finished installing the driver software for this device Renesas Star
34. at the data is not correctly separated into columns This can be corrected by changing the settings in the MS Office Excel program when the csv file is first opened so that it is saved correctly in future usage Please refer to the Microsoft Office installation for further information 5 3 GUI Control Command Flow The following information shows the command and control flow for the communications between the PC GUI and the RL78 G14 motor control board firmware ASCII codes used as commands 1 0x21 0x23 2 Ox3F W 0x57 e 0x63 w 0x77 If the address a specified in the Master command is lt NUM_PAR_EQP number of eeprom parameters then the parameter is read or written depending on the command Otherwise if the address a gt NUM PAR EOP then a parameter in the ram table userif h is read or written Its address location in the ram table is defined by a NUM_PAR_EQP 5 3 1 Master Control Codes Frame Format li so a n DI Dm k where 1 frame total length 1 byte i master string identifier s station address 1 byte o operation code 1 byte a data address 1 byte n data number 1 byte Dx x th data byte 1 byte k checksum 1 byte Master Command codes te check w word reading 1 word 2 bytes W word writing 1 word 2 bytes Possible master frames Commands Check 1 s ck 1 5 Wordread 1 s wank l 7 Word write
35. ate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations 11 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics 12 Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics RENESAS SALES OFFICES Renesas Electronics Corporation http www renesas com Refer to http www renesas com for the latest and detailed information Renesas E
36. because of the differences in internal memory capacity and layout pattern When changing to products of different type numbers implement a system evaluation test for each of the products Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted hereby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporat
37. c MSB of the Ist word of data UIF_R ram_tab 1 UIF_R var rpm speed LSB of the Ist word of data MSB of the 2nd word of data UIF R ram tab 2 UIF R var fre imposed frequency LSB of the 2nd word of data MSB of the 3rd word of data UIF R ram tab 3 UIF R var id d axis current LSB of the 3rd word of data MSB of the 4th word of data UIF R ram tab 4 UIF R var iq q axis current LSB of the 4th word of data MSB of the 5th word of data UIF R ram tab 5 LSB of the 5th word of data MSB of the 6th word of data UIF R ram tab 6 LSB of the 6th word of data MSB of the 7th word of data UIF R ram tab 7 UIF R var vb bus voltage LSB of the 7th word of data MSB of the 8th word of data UIF Bram tab 8 LSB of the 8th word of data MSB of the 9th word of data UIF R ram tab 9 UIF R var all alarm LSB of the 9th word of data MSB of the 10th word of data UIF R ram tab 10 LSB of the 10th word of data MSB of the 11th word of data UIF R ram tab 11 LSB of the 11th word of data MSB of the 12th word of data UIF R ram tab 12 LSB of the 12th word of data MSB of the 13th word of data UIF R ram tab 13 LSB of the 13th word of data MSB of the 14th word of data UIF R ram tab 14 LSB of the 14th word of data MSB of the 15th word of data UIF R ram tab 15 LSB of the 15th word of data MSB of the 16th word of data UIF R ram tab 16 LSB of the 16th word of data Byte Code Meaning 0 27 1 21 2 00 3 77 4 41 5 10 6
38. e RENESAS RL78G14 Demo Kit User Interface Kit number YRMCKITRL78G14 Communication Settings KEEN 5 2 2 Parameter Setting This window allows the run time parameters to be set and changed When the parameter set is changed and re written the saves these in the non volatile memory Data Flash or EERPOM Before running the motor check that the Parameters Settings displayed like the speed range and the number of polar couples etc are in line with the motor to be used or tuned See section 12 The parameters can be reloaded into the GUI by pressing the Reload button to read all the parameters that are stored in the non volatile memory eeprom or data flash In case of setting incorrect or inconsistent parameters the original default parameters can be restored from the MCU flash memory Not Data Flash or EEPROM by following the operation shown below 1 Enter the magic number 33 in the first line called 00 Default Parameters setting 2 Click the Write button in the parameter setting window 3 Then hardware RESET the RL78 by pressing the P6 button on the board 4 Click the Reload button to get the default parameters defined in the customize h header file in the IDE workspace En Nu RENESAS RL78G14 Demo Kit User Interface g Kit number YRMCKITRL78G14 2tENESAS Communication Settings Disconnect
39. ed into A control bar will appear to allow the use to Start Pause or Stop the data recording process c Speed Control Graphs There are three graphs that monitor the operation of the motor SPEED VOLTAGE and CURENT The speed graph shows the Target and Measured Speed The Voltage graph shows the VBUS Supply value Direct Quadrature and Total Voltages The Current graph shows the Total Direct and Total currents Any individual graph can be expanded by pressing the ZOOM button When a graph is ZOOMED then only this graph is visible in the GUI display Data for all graphs continues to be updated in the background The previous data timeline of the graphs can be seen by using the slide control next to the STOP UPDATE button The graphs update can be stopped by clicking on the STOP UPDATE Once the GUI is connected open the main control window by pressing the Speed Control button Through this window the user can control the speed reference to the board and can view all the reference values and measurements in the three oscilloscope graphs Motor Control De RENESAS RL78G14 Demo Kit User Interface Kit number YRMCKITRL78G14 ZENESAS Communication Settings Speed Control x zoon VOLTAGE zoon CURRENT 20 v 400 mA Algorithm information 200 mA Parameters Setting 0 mA System Monitor ln 200 mA 400 mA 0 sec Speed
40. elow the detailed equations used for the coordinates transformations 2 1 1 8a 53 8u 5 8 5 8 w 8a u Vv W gt OL S EE g 23 o seek 2g B 3 2 v 2 w B v w B u v BB 1 3 a B gt u v w Beete 1 V3 pi Sita den ga 8 cos 9 g sin 9 a B gt d q 9 at 8 8 sin 9 g e cos 9 Sa 84 cos 9 g sin 9 d q gt a B G at Ep Za sin 9 g cos 9 g Geos ot g Gcos at p 27 3 lt gt Sa Gcos at a la 2 Gcos at y 4713 gp Gsin ot p 2 Gsin 9 12 PWM Modulation Technique Among the various possibilities a particular form of PWM modulation was chosen In this modulation technique the voltages to be imposed are shifted in order to have in every moment one of the three phases of the motor connected to the system ground This allows reducing the commutations of the power bridge of one third in respect to other modulation techniques In fact the phase that is connected to the system ground doesn t require any commutation having the lower arm always on and the upper arm always off The method is based on the fact that having no neutral connection we are interested only in phase to phase voltages or in the voltage differences between the phases not in the voltage level of the single phases This allows us to add or subtract an arbitrary quantity to the phase voltages on condition that this quantity is the same for all the three phases S
41. emonstration which can be used to check that the system is working correctly and provide a quick demonstration for customers exhibitions etc The following describes the default settings which configures the board for use with the USB supply and the internal Inverter Please ensure that no external power stage is connected to connector J10 1 2 1 Motor Connections Connect the demonstration motor supplied in the kit to the connector as shown below Red Motor wire to U connection Black motor wire to the V connection Green motor wire to the W connection The Hall sensor wires should not be connected PIO Once connected plug the motor connector into the board J7 1 2 2 Set the Power Supply Selection Check that jumpers JP1 and JP2 are both connected between pin 4 and 6 Jumpers JP1 and JP2 1 2 3 Set the USB Interface Connection Check that the following jumpers are connected as shown below RRES TIL JP3 pins2 3 JP4 pins 2 3 JPS pins 2 3 JP6 pins 2 3 JP7 pins 2 3 Jumpers JP3 to JP7 Note that this sets the USB interface to the non isolated mode 1 2 4 Select the Internal Inverter The following jumpers should fitted to connect the power control current inputs and the PWM drive signals to the internal inverter JP10 fitted JP11 fitted JP12 fitted JP13 fitted JP14 fitted Jumpers JP10 to JP19 JP15 fitted JP 16 fitted JP17 fitted JP 18 fitted JP19 fitted Jumper JP8
42. enen enneenenenenn 23 35 Control MCU OVERVIEW 20 treten enti aii edie ak ra eed 24 4 RL78 G14 Motor Control Kit Specifications and Performance Data 25 5 PG Userilntettace GUI zur serenade een Eed a Ch 26 5 1 Launching the PC User Interface GU 26 5 2 Function Button Description verirsen e i ieiet 29 E E e elle TEE 29 5 22 PalamelerSellng EE 30 52 9 System Monitor sic scot rger keper No Wate eee be noko in valo 30 5 2 4 Main Control Window Speed Control 31 5 3 GUI Gontrol Command FlOW as geren lenende Berden ned Nn Genf 35 6 Motor Calibration using the PC GUI Interfac nanasan enenneereneeenenenenneerenerneneennnneneneevenn 39 Bt Stater Phase Resistance nnen seh adnate dend ne uto 39 6 2 StartUp currents zt enteren varden DA IN Ge elie aa 40 6 3 Maximum Current EE 40 6 4 Synchronous INdUCtance ne es veneris van Wea ae ln ei acne va a DA ao 41 6 5 Tuning the initial Current Pi Gains ennnenenneer enen nnnnenenervenernnenenneeneneenenenenneneneenenn 42 6 6 Tuning the Speed Pi Parameter 44 7 Permanent magnets brushless motor model 45 8 Sensorless F O C algorithm nanne enenenneenennerreneennnneneneerenernenenenneenenernenennndeneneevenn 49 Ge CNR le EE 50 10 Start up Mt Lee CT 53 11 Reference System Transformations in Detail nnn ennnenenneereneeenenenenneeeenerrennennenenenneenenvenn 55 12 PWM Modulation Technique nnn e Ea ea AE a a aAa a
43. enenn 10 1 2 Stand Alone Demonstration Setup nnn enneerenne ereen ennneneneereneernenenenneeeenneeneneernnnenenneevenvenn 11 UE Bereet e 11 1 2 2 Set the Power Supply Selection nnn enneerenee ereen ennnenenneereneernenenenneeneneenennennnnenenneenenvens 11 1 2 3 Set the USB Interface Connection nnn anneer enen ennnenenneerensernenenenneeneneenenernnnenenneenenvenn 11 1 2 4 Select the Internal Inverter nnn ennnenennnenenenenneerenerreneennneneneevenernnnenenneeeeneenensennnnenenneenenvenn 12 13 Operating the Demonstration rn sban na a o a I tan e etato 12 15331 Sonnecling the board ss stata danni ites nd 12 1 3 2 Stand Alone Demonstration Mode Operation 13 1 3 3 Demonstration Mode using the GUI nnn ennnenenneereneernenenenneereneereneernnnenenneenenvenn 13 2 Hardware Descriptio deeg iaei ce is ea Ae dna doa AEA AIA DIOJ 14 2 1 Power Supply Selection 0 seo EJ LEN ELFA DA DULL FAMA Ao 16 2725 LED Deep Mere eee er ee on mr ee nO rn On on ON OE 17 2 3 Communications Debug Programming Interface Jumper Management 18 2 4 Internal External Power Stage Selection anneer enenenneenenneerenneennneneneerenennenenenneenenenenn 20 2 4 1 Internal Power Stage Description anneer ennen enenenneerenersennennnnenenseerenverneneeennnenenenenn 21 2 4 2 External Power Stage Interface 22 2 4 2 1 External Power Stage Interface Signal Definitions nnen ennnenenneereneen
44. f phase error The alarm codes usually can be cleared by resetting the motor speed back to zero In some circumstances it is necessary to perform a manual reset of the RL78 G14 to clear the error This may reset the connection between the board and the GUI e Saving Monitor Property Data to a file It is possible to save the measured data displayed in the PROPERTY MONITOR window to a comma separated values csv excel file for offline analysis and review This is started by clicking the Save Data to file button located at the bottom of the PROPERTY MONITOR window PROPERTY MONITOR gaa 2333 4668 4666 Motor speed od F Direct Curr Torque Cur Save data to file This will open a media player style control bar which allows the user to 1 Stop recording close the media bar and close the file 2 Pause Resume recording 3 Reset Recording Note this will overwrite the data in the file Each update of the GUI monitor data is saved and will create a new entry in the excel file When the button is first pressed the user will be prompted for the file name of the file to be used Please note that recording start as soon as the file is opened even if the motor is not yet running This can be a new file or and existing file created previously Note that a new session will overwrite any previous data in the file Due to the nature of a csv file is may be possible on some versions of MS Office th
45. ge Please note that the internal and external interfaces cannot be operated at the same time The power supplies inverter drive signals and the other control and monitor signals are connected to the external power stage connector J10 If an external power stage is connected then the jumpers shown below jumpers should be removed NOT fitted When using the internal power stage the jumpers should be fitted and a connection to the external power stage connector must not be connected The jumper selections are as described below e First jumper group o JPIO Internal U current analog channel selection o JPII Internal V current analog channel selection o JPI2 Internal W current analog channel selection o JPI3 Internal bus voltage analog channel selection e Second jumper group o JPI4 H JPIS L U phase driving signals o JPI6 H JPI7 L V phase driving signals o JPI8 H JPI9 L W phase driving signals mu ye SE EXTERNAL POWER e STAGE CONNECTOR External Interface Connector and Jumper locations 2 4 1 Internal Power Stage Description The internal power stage is forms a complete 3 phase inverter bridge using discrete low voltage power MosFets Renesas RIKO654DPB n channel power MosFet The logic driving signals from the RL78 G14 MCU are connected to three IR MosFet drivers which take care of the level shifting and charge pump generation for the MosFet gate drive The inverter phase currents are read through three shun
46. hase Internal current units ivm_off currents the A D value is around 1024 that iwm_off corresponds to one half of the A D converter supply voltage SVdc 10bits A D the offsets are converter into internal current units SystemPhase uint16_t Imposed electrical phase Internal angles units Phase_est uint16_t Estimated electrical phase Internal angles unit cr_ss uintl6_t status memory for three shunts current reading trip_cnt uint16_t counter for phase loss alarm detection rpm_min intl6_t Minimum and maximum allowed speed rpm rpm max XXXXXX ep intl6 t Some variables with suffix ep they are copies of various parameters used for EEPROM management c poli intl6 t Number of polar couples stp tim intl6_t Start up time mS min_speed intl6 t Minimum and maximum electrical speed Internal angular velocity max speed unit min speed trip intl6 t Minimum and maximum electrical speed for phase lost Internal angular velocity max speed trip alarm detection unit startup cnt intl6_t Counter for start up startup_val intl6 t Start up time N of sampling periods delta_om intl6 t One step speed variation during start up Internal angular velocity unit om chg intl6 t End of start up speed equal to min speed Internal angular velocity unit r acc r dec intl6_t Acceleration ramp deceleration ramp rpm main_loop_duration krpmocp intl6 t Conversion constant between mechanical speed and electrical speed 1 start intl6_t Start up current during sta
47. he source code line or the in the appropriate window Other methods of setting software breakpoints by right clicking the mouse button or using the pull down menus are available The main debugging control functions are shown below For a full explanation of all debugging options please use the full documentation included in the IAR installation These can be accessed via the help menu button in the embedded workbench IDE CARA IEEE AA EAN AED v Me RESET Step Out Run to Live Watch SW and Hardware Step Over ie Cursor Setup Events STOP Step Into Next source Run Hardware Setup Lit when running statement Setup Note Other debugging functions are disabled in this mode 18 Online technical support and information The contact details for the support are as detailed below Technical Contact Details America techsupport america renesas com Europe www renesas com motor Jappant csc renesas com Websites America www am renesas com motor Europe www renesas eu motor Jappant www renesas com 2011 Renesas Electronics Europe Ltd All rights reserved 2011 Renesas Electronics Corporation All rights reserved 2011 Renesas Electronics Solution Corp Ltd All rights reserved All trademarks and registered trademarks are the property of their respective owners Revision History Description Rev Date Page Summary 0 10 April 2012 Preliminary Release 1 00 J
48. hematical motor model Va la D ew Va Vd and Vq Equation Diagram A control algorithm which wants to produce determined currents in the d q system must impose voltages given from the formulas above This is ensured by closed loop PI control on both axis d and q Proportional Integral Since there is a mutual influence between the two axes decoupling terms can be used TIE In the block scheme the mechanic part is included where p is the number of pole pairs while B represents friction J the inertia Tiy g the load torque and 7 the motor torque 3 T xpxA D The angular speed is represented in the scheme as to distinguish the electrical speed from the mechanical one Let s now consider the equations we have seen in a B system A vim iu di di v Rsi BOOT H These equations show that magnetic flux can be obtained from applied voltages and measured currents simply by integration A Aao Va Rsi dt 0 t Ag Apo Vg Rsip d 0 Furthermore A cos 9 A Li An sin 9 A Li If the synchronous inductance L is small the current terms can be neglected if not they have to be considered In general x A COS 9 4 Li Agg Va Rei dt Li 0 t Y Ap Sin 9 4 Lig Ago Vp Reig dt Li 0 So in the a B system phase we obtain from the flux components 9 aretan 3 The system
49. hunts current reading is described below At the beginning to the system phase is unknown No current is imposed to the motor the system phase is arbitrarily decided to be 9 0 All the references id er iqref and speeder are set to zero From the moment to While the iq and the speed are maintained to zero id r is increased with a ramp till the value istat iS reached at the moment tj The references are referred to an arbitrary da qa system based on the arbitrary phase 9 From this moment the phase estimation algorithm begins to be performed and the estimated phase is D The components of the current referred to the arbitrary da qa system are controlled to follow the references by the current PI controllers so they will be ig ista and iq 0 If we refer the measurements to the estimated phase we would obtain those which in the graph are called id ea and iqmea referred to d q estimated system since the phase D is still not correctly estimated idea and iqmea have no physical meaning At t t while iqref is maintained to zero and id r is maintained to its value istart speeder is increased with a ramp till the value Sstar is reached at t tr The system phase 9 t is obtained simply by integration of speed in the meanwhile the phase estimation algorithm begins to align with the real system phase Furthermore id nea and iqmea begin to be similar to the real flux and torque components of the current The inter
50. ion of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product
51. lectronics America Inc 2880 Scott Boulevard Santa Clara CA 95050 2554 U S A Tel 1 408 588 6000 Fax 1 408 588 6130 Renesas Electronics Canada Limited 1101 Nicholson Road Newmarket Ontario L3Y 9C3 Canada Tel 1 905 898 5441 Fax 1 905 898 3220 Renesas Electronics Eur Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 585 100 Fax 44 1628 585 900 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany Tel 49 211 65030 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shan hai amp Ltd Unit 204 205 AZIA Center No 1233 Lujiazui Ring Rd Pudong District Shanghai 200120 China Tel 86 21 5877 1818 Fax 86 21 6887 7858 7898 Renesas Electronics Hong Kong Limited Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2886 9318 Fax 852 2886 90 Renesas Electronics Taiwan Co Ltd 13F No 363 Fu Shing North Road Taipei Taiwan Tel 886 2 8175 9600 Fax 886 2 81 5 9670 Renesas Electronics Singapore Pte Ltd 1 harbourFront Avenue 10 ki pel Bay Tower Singapore 098632 Tel 65 6213 0200 Fax 65 627 1 Renesas Electronics Malaysia Sdn Bhd Unit 906 Block B Menara WAN K Amcorp Trade Centre No 18 Ji
52. lux linkages derivatives can be calculated and we obtain phy dt oh sin e EE ek sin 9 27 b S b dt m 3 r di Ayr v Ri E Ce sin 9 CH A three phase system may be represented by an equivalent two phase system So there by using specific transformations our three equations system is equivalent to a two equations system It is basically a mathematical representation in a new reference coordinates system In the two phases af fixed system the above equations become Va Rsi ge dt di vekna For the magnetic field equations we got A Li Am Lig A cos 9 Ag Lig t Ag Lig A sin After performing the derivation di di di dt dt dt di di di L A cos 9 L E a di di di Finally we obtain for the voltages in a B system di v R i HL od a Sa dt pm di pi HERE Ta pn A second reference frame is used to represent the equations as the frame is turning at the rotor speed So the d axis is chosen in the direction of the magnetic vector Am and with the q axis orthogonal to the d axis The new reference system is d q The reference frame transformations from the a B system to the d q system depends on the instantaneous position angle 9 So we obtain two inter dependant equations in the d q system di vi R i HLL o Li d Sd dt q di Rsi L tot A These two equations represent the mat
53. ms The main application fields of this MCU include Small household Appliances Fans Pumps and Power Tools 2x lc Master Slave 1xPC Multi Master 2x CSI SPI ii 7 8 bit Serial communication 3x UART T 8 Sbit 1x LIN Ich 2x Timer Array eni eh Interval Timer 12 bit Ich Window WDT 17 bit Ich RTC Encoder Timer RG 16 bit Ich HALT RTC DMA Enabled Shunt Currents SNOOZE R Timer RJ Serial ADC Enabled rotec 16bit 1ch STOP i SRAM On Maximum current amp Vaus management RL78 G14 Typical Block Diagram 4 RL78 G14 Motor Control Kit Specifications and Performance Data The specifications for the on board inverter and for the sensor less algorithm implemented are as follows e External Supply voltage range 15V to 48 Vdc e Supply current 3A max No Forced cooling e Maximum continuous output power 100W e Current reading technique three shunt e Motor Control Timer Clock frequency up to 64MHz o PWM switching frequency up to 24KHz e Sampling rate max 8KHz o Used CPU bandwidth lt 70 8KHz sampling rate e RL78G14 R5F104PJAFB o 256KB Flash 24KB RAM 8KB Data Flash e RL78G14 R5F104LEAFB o 64KB Flash 5 5KB RAM 4KB Data Flash e YRMCKITRL78G14 kit utilisation o Flash occupation 15KB o Ram occupation 2kB 5 PC User Interface GUI The User Interface is installed automatically during the CD ROM installation The PC Interface uses the USB connec
54. n Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 60 3 7955 9390 Fax 7955 9510 Renesas Electronics Korea Co Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 2011 Renesas Electronics Corporation All rights reserved Colophon 1 1
55. nd the communications debugging programming interface To maximise the flexibility of the demonstration board the following features are included e A complete 3 phase inverter on board with a low voltage motor so it becomes easy to test the sensor less algorithm on the RL78G14 e Two RL78 G14 devices can be supported by the board o The default is the 100pin device RSF104PJAFB o 64pin device RSF104LEAFB o The pin out of both RL78G14 devices are brought out to connectors JPUP1 2 3 and 4 e USB Communications Debugging and Programming interface via the uPD78F0730 USB MCU e Connectors for hall sensors and encoder connections e Connection for an external power supply e Onboard power supply generation from either the USB or external supplies e A user patch area for external signal conditioning or use of other motor control algorithms e Sample BLDC Motor e External power stage interface The default device mounted on the board is the 100pin RL78 G14 device If required this device can be removed and a 64pin RL78 G14 device fitted The Communication Debugging interface allows the user to control the inverter through the graphical user interface GUI or to program the RL78 G14 with either the Renesas Flash Programmer or download and debug the motor control program with the development IDE debugger This interface uses the PC USB power supply When using external programming or debugging tools it is possible to fully isolate the comm
56. nrdbehsesrbstbersnbsnberstbstbeersndnneere 002F1 BFB601 MOVW __N TPSO AX B globvar c TKRO1 0x0104U Select CK00 as Count Clock C El hwsetup c CRC test range variable structure 002F4 300401 MOVU AX 0x0104 D main c static CHECKSUM CRC TEST AREA checksum crc 002F7 BF9201 MOVU N TMROl AX Ha B par tab c TMIFO1 OU Clear Interrupt flag Ha B stl support 002FA 715BE2 CIRI Tir E userit c TMMKO1 10 mask Timer 01 interrupt E Output E 002FD 715AE6 SETI MK1 5 TISO Ox04l CH1 input clock selection 00300 CF 40004 NOV N TISO 0x04 Ten 0x0002U Start count o ion for Uni 00304 300200 MOVW AX 0x0002 00307 BFB201 MOVW _N T5O AX main program EO 8 san 0030A 717AFA EI Return Value none return MD_TRUE Pe 0030D E6 ONEW AX void main void 0030E D RET i void main void Js interrupt disable disable interrupt s 00310 cs PUSH DE 00311 200E SUBW SP 0x0E Check RESET source DESEN if resetflag 0 00313 717BFA DI SET LD3 ON Error RESET NDOG Partity error Illegal Instruction etc Tee eg STIOP As error occured STOP pias D 00316 DSDFA4 CHPO N resetf lag i 00319 ppos BZ 40x0A Sita SET LD3 ON Er RESET WDOG Part i 0031B 711207 SET LD3 OFF Normal RESET Pover On STOP f 1 0031E 61FD 00320 00 00321 EFO3 S 0x05 5 3 1 RESET Power On 00323 711307 S P7 1 F R var flg UIF R var flg OxOOOF status flags UIF R var flg 00326 300F00 AX 0x000F UIE Rove Fig 00329 BF9AA3
57. o obtained from the algorithm the three phase voltages requests the minimum is chosen and it is subtracted to all the three requests With this method the applied voltage star centre is not at a fixed level but it is moving Modulation Technique The maximum phase to phase voltage that can be obtained without distortion of the sinusoidal waveform with this method is equal to the DC Link voltage as in other methods like Space Vector Modulation 13 Internal Representation of Physical Quantities Since the algorithm uses fixed point arithmetic an internal representation of the physical quantities was chosen in order to represent with sufficient resolution the quantities to reduce to the minimum the necessary calculations and to manage the great part of applications The internal representation conforms to the following guidelines e Angles a complete round angle 27 is represented with the number 65536 doing this the complete angles interval O 27 where 0 is included 27 is NOT included can be represented with SHORT numbers in the interval O 65536 that is O 65535 e Trigonometric quantities the results of sin and cos operations are amplified by 16384 so they are comprised between 16384 corresponding to 1 and 16384 corresponding to 1 e Voltages internally the voltages are amplified by 64 allowing the signed representation of the maximum quantity of 511 9V at the same time the resolution is 1 64 0
58. o the load so the tuning strategies can be either e Maximize the torque at a rated current e Minimize the current at a rated torque Please enter the value zero for the first calibration as shown below the first start up has to be done with no load in this case there is no phase error neglecting the inductance Click the button Write to save the new parameter value Since the measurement unit is Henry 10000 the value 100 for example means 10mH milliHenry Parameters Setting x DESCRIPTION jer Yuan Yon Ta Deceleration rpm s 10000 Polar couples 3 Startup Current Apk 10 Maximum Current Apk 10 Stator Resistance Ohm 10 Synchronous Inductance Henry 10000 Startup Time Current Loop Kp Current Loop Ki Setting the initial Synchronous Inductance during tuning 6 5 Tuning the initial Current Pi Gains Current PI parameters allow a proper current control of the motor and the system The software offers a particular procedure to help the tuning of the current PI gains An oscilloscope is needed to see the response of the system to the stimulation the figure below is showing the Test Point TP1 to be used for the calibration GROUND REFERENCE TEST POINTS Seegegg eeeeeeeg Current Pi Gain Setting Monitor point Signal Connections First of all it is necessary to enable the current PI tuning mode and this can be done entering the magic value 22
59. on the CD The following shall be installed The following software shall be installed or copied onto the user s PC e Motor Control GUI e JAR Embedded Workbench including documentation e Renesas Flash Programmer including documentation e RL78 IEC Self Test Software Source code including documentation e YRMCKITRL78G14 IAR Embedded Workshop motor control project e Renesas Manual Navigator e Virtual UART USB Drivers Please note that the LAR Embedded Workbench will require license registration Please follow the instructions during installation and ensure no other instance of the IAR Embedded Workbench is open The YRMCKITRL78G14 documentation shall be copied during installation and is designed to be viewed with the Manual Navigator which is installed with this kit The following documentation shall be copied onto the user s PC e RL78 G14 user manual e uPD0730 USB user manual e RJKO654DPB Power MosFet user manual e YRMCKITRL78G14 motor control kit user manual This document e YRMCKITRL78G14 design files and schematics e YRMCKITRL78G14 Quick start guide e 15V BLDC Demonstration motor data sheet e EI On chip debug programmer user manual e Environmental documents WHEE RoHS Before any of the software can be used the Virtual UART USB drivers need to be installed Two copies of the drivers are included in the installation process e YRMCKITRL78G14 kit installation e During the IAR Embedded Workbench Installation Depending on the Window
60. ort object creation MCRPOS_RL78G14_2_0_ Object Cat Messages File Line Ss sti AL 8 registertestasm st RL78 registertest cs asm st AL78 registertest ez asm stl RL 8 registertest psw asm stl PU registertest stackasm Linking E Total number of errors 0 Total number of warnings 0 E Errors 0 Warnings 0 NUM Build results To launch the IAR debugger press the green arrow button on the embedded workbench IDE window Start the debugger download the Start the debugger and enter debug code to the RL78 G14 and enter mode without programming the debug mode RL78 G14 If the debugger is being used for the first time the emulator needs to be configured before connecting and downloading the code to the board and RL78 G14 This applies to any hardware emulation setting and i e TK El and IECUBE The user will be prompted by the following pop up window Emulator has to be configured before downloading a new application Press OKto enter Emulator Hardware Setup noj Press the OK button The configuration window will open as shown below Please check that the settings are as shown in the window below changing any setting as necessary and then press the OK button ID code Time unit OOOOOOOOOOOOOOOOOOOO Erase flash before nest ID check Main clock Sub clock Clock board Clock board External 9 External System System Fail safe break None MHz None kHz View setup Default
61. ou choose will be the best match for your hardware If this window appears click Continue Anyway to continue the installation Hardware Installation A The software you are installing for this hardware Renesas Starter Kit Virtual UART has not passed Windows Logo testing to verify its compatibility with Windows XP Tell me why this testing is important Continuing your installation of this software may impair or destabilize the correct operation of your system either immediately or in the future Microsoft strongly recommends that you stop this installation now and contact the hardware vendor for software that has passed Windows Logo testing Continue Anyway STOP Installation Then click Finish to complete the installation wizard Found New Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software for EI Renesas Starter Kit Virtual UART Click Finish to close the wizard Back Cancel 1 1 2 Virtual UART USB Driver Installation on Windows 7 When the YRMCKITRL78G14 board is connected to the host machine the board is initially recognised as an Unknown Device in the Device Manager Right click on the Unknown Device and select Update Driver Software within the Device Manager window Select Browse my computer for driver software il Update Driver Software Unknown Device How do you want to search for driver softw
62. pen any of the source files listed in the project on the Left Hand Side of the project window just double click on the relevant file File Edit Kaze Emulator Tools ieagal kelo vvesuuopeab iri Usala MCRPOS RL78614 2 0 Object Next the debugging interface should be selected The IAR debugger should be set to use the direct virtual UART connection TK To select this option first click on the project at the top of the workspace then right click on the mouse to open the dialogue window and select Options as shown below 2 IAR Embedded Workbench DEN File Edit View Project Tools Window Help Select the main project Right click with the mouse button and select the Options menu booogoooe LORE Of 23 3333 From the Options menu first select the Debugger option and then from the drop down menu select the TK interface driver from the drop down menu as shown below EBR View Project Emulator Tools Window Help Denge Blo CY SEDO IEEE Debug Files fom B Assembler Files me WiRnto man Setup macros E Use macro fle Device description file Ml Ovenide defaut STOOLKIT_DIRS CONFIG DDF woef 1040 dat Cog Ge MCRPO8_RL78G14_2 0 Object Log Press the OK button The next step is to build the project The necessary settings have been set in the
63. r setting up Complete product Example applications your project adding documentation in POF that demonstrate files compiling linking format gives you all the hardware peripherals for and debugging it user and reference specific devices and www iar com mypages ek Gelee Create your user account and download product updates from MyPages Here you can also manage your contact information and check your license and SUA status ha TUTORIALS SUPPORT RELEASE NOTES Tutorials to make you For questions about how All about the latest familiar with the IDE to use your IAR product features new device and the features of the reporting a problem or support and program IAR C SPY debugger finding support corrections resources FI Ready NUM To open the YRMCKITRL78G14 IAR motor control workspace and project follow the sequence shown below File gt Open gt Workspace gt C Workspace Y RMCKITRL78G14 MCRP08_RL78G14o0bj_2 0 gt Select the MCRP08_RL78 IAR Workspace file gt Press Open The project should then open in the IAR IDE and should look something like the window below Please note that depending on setting used previously then the IAR workspace and project windows can look slightly different All the settings have been pre set so that the workspace appearance is as consistent as possible For full details of the IAR Embedded Workbench please refer to the documentation included as part of the IAR installation To o
64. riting operation W 4 E6 checksum 6 Motor Calibration using the PC GUI Interface A full calibration of the motor can be performed via the PC User Interface The most important parameters to test are the following 1 Stator resistance 2 Start up current 3 Maximum current 4 Synchronous inductance 5 Current PI parameters 6 Speed PI parameters Warning Do not try to start the motor before entering the initial calibration parameters otherwise the system could be damaged 6 1 Stator Phase Resistance The Phase resistance can be found by measuring the phase to phase resistance using a meter The measured value should be divided by 2 Please enter the value in the parameter 08 Stator Resistance as shown below Click the button Write to save the new parameter value Since the measurement unit is Ohm 10 the value 23 of the picture means 2 3 Ohm Parameters Setting x DESCRIPTION jer Tan Tae ar Deceleration rpm s 10000 Polar couples 4 Startup Current Apk 10 Maximum Current Apk 10 Stator Resistance Ohm 10 Synchronous Inductance Henry 10000 Startup Time Current Loop Kp Current Loop Ki 6 2 Start Up current The start up current parameter is responsible for the proper motor start up Please enter an average value that will not damage the motor This value can be increased slowly if the motor fails to start at the end of the procedure Click the button
65. rt up first a current ramp at Internal current unit zero speed is imposed then a speed ramp with constant current istart i_max intl6_t Maximum allowed current Internal current unit r_sta intl6_t Stator resistance Internal resistance unit l sync int16_t Synchronous inductance Internal inductance unit kp_cur ki_cur intl6_t Proportional and integral constant in current PI controllers Label s Type Description Unit kp_vel ki_vel intl6 t Proportional and integral constant in speed PI controller rpmrif x intl6 t Reference speed speed ramp input value rpm rpmrif y intl6 t Reference speed speed ramp output value rpm vbus intl6 t DC link voltage Internal voltage unit xvbf intl6 t DC link voltage minimum ripple value used for Internal voltage unit voltage clamping vfmax intl6 t Maximum allowed phase voltage star Internal voltage unit vdc vqc intl6 t D and q axis imposed voltages Internal voltage unit vac vbc intl6 t Alpha and beta axis voltages Internal voltage unit old va old vb intl6_t Previous step alpha and beta axis voltages Internal voltage unit VUC VVC intl6 t Phase voltages star Internal voltage unit duty u duty v intl6 t PWM duty cycles for the three phases MTU pulses duty w lum ivm iwm intl6_t Measured phase currents Internal current unit iam ibm intl6_t Measured alpha and beta axis currents
66. s operating system the drivers should be used as follows For 32bit Windows OS 32bit USB drivers should be used i e Windows XP Vista and W7 and are located here C Program Files Renesas Y RMCKITRL78G14A Virtual UART 32bit if the YRMCKITRL78G14 installation is used C Program Files AR Systems Embedded Workbench 6 0 r178 drivers renesas VirtualCOM 3 2bit if the IAR installation is used For 64bit Windows OS 64bit USB drivers i e Windows Vista and W7 and are located here C Program Files Renesas Y RMCKITRL78G14 Virtual UART 64bit if the YRMCKITRL78G14 installation is used C Program FilesJAR Systems Embedded Workbench 6 0 r178 drivers renesas VirtualCOM 64bit if the IAR installation is used 1 1 1 Virtual UART USB Driver Installation on Windows XP When the YRMCKITRL78G 1 4 board is connected to the host machine the board is recognized by Plug and Play and the wizard for finding new hardware is started Select No not this time and click Next Found New Hardware Wizard Welcome to the Found New Hardware Wizard Windows will search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with your permission Read our privacy policy Can Windows connect to Windows Update to search for software O Yes this time only Yes now and every time connect a device No not this time Click Next to continue Select Ins
67. select the G14 configuration file i e setup as shown below and close the box Select the setup configuration file e Next select the Com Port selection drop down box and select the communications port that the YRMCKITRL78G14 board is connected to close the drop down box and click the connect button as shown below RENESAS RL78G14 Demo Kit User Interface i Kit number YRMCKITRL78G14 RENESAS Select the com port The press the connect button The GUI should now be connected to the board as shown below IS Motor Control Demons TTT RENESAS RL78G14 Demo Kit User Interface Kit number YRMCKITRL78G14 Communication Settings Disconnect GUI connected to the Parameters Setting Se System Monitor board speed Control Position Control 5 2 Function Button Description 5 2 1 Algorithm Selection At this time the only algorithm available is the sensorless F O C algorithm Pressing the Verify Jumper Settings button opens the default settings for the board RENESAS RL78G14 Demo Kit User Interface Kit number YRMCKITRL78G14 Communication Settings Speed Control Position Control Three shunt sensorless PMAC motor control Pressing the Verify Jumper Settings button opens the default settings for the board This allow the default configuration to be set without reference to the user manual or quick start guid
68. speed o can be obtained as the derivative of the angle9 d Ht t Based on this a sensor less control algorithm was developed to give the imposed phase voltages to measure phase currents to estimate the angular position 9 and finally the system speed 8 Sensorless F O C algorithm Please find below the sensor less FOC algorithm block diagram 0 dr Reading z u v w gt a B Flux Phase j estimation a B gt Mi do Tea IB mea Sensorless F O C algorithm 9 Software Description In the YRMCKITRL78G14 kit the software is working on an RL78G14 32MHz The total software uses the following resources 1 FLASH 15Kbytes 2 RAM 2Kbytes Please Note that this data also include the communication interface and the demo board management The following flow charts show the software implementation of the motor control part of the software Software organization Hardware and software initialization Interrupt enabling 125s Interrupt 10ms Main loop Software Structure Main Program Interrupt enabling Main loop synchronization cnt int NUM INT Main loop body Speed ramp management Communication management General board management Parameters modification management Main Control Flow Control Interrupt Phase currents iUmea iVmea reading Transformations using the phase angle 9 iUmeas iVmea kazo lama ibmea ideas idmea Read DC Link vol
69. sualization filter memories idm iqm int32_t D q axis current visualization filter memories omegaem int32_t Angular velocity visualization filter memory 15 Application Customisation The software designed on the RL78G14 is very flexible and can be easily configured via a single file called customize h located in the Workspace of the RL78G14 project The customize h is a file containing some macros used to specify some important program parameters The most important of them are summarized below PWM and Sampling frequencies define PWM FRE CUSTOM 24000 PWM freq Hz 8K lt PWM FRE CUSTOM lt 24K define SAM FRE CUSTOM 8000 Sampling freq Hz 2K lt SAM FRE CUSTOM lt 8K Parameter s table measurement units define AMP DIV 10 current parameters expressed in ampere AMP DIV define OHM DIV 10 resistance parameters expressed in ohm OHM DIV define HEN DIV 10000 resistance parameters expressed in ohm OHM DIV Parameter s table default values these are the values which should be used with the motor included in the demo set define RPM MIN CUSTOM 2000 200 X lt 5000 min speed in rpm define RPM MAX CUSTOM 6000 1000 lt X lt 20000 max speed in rpm define R ACC CUSTOM 4000 1 lt X 10000 accel ramp in rpm sec define R DEC CUSTOM 2000 1 lt X 10000 accel ramp in rpm sec define C POLI CUSTOM 2 II 1 lt X lt 4 polar couples number
70. tage Vins Phase angle update 9 new Current PI controls use idser iqref idmeasiQmea to produce vdout Vout Transformations using the phase angle 9 Vdouts Vout gt Vaou VBout VUouts VVout PWM output commands generation using VUou VVout Vpus is used to calculate maximum phase voltage used in current PI controls Phase estimation based on old_vaou old_vbout iamea iDmeas produces new estimated phase angle Sex Voltage memories update old Va w Vaou Old Vbow Vbowr Estimation errors detection if errors an alarm is produced Start up procedure produces idrer 1Grer Haus Main loop synchronization Motor Control Interrupt Processing 10 Start up Procedure When the motor is in stand still the phase of the permanent magnet flux vector cannot be detected with the used algorithm So an appropriate start up procedure has to be applied The idea is to move the motor in feed forward with higher current than that required to win the load till a speed at which the estimation algorithm can work Then the system can be aligned to the estimated phase and the current can be reduced to the strictly necessary quantity DI DI The following graph illustrates the strategy used the suffix et stands for reference the suffix je stands for measured idino Speed 1q mea Sstart start Start Up Process Graph Referring to the graph the start up procedure in case of three s
71. tall from a list or a specific location Advanced and click Next Found New Hardware Wizard This wizard helps you install software for USB Device Q H your hardware came with an installation CD ZE or floppy disk insert it now What do you want the wizard to do O Install the software automatically Recommended Install from a list or specific location Advanced Click Next to continue es Ce On Windows Vista a window should also pop up with similar options when connecting the YRMCKITRL78G14 board for the first time Select Locate and install driver software and then Browse my computer for driver software advanced Set Include this location in the search and then browse the computer to select the directory indicated previously for the appropriate operating system location Then click Next Found New Hardware Wizard Please choose your search and installation options Let SD Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed C Search removable media floppy CD ROM Include this location in the search Fles Renesas RPB RL78G13 USB Drivers win2k EH Browse Dont search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver y
72. ter Kit Virtual UART 1 1 3 Confirmation of USB Driver Installation After installing the USB driver check that the driver has been installed correctly according to the procedure below Open the Device Manager this will vary depending on the Windows Operating system used When the YRMCKITRL78G14 board is connected to the host PC the Ports COM amp LPT section should show the Renesas Electronics Starter Kit Virtual UART The screen below shows that the COM port number is COM23 Note that if the board is connected to a different USB port connection the COM port number will change Z Device Manager File Action View Help e D e R e Sai DVDJCD ROM drives ds Human Interface Devices CJ IDE ATAJATAPI controllers Sai IEEE 1394 Bus host controllers al Infrared devices Ge Keyboards Mice and other pointing devices Modems EI Monitors EB Network adapters B PCMCIA adapters PCMCIA and Flash memory devices 5 Ports COM amp LPT J Bluetooth Communications Port COM15 EI Bluetooth Communications Port COM16 EI Communications Port COM1 J ECP Printer Port LPT1 J Renesas Starter Kit Virtual UART COM23 Mie Processors SCSI and RAID controllers ER 2 Secure Digital host controllers 1 2 Stand Alone Demonstration Setup The following information provides the initial setup for the YRMCKITRL78G14 motor control kit basic out of the box d
73. the motor from a mathematic point of view If we apply three voltages va t vb t velt to the stator windings the relations between phase voltages and currents A v Rsi paa dt Ri d y Ll b Sb dt da v Rii dr i is the magnetic flux linkage with the i th stator winding Rg is the stator phase resistance the resistance of one of the stator windings The magnetic flux linkages A are composed by two items one due to the stator currents one to the permanent magnets B axis c axis a axis a axis b axis Real axes a b c and equivalent ones a B a fixed amplitude vector can be completely determined by its position respect the a B system angle 9 The permanent magnet creates a magnetic field that is constant in amplitude and fixed in position in respect to the rotor This magnetic field can be represented by vector Am whose position in respect to the stator is determined by the angle 9 between the vector direction and the stator reference frame The contribution of the permanent magnets in the flux linkages depends on the relative position of the rotor and the stator represented by the mechanical electric angle 9 It is in every axis the projection of the constant flux vector A in the direction of the axis A Li A cos 9 A Li A cos 9 27 Li Aar A Li A cos 9 4 Supposing that the rotor is rotating at constant speed o that is Q t wt the f
74. ther moved with the mouse or with the value written directly into the text box A value written as a positive value i e 3000 will operate the motor in a clockwise direction with a value written as a negative value i e 3000 will operate the motor in the reverse Anti clockwise direction PAUSE GO and REVERSE control buttons are also included The DEMO button enters the pre set demonstration command sequence which operates the motor with the same sequence as described previously for the Stand Alone demonstration i e the same operation as pressing the button P4 on the board No other settings are required The two bars shown in the RPM Control wheel indicate the minimum speed point as set in the parameter settings Below the minimum speed the motor does not operate and above the minimum speed the motor operates normally at the reference speed set The setting of the minimum speed can be displayed by the tool tip as the mouse is moved over the minimum indicator This is the value set in the parameter settings window b Property Monitor This windows shows the main motor operating parameters The monitor graph can be set to display any of monitored properties by clicking on the required property to be viewed The run time data can be saved to an Excel file by clicking on the Save data to file button This will open a dialogue box to select the filename and location of the file that the data is sav
75. tion speed is defined by the default settings in the motor control IAR project or those set during a previous session when using the GUI The basic speed is calculated as follows Demonstration Speed Min Speed Max Speed Min Speed 4 This setting of the demonstration speed equation can be changed in the code contained in the motorcontrol c source file 1 3 3 Demonstration Mode using the GUI The YRMCKITRL78G14 demonstration can also be operated as described above using the control GUI To start the demonstration press the DEMO button in the PC GUI The demonstration will follow the same sequence as described for the stand alone operation above If the GUI is installed and running the graphs will be updated with the running data Speed Voltage and Current even if the demonstration is started from the push button on the board Note the RPM SPEED indicator does not operate in demonstration mode The measured speed is updated as normal The demonstration speed should be the same if the minimum and maximum speed settings have not been changed in the parameter setting window For further details please see the PC Control Interface section 2 Hardware Description The YRMCKITRL78G14 starter kit is a single board motor control inverter based on the new RL78 G14 series of microcontrollers The hardware includes a low voltage 3 phase MOSFET power stage the MCU control system the switching power supplies a
76. tion to communicate with the RL78G14 board so before use please make sure that the Virtual UART drivers are installed as described in section 1 1 1 5 1 Launching the PC User Interface GUI Note that for Windows Vista and Windows 7 it is necessary to run the GUI as Run as administrator It is possible to set the operation to permanently enable the Run as administrator option in the windows start menu To enable this option perform the following sequence Right click on the motor Control Demo icon Select Properties Select Advanced Click the Run as administrator button Press OK twice to return cao oP To open the PC GUI click on the Motor Control Demo ICON in the start menu A Motor Control Demo The GUI should open as shown below 7 RENESAS To connect the GUI to the YRMCKITRL78G14 board follow the sequence e If more than one configuration file is located in the GUI installation directory then the user has to select the appropriate configuration setup file Otherwise the default configuration file setup ini is selected automatically and this part can be skipped Note the setup and configuration can be customised by editing the setup ini file and then saving as the same or alternative file name e Ifthe setup file is not automatically selected then first select the Select board setup drop down bar in the top left hand corner of the GUI panel Then
77. tions 2 4 2 1 External Power Stage Interface Signal Definitions The following provides a short explanation of the external power stage interface connections Please refer to the circuit schematics for full details Analogue Signals The analog signals are inputs and should always be in the range OV to SV It may be necessary to adjust when a different motor is used and the value of the shunt resistor is changed Drive Signals The driving signals are outputs and are at logic SV level and can be set as active high or active low This can be defined in the motor control project Alarm Signal The alarm is an input and it is active low no alarm level 5V A pull up is included on the board in case there is no connection to J10 Hall and Encoder Signals The hall and the encoder signals are logic inputs and all have appropriate pull up resistors Supplementary Signals Signal SUP1 connector pins 24 and 25 can be connected to 1 The internal power stage bus voltage VBUS by connecting Jumper 9 pins 2 2 The internal power stage 12V drive voltage VDRV12V by connecting Jumper 9 pins 2 3 3 Unconnected Jumper 9 left open Signal SUP 2 connector J10 pins 26 and 30 can be connected to 1 The logic supply 5V by connecting jumper JP8 2 Left unconnected NOTE Care should be taken with the connections of Jumpers 8 and 9 when using the external interface as these supply the local board 5V and either the VB
78. ts in the low sides of the bridge WBUS AGnd e RJK0654DPB n channel power MosFet 3 Phase Inverter VDRV12V D5 R77 10uF 16V 100nF JP14 STRIP M V P 2 54 2P A UH UH_TRDIOBO UL UL TRDIODO JP15 STRIP M V P 2 54 2P VDRVI2V MosFet Gate Drive Interface One Channel Please refer to the board schematic for the full details 2 4 2 External Power Stage Interface Since internal power stage allows only the management of low voltage low current motors an interface with an external power stage is provided This allows the RL78 G14 MCU together with the control GUI or IDE debugger to control a high voltage high power motor via a suitable external inverter unit Please find below the signal connection interface for the external power stage interface connector J10 Temperature analog signal Ground Bus voltage analog signal Ground U current analog signal Ground V current analog signal Ground W current analog signal Ground Fault digital signal U phase low switch command lt Ground phase low switch command Ground phase low switch command Ground Ground V phase high switch command Ground W phase high switch command Ground SUP 1 SUP SUP 2 Hall A digital signal Hall B digital signal Hall C digital signal SUP 2 Encoder A digital signal Encoder B digital signal U phase high switch command Encoder Z digital signal Ground External Interface Connector Signal Connec
79. une 2012 AlI First Relapse General Precautions in the Handling of MPU MCU Products The following usage notes are applicable to all MPU MCU products from Renesas For detailed usage notes on the products covered by this manual refer to the relevant sections of the manual If the descriptions under General Precautions in the Handling of MPU MCU Products and in the body of the manual differ from each other the description in the body of the manual takes precedence 1 Handling of Unused Pins Handle unused pins in accord with the directions given under Handling of Unused Pins in the manual The input pins of CMOS products are generally in the high impedance state In operation with an unused pin in the open circuit state extra electromagnetic noise is induced in the vicinity of LSI associated shoot through current flows internally and malfunctions occur due to the false recognition of the pin state as an input signal become possible Unused pins should be handled as described under Handling of Unused Pins in the manual 2 Processing at Power on The state of the product is undefined at the moment when power is supplied The states of internal circuits in the LSI are indeterminate and the states of register settings and pins are undefined at the moment when power is supplied In a finished product where the reset signal is applied to the external reset pin the states of pins are not guaranteed from the moment when
80. unications interface to avoid possibilities of electrical damage especially when using the external power stage interface The board can be fully powered either from the PC USB interface or from an external power supply When the USB power is used a step up converter is used to obtain the inverter VBUS voltage necessary to generate the voltages for the main board and the motor In this mode the main system is not isolated from the PC and the current available for the motor drive is limited to approximately 300mA When an external power supply is used the main board is fully isolated from the PC The power for the motor is rated at 48Vdc 3A It may be possible to supply more motor current but it will be necessary to provide cooling for the inverter stage power MosFets in order to keep the temperature of the power MosFets at around 60 C The internal power supplies logic and for the driving system are obtained through two step down switching regulators in order to reduce heating and power consumption A patch area was added to allow the user to make hardware modifications adjustments as necessary This area can also be used to support alternative motor drive algorithms such as sensorless BLDC drive Please refer to the schematics for the details of the full hardware implementation PATCH AREA INTERNAL POWER STAGE STEP DOWN 12V 9gENpEEGEGEGEOLGELGA 000000000000006 MokoRohoho koko Kok oK oK ok HALL SENSORS STEP DO
81. val t t is the start up time and it is supposed to be large enough to allow the estimation algorithm to reach the complete alignment with the real phase of the system At t ty the phase estimation process is supposed to be aligned At this point a reference system change is performed from the arbitrary da qa reference to the d q reference based on the estimated phase Sest The system reference change is performed as follows e The current references in the da qa system id l and igrer 0 are projected in the fixed system a B to compute the instantaneous current components the same is done with the integral parts of the current PI controllers which are the mean voltages required to obtain those currents in this way we obtain ig ig Va Vp e The phase is updated to Ges e The a and B components obtained before are projected into the new reference system d q giving the new current reference values igo igo and the new PI integral memories Vao Vqo the speed PI integral memory is loaded with the q current reference After t gt t2 the normal control is performed based on the estimated phase Ses the speed reference is increased with the classical ramp the ig current reference is decreased with a ramp till it reaches the value zero at the moment t3 then it is maintained to zero the i current reference is obtained as output of the speed PI controller 11 Reference System Transformations in Detail Find b
Download Pdf Manuals
Related Search
Related Contents
InSite® SL - METTLER TOLEDO Grundlegende Richtlinien zur Windentechnik Moteur pour volets roulants RolTop 3/1 - 向日市 Mars 2011 Biotox. Mise à jour partielle - février 2014 HP 54645D EN LP Express Installation and User Manual Copyright © All rights reserved.
Failed to retrieve file