You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 18 Next »
Please use separate e2studio for RA MCUs from RX/RL78/RH850 to avoid modifying toolchain any other development environment settings. e2studio for RA will include FSP, e2studio for other MCUs will include SC.
You may want to use a new dedicated Workspace if starting a big new project.
Update to latest SC, FSP, QE revisions might break the existing working project. Please seek Renesas technical help if you cannot figure out the reason, or you could reverse back to the old version. It is typically recommended you update to latest versions when start a new project and stay with these versions for this project.
Here are some key steps to bring up customer motor control using Renesas MCUs. Note this is just given as a typical example. It varies depending on actual applications.
Here is an example of how to change RMW to communicate through VCOM port, instead of using the communication board as default.
In RA4T1 Tuner code, need to do two things. 1. #define USE_BUILT_IN (1) and 2. Link "ICS2_RA4T1_Built_in.o" instead of "ICS2_RA4T1.o".
Change the USE_BUILT_IN in r_mtr_ics.h file under src\application\user_interface\ics from default (0) to (1) as below.
Find the Tool Settings in the Project Properties shown as below. Then change the object file in "Other objects" under GNU Arm Cross C Linker => Miscellaneous, from "ICS2_RA4T1.o" to "ICS2_RA4T1_Built_in.o". Click Apply and Close.
Finally update the list under GNU Arm Cross C Linker, in "All options", replace "ICS2_RA4T1_Built_in.o" with "ICS2_RA4T1.o". Click Apply and Close.
If set to the maximum Baud Rate of each MCU, the fastest RMW update rate can be achieved at 50µs for all Renesas MCUs but one (RX13T). These two tables show the settings and maximum RMW update rate.
RX Family
MCU | CPU Clock (MHz) | Supply Clock (UART) (MHz) | Baud Rate (Mbps) | Max. Sampling Time (µs/4ch) | Lib API (ics2_init) 4th argument char speed | Lib API (ics2_init) 5th argument char mode |
RX72T | 200 | 50 | 6.25 | 50 | 0 | 2 |
RX66T | 160 | 40 | 5 | 50 | 0 | 2 |
RX26T | 120 | 60 | 7.5 | 50 | 0 | 2 |
RX24T | 80 | 40 | 5 | 50 | 0 | 2 |
RX23T | 40 | 40 | 5 | 50 | 0 | 2 |
RX13T | 32 | 32 | 1 | 200 | 3 | 2 |
RA Family
MCU | CPU Clock (MHz) | Supply Clock (UART) (MHz) | Baud Rate (Mbps) | Max. Sampling Time (µs/4ch) | Lib API (ics2_init) 3rd argument char speed | Lib API (ics2_init) 4th argument char mode |
RA8T1 | 480 | 120 | 10 | 50 | 1 | 2 |
RA6T3 | 200 | 100 | 16.6 | 50 | 0 | 2 |
RA4T1 | 100 | 100 | 16.6 | 50 | 0 | 2 |
RA6T2 | 240 | 120 | 10 | 50 | 1 | 2 |
RA6T1 | 120 | 120 | 15 | 50 | 0 | 2 |
As an example, in the case of RX66T, data can be displayed in as fast as 50µs with the following settings.
< main.c, row 130>
Before (default): ics2_init((void *)dtc_table, ICS_SCI6_PB0_PB1, ICS_INT_LEVEL,4,1); /* initialize ics */
After: ics2_init((void *)dtc_table, ICS_SCI6_PB0_PB1, ICS_INT_LEVEL,0,2); /* initialize ics */
<mtr_interrupt.c, row365-372>
Before (default):
/****** for ICS ******/
g_u1_cnt_ics++;
if (g_u1_cnt_ics >= 3)
{
g_u1_cnt_ics = 0;
ics2_watchpoint(); /* call ICS */
}
/*********************/
After: Changed to call every cycle
/****** for ICS ******/
//g_u1_cnt_ics++;
//if (g_u1_cnt_ics >= 3)
//{
// g_u1_cnt_ics = 0;
ics2_watchpoint(); /* call ICS */
//}
/*********************/
Correct motor parameters are important for achieving desired motor control performance, especially in FOC motor control. Please ensure the parameters on Motor Current Controller and Speed Controller are input correctly. If using sensorless control, also need to ensure the parameters in BEMF Observer are correct.
The parameters can be provided by motor manufacture, identified by Renesas RMW Tuner, or measured manually. RWM User’s Manual describes Tuner function and usage. Section 10.8 of MCI-HV-1 APN describes the manual measurement method.
Here are the key motor parameters that are needed:
Parameter | Note |
Pole Pairs | If motor spec gives the number of poles, need to divide it by 2 and then input the number. |
Resistance (ohm) | This is resistance of one phase. If motor spec give line to line resistance, or measure from phase-to-phase resistance, need to divide the value by 2 and input. |
Inductance of d-axis (H) | These two values will be same for PMSM motor but will be different (Lq > Ld) for IPMSM motor. If motor spec give line to line inductance, or measure from phase-to-phase inductance, need to divide the value by 2 and input. |
Inductance of q-axis (H) | |
Permanent magnetic flux (Wb) | If motor spec gives BEMF constant (Ke in VkRPM), need to convert it to Flux and input here. Flux = Ke/(2πf), where f is the electrical cycle frequency at 1000RPM (f = #Pole Pairs * 1000/60). |
Rotor inertia (kgm^2) | Need to include load inertia also, not just the motor itself. |
To enter the correct motor parameters into the code, if using FSP, you can directly enter through FSP by selecting "Motor Speed Controller (rm_motor_speed)" and "Motor Current Controller (rm_motor_current)" (for FOC projects) and entering under Properties=> Settings=> Motor Parameter, as shown below. Remember to update in both places.
In RX projects, you may directly update the parameters in "r_motor_targetmotor_cfg.h" file in motor_module/cfg, shown as below.
To adjust the maximum motor rotating speed, for RA MCUs, change the “Maximum rotational speed (rpm)” of "Motor Speed Controller" in FSP.
And also adjust the "Limit of over speed (rpm)" of "Motor Sensorless Vector Control (rm_motor_sensorless)" in FSP accordingly.
In RX MCU code, change the following parameters settings of:
#define MOTOR_CFG_MAX_SPEED_RPM (2400.0f) /* maximum speed [rpm] (mechanical angle) */
#define SPEED_CFG_SPEED_LIMIT_RPM (2850.0f) /* over speed limit [rpm] (mechanical angle) */
For Windows 11, PC user will get driver error message when USB-Serial cable is connected. This is not seen in Windows 10 and previous versions as correct driver is automatically downloaded and installed by Windows. A way to work around this would be to remove/ uninstall the installed driver and locate previous 2019 version driver. Please contact AE team for driver, if needed.
Running RA4T1 sensorless FOC Tuner sample code with FSP 5.2.0 may get the error of "BSP_CFG_HANDLE_UNRECOVERABLE_ERROR(0);". It is because RA4T1 Tuner project needs a #define modification for this new FSP version. Making a correction on "AIDU_DEADTIME_SET" defined in "r_aid_tuner_gui_user.h" file as below will solve the issue.
#define AIDU_DEADTIME_SET (g_user_motor_driver_extended_cfg.u2_deadtime)