You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 42 Next »

IDE and other Tools

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.

Customer Motor Bring-up Procedure

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. 

  1. Check Renesas website for related MCU motor control solution documents, algorithms, evaluation boards and kits, sample codes, etc.
  2. Requested motor control kit (MCK) for bench evaluation.
  3. Download the sample project code for the MCK, the related IDE and tools such as e2studio with FSP, Renesas Motor Workbench (RMW), etc.
  4. After successfully running the Renesas MCK, try connecting the customer motor with appropriate power supply if possible.
    1. Update the motor parameters, maximum RPM, maximum current, and other key parameters based on the actual application.
    2. Test the motor and perform tuning as necessary.
  5. Design customer board with maximum commonality to Renesas MCK boards to minimize FW changes.
  6. Develop customer FW based on Renesas sample code to work with the customer board.
  7. Bring up the customer system, perform tuning and testing.
  8. Reach out to Renesas sales and FAE, or online helps for any issues during the development.

RWM

Change RMW to communicate through VCOM port

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.

Fastest RMW Update Rate

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 */

    //}

    /*********************/

Motor Parameters

Required Key Motor Parameters

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 motor parameters needed for a BLDC motor: 

Parameter

Note

Pole Pairs

If motor spec gives the number of poles, need to divide it by 2.

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. 

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.

Inductance of q-axis (H)

Permanent magnetic flux (Wb)

If motor spec gives BEMF constant (Ke in VkRPM), need to convert it to Flux. 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.

Here are the motor parameters needed for an induction motor:

Parameter

Note

Pole Pairs

If motor spec gives the number of poles, need to divide it by 2.

Stator Resistance (ohm)

This is resistance of one phase of stator. If motor spec give line to line resistance, or measure from phase-to-phase resistance, need to divide the value by 2. 

Rotor Resistance (ohm)

This is resistance of one phase of rotor. If motor spec give line to line resistance, or measure from phase-to-phase resistance, need to divide the value by 2. 

Mutual Inductance (H)This is the interaction inductance from one coil to another coil.
Stator Leakage Inductance (H)This is the stator leakage inductance. 

Rotor Leakage Inductance (H)

This is the rotor leakage inductance.


Input Motor Parameters

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.

 

Motor Control Test and Tuning

Adjust Maximum Speed

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) */ 

Adjust Speed Change Rate

Normally slower speed changes will have better speed control, but too “sluggish” speed changes may not be acceptable in real application.

To adjust motor speed change (acceleration and deceleration) rate, in RA code, modify “Step of speed climbing (rpm)” in Module Motor Speed Controller (rm_motor_speed) as shown below. The unit is rpm per speed control period (0.001 sec in below figure). This applies to both open-loop and close-loop speed control.  

In RX code, change this parameter in the file "r_motor_module_cfg.h" under motor_module\cfg. The unit is rpm per second.

#define SPEED_CFG_RATE_LIMIT_RPM (1000.0f)  /* Rate limit of speed change [rpm/s] */ 

Suppress Vibration during Open Loop Period

If observe motor control vibration during FOC Open Loop period, enable “Open-loop damping” in Motor Speed Controller could help.

High Voltage Kit Testing

When testing motor control kit with high voltage (such as 110V AC or 220V AC) and connecting your laptop, it is always safer to run the laptop on battery only. Do not connect external power supply or monitor. The goal is to let the laptop ground floating, even the communication interface is isolated.  

Increase MCI-HV-1 Current Limit

MCI-HV-1 high-voltage inverter board has a hardware peak current limit as 21.2A (INVERTER_CFG_CURRENT_LIMIT). With a safety margin of 2.0 (MOTOR_COMMON_CFG_OVERCURRENT_MARGIN_MULT, default setting is 2.0), the maximum allowed setting of motor phase RMS current as 7.5A (MOTOR_CFG_NOMINAL_CURRENT_RMS, default setting is 3.3A). If really want to use more current for motor, the safety margin could be reduced slightly, with minimum safe setting of 1.5. The maximum phase RMS current can then be increased to 10.0A with this minimum safety margin.

Troubleshoot Cases

RZ/T & RZ/N CN032 AC Motor Control USB-Serial Driver issue

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.

RA4T1 Tuner Issue

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) 

MCI-HV-1 not Getting Boosted Bus Voltage of 390V DC

When supply 100 V AC or 200 V AC 50 Hz power to the inverter, the bus voltage is automatically boosted to 390 V DC. If not getting the expected boosted bus voltage, please check below two things:

  1. Please make sure the jumpers JP7 and JP10 of MCU board MCB-RA6T2 are switched from default 2-3 pin short to 1-2 pin short.
  2. If the AC supply is at 60 Hz, please make the following changes.

In file "r_pfc_cfg.h" under src\application\pfc_module\pfc\cfg folder, change

VAC_FREQ from default (50.0f) to (60.0f)

DATA_ARR_SIZE from default (320) to (267)



 

  • No labels