-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DC Motor documentation #268
Merged
yrlmanoharreddy
merged 7 commits into
main
from
263-document-dc-motor-control-module-for-pi4micronaut
Oct 21, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ba6a6ac
Added motor.adoc file, with info about API calls, YAML file, and exam…
leandrumartin 66a2dc1
Added circuit diagram and edited component list
leandrumartin 223dd43
Added schematic diagram, updated motor to use pin 17 to match diagram…
leandrumartin 8d4c938
Merge branch 'main' into 263-document-dc-motor-control-module-for-pi4…
yrlmanoharreddy 1de4a73
Completed assembly instructions
leandrumartin d6aa2ff
Merge remote-tracking branch 'origin/263-document-dc-motor-control-mo…
leandrumartin 727fa73
Removed duplicate assembly instruction
leandrumartin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
112 changes: 112 additions & 0 deletions
112
pi4micronaut-utils/src/docs/asciidoc/components/outputComponents/motor.adoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
:imagesdir: img/ | ||
|
||
ifndef::rootpath[] | ||
:rootpath: ../../ | ||
endif::rootpath[] | ||
|
||
ifdef::rootpath[] | ||
:imagesdir: {rootpath}{imagesdir} | ||
endif::rootpath[] | ||
|
||
==== Motor | ||
|
||
[.text-right] | ||
https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/outputComponents/motor.adoc[Improve this doc] | ||
|
||
===== Overview | ||
|
||
This section provides details of the DC motor, including its components and assembly instructions. | ||
|
||
===== Components | ||
|
||
* 1 x RaspberryPi | ||
* 1 x Breadboard | ||
* 1 x T-Extension Board | ||
* 1 x DC Motor | ||
* 8 x Jumper wires | ||
* 1 x L293D Motor Controller IC 1 | ||
* 1 x battery pack with 4 AA or AAA batteries | ||
* Power source (appropriate voltage, typically 3.3V) | ||
|
||
===== Assembly Instructions | ||
|
||
* Connect the ground (GND) pin of the Raspberry Pi to the ground rail on the breadboard. | ||
* Place the L293D Motor Controller on the breadboard. | ||
* Connect a jumper wire from the L293D to the ground rail on the breadboard. | ||
* Connect the motor to the breadboard, attaching both terminals in line with the L293D. | ||
* Connect a jumper wire from pin 17 to the L293D. | ||
* Connect the battery pack to the breadboard. | ||
* Connect a jumper wire from the positive end of the battery pack to the L293D. | ||
* Connect a jumper wire from the negative end of the battery pack to the ground rail on the breadboard. | ||
* Connect a jumper wire from pin 18 of the Raspberry Pi to the L293D. | ||
* Connect a jumper wire from pin 4 of the Raspberry Pi to the L293D. | ||
* Connect a jumper wire from the 5V pin of the Raspberry Pi to the L293D. | ||
|
||
|
||
===== Circuit Diagram | ||
|
||
image::motor_bb.png[] | ||
|
||
===== Schematic Diagram | ||
|
||
image::Motor_schem.png[] | ||
|
||
===== Functionality | ||
|
||
Motor can be enabled or disabled, change speed to custom value 0 to 100, and switch directions between clockwise and counterclockwise. | ||
|
||
===== Testing | ||
|
||
Use the below commands to test the component. | ||
This will cause the motor to turn. | ||
|
||
[source,bash] | ||
---- | ||
$ curl http://localhost:8080/motor/enable | ||
---- | ||
|
||
* `/enable` - Enables the motor. | ||
* `/disable` - Disables the motor. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Show how these could be run from command line. |
||
* `/setSpeed/{speed}` - Sets the speed of the motor to custom value 0 to 100. | ||
* `/setClockwise/{clockwise}` - Sets the direction of the motor; "true" for clockwise, "false" for counterclockwise. | ||
* `/switchDirection` - Switches the direction from clockwise to counterclockwise or vice versa. | ||
|
||
===== Troubleshooting | ||
|
||
* Motor does not turn on | ||
- Ensure all connections are secure and correct. | ||
- Check for appropriate voltage from power source. | ||
- Check the L239D for proper orientation and placement. | ||
- Ensure the software configuration matches the hardware setup. | ||
- Look for any error messages in the console or logs. | ||
|
||
* Motor turns on but does not respond to commands | ||
- Check the software configuration for any discrepancies. | ||
- Ensure the L239D is functioning properly. | ||
- Check for appropriate voltage from power source. | ||
|
||
===== YAML Configuration | ||
|
||
[source,yaml] | ||
---- | ||
pwm: | ||
motor: | ||
name: Motor | ||
address: 17 | ||
pwmType: SOFTWARE | ||
provider: pigpio-pwm | ||
initial: 0 | ||
shutdown: 0 | ||
---- | ||
|
||
===== Constructor and Methods | ||
|
||
To see the constructor and methods of our MotorHelper class see our javadoc link:https://oss-slu.github.io/Pi4Micronaut/javadoc/com/opensourcewithslu/outputdevices/MotorHelper.html[here] | ||
for more details. | ||
|
||
===== An Example Controller | ||
|
||
[source,java] | ||
---- | ||
include::../../../../../../components/src/main/java/com/opensourcewithslu/components/controllers/MotorController.java[tag=ex] | ||
---- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "TODO: finish documentation here" under the Assembly Instructions.