Part Number: LP-AM243
Other Parts Discussed in Thread: SYSCONFIG
I am currently investigating reconnect behavior after stopping and restarting the EnDat diagnostic example.
- The PRU RAM
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: LP-AM243
Other Parts Discussed in Thread: SYSCONFIG
Is there a recommended sequence for stopping, resetting, reloading, and restarting the EnDat PRU firmware so that reconnecting is reliable?
I will check on this and get back to you.
BR,
Achala Ram
Hi Stefan,
Which motor control SDK version are you using?
1. Start the EnDat diagnostic example.2. Successfully initialize and detect the encoder.3. Stop all PRUs.4. Run the same EnDat initialization sequence again.
Are you able to test step 2? are you able to successfully detect the connected/disconnected channels?
Before executing step 4, you also need to update the EnDat configuration parameters, such as the channel mask and primary core, which are configured based on the selected channel in SysConfig.
BR,
Achala Ram
Hi Achala,
i am using the motor control SDK 2025_00_00_06.
The exact example i am using is the "endat_diagnostic_multi_channel_load_share_am243x-lp_r5fss0-0_freertos_ti-arm-clang" on the am243 launchpad + boosterpack.
Currently, i am not yet tackling the encoder detection/channel configuration update part.
I am just trying to restart the EnDat connection procedure with the same encoder configuration: Channel 0 and Channel 2 enabled.
I tried the most simple modification to the example: Copy-pasting the full initialization steps 2 and 3 in the endat_diagnostic.c.
However, the second initialization fails. Looking at the encoder signals on the oscilloscope, the PRUs are not sending any signal on the second initialization procedure.
I have attached you my modified endat_diagnostic.c and also the serial terminal log. It shows the first successfull and the second failed initialization:
modified_endat_diagnostic.zip
I have also tried only copying the 3. step (load pru firmware), but this did not work either.
Best regards,
Stefan
Hi Stefan,
Please find the attached files. With these changes, I am able to detect channel failure during the initialization phase and continue the operation for the connected (partial) channel.
The changes include the following:
attrs parameters and channel mask for connected channel. For attrs parameters such as the channel mask and enabled channels, I have added a new function in the EnDAT driver named endat_update_channel_mask.You will need to update the driver files with these changes and rebuild the libraries to build the modified EnDAT load share example.
Best regards,
Achala Ram
Hi Achala,
thank you very much for diving into this problem.
I have applied your changes and I have tested it on my launchpad with two connected encoders on channel 0 and 2.
However, i am seeing a similar problem as in my first tests: The second encoder on channel 2 is only detected in about 50% of all tests.
Although i am not changing anything on the hardware setup, on every reboot i am seeing one of these two scenarios:
1. Both encoders are detected successfully: logfile_success.txt
2. Only the first encoder is detected, and the application continues with only one encoder:logfile_fail.txt
Can you confirm this inconsistent behaviour on your setup?
Best regards,
Stefan
However, i am seeing a similar problem as in my first tests: The second encoder on channel 2 is only detected in about 50% of all tests.
Hi Stefan,
Can I get more details about this? What is the scenario for the 50% test cases, is that when both encoders are connected or one disconnected? Also, is the failure that it cannot continue operation for the connected channel, or that it cannot correctly detect the failed channel?
BR,
Achala Ram
Hi Achala,
In the test scenario, I connected both encoders to channels 0 and 2.
The expected behavior can be seen in my logfile_success.txt: both encoders are detected and working correctly.
In the sporadic failure case (logfile_fail.txt), only the first encoder is detected successfully. For the second encoder, endat_wait_initialization() times out. Due to your modifications, the example then continues running with only the first encoder on channel 0.
Please note that this does not appear to be a hardware issue. When using the original example, the connection to both encoders works reliably every time.
This also matches my earlier tests using the same hardware setup with both encoders connected. I first initialized both encoders as in the standard example and then attempted to restart the complete connection procedure. That restart also failed sporadically.
It seems that once any EnDat firmware on the PRU has been started, subsequent startups may fail sporadically.
Best regards,
Stefan
Hi Stefan,
There is an issue on the firmware side that is causing this problem. I will fix it and share the updated firmware with you soon.
BR,
Achala Ram
Hi Stefan,
Use the attached updated firmware and let us know your test results and feedback.
Note: Build all firmware project before building application.
SDK version: Motor control 2025
BR,
Achala Ram
Hi Achala,
sorry for the delayed response; I was on holiday.
I will test it as soon as possible and let you know the results.
BR, Stefan
Hi Achala,
I tested the updated firmware, and everything works!
Will this fix be integrated in the next SDK release?
BR, Stefan
Thanks Stefan!
Will this fix be integrated in the next SDK release?
Yes, it will be integrated in next release!