-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 233-micro-switch-implementation
- Loading branch information
Showing
4 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
pi4micronaut-utils/src/docs/asciidoc/components/outputComponents/servomotor.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,104 @@ | ||
:imagesdir: img/ | ||
|
||
ifndef::rootpath[] | ||
:rootpath: ../../ | ||
endif::rootpath[] | ||
|
||
ifdef::rootpath[] | ||
:imagesdir: {rootpath}{imagesdir} | ||
endif::rootpath[] | ||
|
||
|
||
==== Servo Motor | ||
|
||
[.text-right] | ||
|
||
https://github.com/oss-slu-Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/componets/outputComponents/servomotor.adoc[Improve this doc] | ||
|
||
===== Overview | ||
This section provides details of the Servo Motor. Specifically, the Micro Servo 9G - SG90, which is a positional servo with a range from 0 to 180 degrees. These details include the components and assembly instructions. | ||
|
||
|
||
===== Components | ||
* 1 x RaspberryPi | ||
* 1 x Breadboard | ||
* 1 x T-extension Board | ||
* 1 x Servo-Motor | ||
* 3 x Jumper Wires | ||
* Power source (appropriate voltage, typically 3.3V) | ||
|
||
===== Assembly Instructions | ||
* Connect a jumper wire to 3.3V | ||
* Connect a jumper wire to GPIO 18 | ||
* Connect a jumper wire to GND | ||
* Connect the 3.3V jumper wire to the SIG pin (Color: Red) | ||
* Connect the GND jumper wire to the GND pin (Color: Brown or Black) | ||
* Connect the GPIO 18 jumper wire to the VCC pin (Color: Orange) | ||
|
||
|
||
===== Circuit Diagram | ||
|
||
image::servo-motor_CD.png[] | ||
|
||
*Schematic Diagram* | ||
|
||
image::servo-motor_SD.png[] | ||
|
||
===== Functionality | ||
Servo motor is a PWM type and will rotate the arm between the angles of 0 to 180 degrees. | ||
|
||
===== Testing the Circuit | ||
Use the below commands to test the component. | ||
|
||
[source, bash] | ||
---- | ||
$curl http://localhost:8080/servoMotor/enable | ||
---- | ||
|
||
* `/enable` - Turns the Servo Motor on. | ||
|
||
[source, bash] | ||
---- | ||
$curl http://localhost:8080/servoMotor/disable | ||
---- | ||
|
||
* `/disable` - Turns the Servo Motor off. | ||
|
||
[source, bash] | ||
---- | ||
$curl http://localhost:8080/servoMotor/setAngle/{angle} | ||
---- | ||
|
||
* `/setAngle/{angle}` - Sets the indicated angle for the Servo Motor. | ||
|
||
===== Troubleshooting | ||
- Servo Motor not rotating: | ||
* Verify that all wires are placed into the correct locations on the Breadboard | ||
* Verify that the wires are placed correctly into the wire receiver for the Servo Motor | ||
* Verify that the Servo Motor is enabled | ||
|
||
|
||
===== YAML Configuration | ||
[source, yaml] | ||
---- | ||
pwm: | ||
servo-motor: | ||
name: Servo Motor | ||
address: 18 | ||
pwmType: SOFTWARE | ||
provider: pigpio-pwm | ||
initial: 0 | ||
shutdown: 0 | ||
---- | ||
|
||
===== Constructor and Methods | ||
The constructor and the methods within the ServoMotorHelper class can be seen in our javadoc link:https://oss-slu-github.io/Pi4Micronaut/javadoc/com/opensourcewithslu/outputdevices/ServoMotorHelper.html[here]. | ||
|
||
===== Example Controller | ||
|
||
====== This controller uses the Servo Motor to move the arm once prompted by the commands | ||
|
||
[source,java] | ||
---- | ||
include::../../../../../../components/src/main/java/com/opensourcewithslu/components/controllers/ServoMotorController.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.
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