XMC™ Forum Discussions
text.format{('custom.tabs.no.results')}
Hi Team,
We are working on speed current control scheme using XMC1300 kit (XMC1302 MCU). Project we are using "BLDC_SCALAR_HALL_XMC13_Power_Tool" and the reference document is "DEMO-PTOOL-300W user guide".
Now we need to run the motor so that we need to calculate Speed Kp & Ki. But in software he has mentioned formula only to calculate Current Kp & Ki. There is a difference in Speed and Current Kp, Ki Calculation right.
Below is the calculation for Current Kp, Ki.
/* Current Control */
#if ((MOTOR0_BLDC_SCALAR_CTRL_SCHEME == BLDC_SCALAR_CURRENT_CTRL) || (MOTOR0_BLDC_SCALAR_CTRL_SCHEME == BLDC_SCALAR_SPEEDCURRENT_CTRL))
/**
* Proportional gain of current PI. Range: 0 to 32767
* Kp = (2* 3.14 * Ls * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * 2^scale)
* For MOTOR_EC_MAXON_267121, Kp = 1.517 for Ls = 3865 uH and bandwidth = 500 Hz
*/
#define MOTOR0_BLDC_SCALAR_CURRENT_KP (20972)//(24853U)
/**
* Integral gain of current PI. Range: 0 to 32767
* Ki = (2* 3.14 * Rs * (MOTOR0_BLDC_SCALAR_BASE_CURRENT / MOTOR0_BLDC_SCALAR_BASE_VOLTAGE) * Bandwidth * MOTOR0_BLDC_SCALAR_CCU8_PERIOD_uS * 2^scale)
* For MOTOR_EC_MAXON_267121, Ki = 0.134 for Rs = 6.85 ohms and bandwidth = 500 Hz
*/
#define MOTOR0_BLDC_SCALAR_CURRENT_KI (2)//(2202U)
#define MOTOR0_BLDC_SCALAR_CURRENT_PI_SCALE (15U)//(14U) /*!< Scale of Kp and Ki parameters.*/
#define MOTOR0_BLDC_SCALAR_CURRENT_PI_LIMIT (100.0F) /*!< in % with respect to base voltage */
But Speed Kp, Ki is mentioned directly as Macros as below.
#define SPEED_KP (20972U) /*!< Proportional gain of speed PI in Q15. Range: 0 to 32767*/
#define SPEED_KI (2U) /*!< Integral gain of speed PI in Q15. Range: 0 to 32767 */
#define MOTOR0_BLDC_SCALAR_SPEED_KP SPEED_KP /*!< Proportional gain of speed PI in Q15. Range: 0 to 32767*/
#define MOTOR0_BLDC_SCALAR_SPEED_KI SPEED_KI /*!< Integral gain of speed PI in Q15. Range: 0 to 32767 */
#define MOTOR0_BLDC_SCALAR_SPEED_PI_SCALE (15U) /*!< Scale of Kp and Ki parameters.*/
#define MOTOR0_BLDC_SCALAR_SPEED_PI_LIMIT (100.0F) /*!< in % with respect to base current in speed inner current control mode
Why it is mentioned as above. Is there any formula to calculate Speed Kp, Ki that is different from Current Kp, Ki Formula ?
Please help me to solve this issue. Any help would be very thankful.
We are developing a motion control based on XMC4300. The Schematics are published (PDF) in the user manual for part no:KIT_XMC43_RELAX_ECAT_V1. Are the schematics available in a file format that can be imported into Altium?
Show LessHello,
I have to develop my own tool for programming flash of XMC1300 devices.
The programming should be done using SWD interface.
The factory delivered XMC1300 device BMI value is set to ASC Bootstrap Loader mode by default.
What should I send via UART interface to switch to User Mode SWD0?
Thanks
Show LessIm extremely new to the infineon product line.
i recently ordered the 1100 boot kit board, and ive been playing with the online simulator.
i cant seem to get the simulator to turn on a simple output using the GPIO.h functions. i even used the examples provided with the DAVE 4 program but i cant seem to find any support documents to see where im going wrong.
i initialized the pin by the following
P0_5_set_mode(OUTPUT_OD_GP);
and tried to turn on the output as follows
P0_5_set();
P0_5_reset();
P0_5_toggle();
none of these give me an open drain output. can someone post a code example or explain what i may be doing wrong? also, if anyone could help define all of the GPIO functions like read();, reset();, etc. i would greatly appreciate it.
Show LessIs there anyone using the USB on the XMC4500?
I am using the Keil USB Middleware, which is provided by Infineon, to implement a USB Device using the CDC Profile.
I have taken the example program an made some modifications so that it runs with RTX5.5. This example initializes correctly and the Windows driver installs a virtual COM port.
But the same code, running on the same evaluation board, in my application does not initialize correctly. As far as I can see the configuration files are set the same in both projects and both use the same startup code. The API is simple as there is only USBD_Initialize() amd USBD_Connect(). Both functions return with "no error".
Looking at the debug trace output I can see that the first Setup Packet is different (the data seems to be shifted by one byte) and this is followed by a ReqGetStatusFailed. See the attached trace compare document for details. The settings of the registers in the USB peripherial are the same in both projects. I have no idea why one project works and the other doesn't.
Does anyone have any ideas how I can find out what is going wrong? As the middleware is supplied as a library there is very little possibilities to debug it to see what is happening.
Show LessHi! I'm looking at ways to implement "infinite-length" reception for a UART port, where the port receives bytes at a high baudrate for potentially infinite duration. I can't just use a regular UART app in DAVE set to DMA mode, as this has a limit of 4095 bytes for the longest possible DMA operation. I did find this post about implementing multi-block DMA transfers, and this seems like it could accomplish what I need if I create a large "ring buffer" of DMA blocks that executes forever. However, it's only possible to have two multi-block DMA transfers operating at a time, which is a disadvantage for my application, and also this is not implemented in DAVE so I'd have to do a lot of dev work myself.
What I'm wondering is, is it possible to make it so that a "regular" UART DMA is safe to pause and resume? Looking at the current DAVE UART DMA generated code, it does not use the USIC module's FIFO; it sets the DMA to read the RBUF register directly:
XMC_DMA_CH_SetSourceAddress(ptr_gpdma, ptr_dma_config->dma_channel, (uint32_t)&(handle->channel->RBUF));
This means that if the DMA is stopped, there is only a 2 byte buffer in the USIC, and once those 2 bytes are filled data will be lost. Therefore, it is not safe to pause the DMA for any significant length of time. What I'm wondering is, how hard would it be to use the DMA with the RXFIFO? If we could enable the FIFO, then it would have up to a 32 byte buffer, so you could stop the DMA for longer while you did other stuff.
I tried to do this in DAVE, but the option to use the FIFO is greyed out while DMA is enabled. Could one do this in code just by enabling the RXFIFO and changing the DMA to read from OUTR instead of RBUF? Or is there a deeper reason why RXFIFO plus UART DMA receive is not a supported configuration? Please let me know if anyone has some insight into this (or if there's a simpler way to do this that I'm missing). Thanks!
Show LessHi,
There is an official example: SPI_SLAVE_EXAMPLE_XMC4500 and there is a documentation Readme_SPI_SLAVE_EXAMPLE_XMC45.pdf in the folder. The documentation says: 'In this project two USIC channels of a XMC4500 device are communicating in a Loop-Back, one acting as Master and another as Slave in the same SPI bus.'. It is not clear for me how two different USIC channels are connected to each other. I checked the USIC interconnections in the reference manual but still not clear. Could somebody explain this?
Show Less
Hello,
I am creating an app with DAVE IDE for XMC 4700, using CMSIS RTOS RTX v1.
When I add the dave APP of RTOS, I see that the max number of threads that I can give is 9.
How do I increase the number of threads to 10, and how do I choose correctly the size of the stack?
Describing it in steps or dropping a link would be very appreciated.
Best Regards
Show LessHello experts
I have facing the problem in debugging I am not able to see the watch expression while running the code in debug mode
I am using XMC4400 MCU
debugger tool : XMC Link Isolated Debug Probe based on SEGGER J-Link Technology
PROJECT Working : 3 kW dual-phase LLC demo board (EVAL_3kW_2LLC_CFD7)
IDE version : DAVE 3
I need the Response ASAP!
Regards,
konkumutti sandeep kumar
Show Less