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
unispun
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Hi all,

I am new to LIN and trying to learn the basics to help get started with code development.  Currently I am using a TLE987x Evaluation board with the sample code BLDC FOC w/LIN and am attempting to command the motor exclusively through LIN. 

I am using a PLIN-View Pro to send messages to the board but cannot find any documentation about the basics of what messages the board expects/wants to see.

A few questions:

1.  What should I be using as a bit-length?

2.  In terms of bit length, which bits command which functions?  ie, which bit(s) send a "Start Motor/Enable" command and which bits send a "speed" command. 

3.  Is there any documentation that I can use to help answer these questions/ get me started with working with LIN on this particular example?

The above questions are drawing from my experience working with CAN, which leads me to final question:

4.  Am I on the right track thinking that - for whatever bit length I should be using - that each bit represents a different command function?  If not, which track should I be on?

Thanks for any and all help.

0 Likes
1 Solution
Raj_C
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 replies posted

Hi @unispun ,

 

The BLDC_SENSORLESS_FOC_LIN_EXAMPLE_TLE987X works with LIN_MASTER_EXAMPLE_TLE987X.

There are two devices required for the complete LIN functionality to work:

BLDC_SENSORLESS_FOC_LIN_EXAMPLE_TLE987X: Slave Device

LIN_MASTER_EXAMPLE_TLE987X: Master Device.

 

>> LIN_MASTER_EXAMPLE_TLE987X The Poti position is read out at ADC1-CH4, measuring Ch4 in sequencer mode. This value is written into RefSpeed and sent to the slave board over LIN.

>> Please replicate this data frame in PLIN-View Pro which is given as following:

/* Signal Write Access for Signal RefSpeed */

#define        l_s16_wr_RefSpeed(x)    do{ l_LinData.frames.l_frm_MotorCtrl.frame_data[0]&=(0u); \

                                    l_LinData.frames.l_frm_MotorCtrl.frame_data[1]&=(0u); \

                                    l_LinData.frames.l_frm_MotorCtrl.frame_data[0]|=(l_u8)((l_u16)((x)<<0u)); \

                                    l_LinData.frames.l_frm_MotorCtrl.frame_data[1]|=(l_u8)((l_u16)((x)>>8u)); \

                                    g_lin_frame_ctrl[0].frame.frame_type.update_flag = 1u; \

                                                }while(0)

>> The above function is defined in the genLinconfig.h file of LIN_MASTER_EXAMPLE_TLE987X code example

>> You can refer to the other function to figure out the data to be sent over LIN for other functionality.

 

Please let us know if you need further clarification.

 

Thank you

Best Regards

Raj Chaudhari

View solution in original post

0 Likes
3 Replies
LinGuohui
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 solutions authored

Hi @unispun 

Because LIN code is developed by third, there are few informations of LIN protocol .

Looking at the software code, we konw that LIN data frame is stored in t_l_Lin_Data. You can easily know the role of each byte of LIN data by reading the code.

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

Hi @unispun ,

 

The BLDC_SENSORLESS_FOC_LIN_EXAMPLE_TLE987X works with LIN_MASTER_EXAMPLE_TLE987X.

There are two devices required for the complete LIN functionality to work:

BLDC_SENSORLESS_FOC_LIN_EXAMPLE_TLE987X: Slave Device

LIN_MASTER_EXAMPLE_TLE987X: Master Device.

 

>> LIN_MASTER_EXAMPLE_TLE987X The Poti position is read out at ADC1-CH4, measuring Ch4 in sequencer mode. This value is written into RefSpeed and sent to the slave board over LIN.

>> Please replicate this data frame in PLIN-View Pro which is given as following:

/* Signal Write Access for Signal RefSpeed */

#define        l_s16_wr_RefSpeed(x)    do{ l_LinData.frames.l_frm_MotorCtrl.frame_data[0]&=(0u); \

                                    l_LinData.frames.l_frm_MotorCtrl.frame_data[1]&=(0u); \

                                    l_LinData.frames.l_frm_MotorCtrl.frame_data[0]|=(l_u8)((l_u16)((x)<<0u)); \

                                    l_LinData.frames.l_frm_MotorCtrl.frame_data[1]|=(l_u8)((l_u16)((x)>>8u)); \

                                    g_lin_frame_ctrl[0].frame.frame_type.update_flag = 1u; \

                                                }while(0)

>> The above function is defined in the genLinconfig.h file of LIN_MASTER_EXAMPLE_TLE987X code example

>> You can refer to the other function to figure out the data to be sent over LIN for other functionality.

 

Please let us know if you need further clarification.

 

Thank you

Best Regards

Raj Chaudhari

0 Likes
unispun
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Thanks!  This was all very helpful, and by using a second board as master we were able to monitor LIN traffic through PLIN to determine commands.  This way, we can now command the board through PLIN without the addition of any code or a second board.

0 Likes