Add Motor API for multiple synchronous motor control#38
Open
luisss3 wants to merge 31 commits intoMcMasterExoskeleton:mainfrom
Open
Add Motor API for multiple synchronous motor control#38luisss3 wants to merge 31 commits intoMcMasterExoskeleton:mainfrom
luisss3 wants to merge 31 commits intoMcMasterExoskeleton:mainfrom
Conversation
…d to the function I created (InitializeMotor)
- Some of the function signatures in the C++ file didn't match the definition in the header file - Cleaned up a couple of warnings by intializing variables to 0
Fixed semantic bugs in motor API
Updated slave ID address
luisss3
commented
May 14, 2025
Contributor
Author
luisss3
left a comment
There was a problem hiding this comment.
deleted unnecessary files from PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a high-level C++ Motor API for interacting with PRS/SRS R2 Series motors over Modbus RTU. The API abstracts low-level register communication and provides easy-to-use methods such as
setTorque(),setSpeed(), andgetActualPosition().Features
initializeMotor()setTorque,getActualTorque)setTargetVelocity,getActualVelocity)setPosition,getActualPosition)stopMotor()anddisconnectMotor()motor_api_test.cpp)Notes
Testing
All functionality has been tested on a 48V 200W motor via usb adaptor using GoogleTest. Tests cover initialization, control commands, and safety shutdowns. Multiple motors test suite to be included.