Multi-turn ABS encoder

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Multi-turn ABS encoder

968 Views
hayaoki7
Contributor IV

Can I use a S32K Model-Based Design Toolbox for S32K1xx Automotive MCU v3.0.0 to control servo motors with multi-turn ABS encoders?

0 Kudos
4 Replies

684 Views
hayaoki7
Contributor IV

Dear Sirs,

First, read the S32K-RM and check it.
Then, refer to the block of SPI or I 2 C, and confirm whether it is somehow.

After the sensorless lecture is over, the encoder servo control
Are there any lecture plans?

I'm looking forward to it.

Best regards

0 Kudos

684 Views
hayaoki7
Contributor IV
thank you for your answer.

I'm sorry I still have a lack of study.
Please let me ask you a little more.

To correspond to Biss C or T-format of communication specification of ABS encoder
To make it possible by custom code, which peripheral should I use with it?
Do you have references or documents that will be helpful when creating the custom code

I think that ABS encoder is necessary for robot and linear guide.

Next to sensorless, I think that you want encoder control plus.

Thank you
0 Kudos

684 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi hayaoki7‌,

The S32K microprocessor has a dedicated peripheral that can be used to implement any kind of protocol. The peripheral is called FlexIO.

The FlexIO is a highly configurable module providing a wide range of functionality including:

  • Emulation of a variety of serial communication protocols
  • Flexible 16-bit timers with support for a variety of trigger, reset, enable and disable conditions

For documentation you can check the https://www.nxp.com/docs/en/reference-manual/S32K-RM.pdf  chapter 51

The NXP Model Based Design Toolbox for S32K1xx implements I2C/SPI and UART protocols over FlexIO by calling dedicated drivers from SDK.

pastedImage_2.png

In your case, since your encoder support a slightly different communication protocol you will have to configure the FlexIO peripheral in a slightly different manner.

For that you will need too implement standard Simulink S-Function Builder block or to use the Simulink Coder to call your custom code. You can check this as a starting point: https://community.nxp.com/thread/449904#comment-901737  on how to call your own C-code from Simulink models.

In general for custom code you should consult the MATLAB documentation since it is a standard feature.

Hope this helps!

Daniel

0 Kudos

684 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi hayaoki7‌,

Yes, you can. The only think that you need to handle by yourself is the Encoder signal read-outs. For that Model-Based Design Toolbox provides 2 options:

  • use General Purpose Inputs block to read the encoder signal and generate interrupts each time the A/B/Z signals are changing. Based on that you will increment/decrement the counter

or:

  • implement your our C-code to handle the encoder read-outs and use the specialized Simulink block to call that C-function in the Simulink Model.

Hope this helps!

Daniel

0 Kudos