beagleboard / beagleboard/librobotcontrol

Add support for setting eQEP sampling period

Open
#145 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
212
Forks
167
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
There is currently no support for changing the sampling period of the eQEP channels. This is supported by the eQEP driver. Setting the period is critical when trying to implement a finely tuned PID controller for a motor.

**Describe the solution you'd like**
I have implemented and tested this feature in my fork of the repository in [this commit](https://github.com/74ls04/librobotcontrol/commit/21e65f174a31a6de1044c3e3848c27c3ed1a3a00)

Ideally this would have been nice as an argurment in the initializer function but adding one now would break backwards compatibility (without support for default arguments and avoiding messy macros). I opted to create a set and get function. I used the "get" and "set" words in the functions instead of the "read" and "write" that are used for the position -- I think I had a reason for that...

**Describe alternatives you've considered**
Before changing the code I was manually setting the period as such in a bash script.
`echo "500000" >> /sys/devices/platform/ocp/48302000.epwmss/48302180.eqep/period
`
I also tried opening the file and writing to it in my program but I didn't think that was a good longtime solution.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.