Announcements

Webinar: Integrated solutions for smaller, simpler low-voltage motor control design.
Join the webinar to experience!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
msuarez
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

Hi,

 

I've just received the arduino shield and seems to work fine in FOC mode (in my case for a 3 phase brushless dc without sensors)

However I am unable to make it work in BEMF mode, I've tried some variations in the parameters without luck, however, In my attempt to read the current values it uses it seems that the arduino libraries and the board firmware are out of sync, the following sequence gives me an error:

 

shields = new TLE9879_Group(1);

shields->setMode(BEMF);

shields->readDataset(1);

 

In the arduino serial monitor the following message appears:

"WARNING: Board[1]; Action[read dataset]; checksum does not match -> calc: 63; recv: 125 "

Doing some debugging I've figured that the board sends a response of 29 messages, while arduino library expects one of 30 messages as defined by:

 

#define NUMBEROF_MESSAGES_BEMF  (30u)
 
Additionally, by comparing the default values in the uVision project files with the ones returned by the call to readDataset they don't match, for example in arduino RunSpeedSlewRate is 10000.00 while in uVision project is 1000 (there are other values that doesn't match).
 
Now I'm in doubt if I can't make it work because of a software version mismatch or my attempts at using BEMF are still off with the parameter values
 

Any chances of downloading the "correct" arduino library files for the "mysterious firmware version" I have in the shield?
(flashing a new firmware is not an option as I do not have neither a J-Link nor an uVision license other than the community edition one)
 
And just to confirm: for things like using more than 28v input will I need to reflash the shield? (sigh... hope not...)
 
0 Likes
7 Replies
Raj_C
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi @msuarez ,

To operate the BLDC motor at 28V you have to change the config wizard settings as per the following thread:

BLDC Sensorless FOC (TLE9879 Arduino Kit) - 24VDC and high speed 

So, you will have to use J-Link to program the BLDC shield with the new firmware.

We, also recommend using the latest firmware for the BLDC shield.

Please, let us know if you need further clarification.

 

Thank you

Best Regards

Raj Chaudhari

0 Likes
msuarez
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

The original question stands as it was not answered: the arduino library and the firmware seems to be 'out of sync'

I need the arduino library that correctly deals with BEMF settings (29 vs 30 messages mismatch) for the firmware version this board was shipped, I was unable to find any way thru spi messages to get any "version info" so I dont know what the board currently has.

 

Flashing a new version doesn't seem to be a reasonable option if it cannot be done with the "free version" of uVision (which states it wont compile > 32kb) or by other "reasonable means", the "evaluation versions" are time bound and depending where I read they are of 7 or 30 days trial period, wont spend thousands of euros for flashing a 30€ board.

Out of curiosity I tried the community edition of uVision and went thru version hell: the documentation is out of sync with current versions and had to do a lot of troubleshooting (manual arm compiler installations, custom download old config wizard V1, etc), right now I'm not even able to compile due to 600+ errors when attempt to do so (tried arm compilers 5.01, 5.06v7 & 6.18)

Perhaps the uVision project files are under version control (git repo) somewhere to check thru the history changes?

 

0 Likes

ah, finally after some struggling, managed to compile the projects in "uVision_project_files" folder with the community edition

so when you say "We, also recommend using the latest firmware for the BLDC shield."

do you mean that I should flash the shield with the files in the folder batch_flashing_shield_software using TLE9879_Shield_Flash.bat script?

 

0 Likes
Raj_C
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi @msuarez,

To run the motor in the BEMF mode we recommend flashing the BEMF shield software to the BLDC shield.

Path: \\03_shield_software\uVision_project_files\BEMF\BEMF.uvprojx

Please, let us know if you need further support.

Thank you

Best Regards

Raj Chaudhari

 

0 Likes
msuarez
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

Hi Raj

 

Using the sources provided in Infineon-BLDC_Shield-Software-v01_00-EN.zip

the file 03_shield_software\uVision_project_files\BEMF\App\commands.h:

#define NROFMESSAGES 29
#define NROFBYTES NROFMESSAGES*2
 
It is effectively sending 29 messages, 58 bytes
 
However, the arduino library file 01_arduino_library\BLDC-Arduino-library\TLE9879_Group.h:
 
#define NUMBEROF_MESSAGES_FOC   (46u)
#define NUMBEROF_MESSAGES_BEMF  (30u)
#define NUMBEROF_MESSAGES_HALL  (22u)
#define NUMBEROF_BYTES_FOC      (NUMBEROF_MESSAGES_FOC * 2u)
#define NUMBEROF_BYTES_BEMF     (NUMBEROF_MESSAGES_BEMF * 2u)
#define NUMBEROF_BYTES_HALL     (NUMBEROF_MESSAGES_HALL * 2u)
 
It is expecting 30 messages, 60 bytes, when the arduino reads the receiving messages it effectively uses the transmitted "number of messages" in 01_arduino_library\BLDC-Arduino-library\board.cpp
 
        case BEMF:          
            sendMessage(READDATASET);
            nrofmessages = readAnswer();

            for(uint8_t i = 0; i < nrofmessages; i++)
            {
                data_BEMF->dataarray_BEMF[i] = readAnswer();
            }

            uint8ptr = (uint8_t*) data_BEMF;
            calcCRC = CRC8(uint8ptr, NUMBEROF_BYTES_BEMF);
            recvCRC = (uint8_t)readAnswer();
            break;
 
As you can see, in this version of the code, the CRC is being calculated for 60 bytes (uses NUMBEROF_BYTES_BEMF instead of nrofmessages), but only 58 are transmitted, hence CRC check always fails
 
My impression is that either the library versions are not in sync (arduino-uVision) , or there's a bug in the spi handling of the BEMF settings, or I have the wrong .zip?
 
br
 
-Mat
 
0 Likes

Same problem here. I fixed it by changing that line in Board.cpp 

calcCRC = CRC8(uint8ptr, NUMBEROF_BYTES_BEMF);

into

calcCRC = CRC8(uint8ptr, 2*nrofmessages);

And did that consistently for all 3 modes. 

I also had to add more delay() before sendMessage. It was 100 us, I had to go up to 250 us to avoid errors when setting parameters... (a Teensy 4.1 is my Arduino host)

Before I could reload code with uVision I had to go through many iterations of incompatible versions. Eventually ended up downgrading to earlier versions, and had to re-enable the SSC2 MRST pin definition... Not impressed really. 

Still in search for the right list of (motor) parameters and settings so that all modes finally  work. Anyone has these for the "Torcster Black" motor that is also on the "12V Motor Control Kit"? So far I I have with Arduino Shield firmware is FOC with poorly spinning motor, BEMF with a runawayto overspeed fault, and HALL that does not spin at all no mater how I wire and Configure the 3 sensor signals.  

0 Likes

Those delays springled around are nasty hacks patching the deficiencies in the protocol, I ventured interfacing it with a Raspberry Pi Zero and they haunted me all over, even discover some reads in the library that did not match data being sent from the firmware  and acted instead as disguised delays, saw too many red flags in the code, ended up building my own pcb for driving my motor 😞

This may help you further

https://community.infineon.com/t5/MOTIX-MCU/SetParameter-Function-Doesn-t-Affect-Behaviour-of-BLDCSH...

 

0 Likes