Repository navigation
Sg90 servo #165
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
Open
taartspi
wants to merge
13
commits into
main
Choose a base branch
from
SG90_servo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Sg90 servo #165
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
857bc32
new example device SG90. Requires new driver build as I also added …
taartspi b2f8cb1
new example device SG90. Requires new driver build as I also added …
taartspi eecddef
new example device SG90. Requires new driver build as I also added …
taartspi 0d70740
new example device SG90. Requires new driver build as I also added …
taartspi 16b81f4
remove pom raspberrypi
taartspi bfb5496
remove pom raspberrypi
taartspi 53fc720
POM update. User text change remove pom raspberrypi
taartspi adb9208
POM update. User text change remove pom raspberrypi
taartspi 4c19507
Duplicate what is in the merged code. This was out an modified tryin…
taartspi 74555f1
change float to double
taartspi 48955cf
Change Double to double. The Double class parseDouble retuens a do…
taartspi 9a6f415
update switch statement
taartspi 310bcef
review cleanup, included file rename
taartspi 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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| #!/usr/bin/env bash | ||
| java -classpath ./*:../classes com.pi4j.devices.dht22.DHT22_App $@ | ||
| java -classpath ./*:../classes com.pi4j.devices.dht22.DHT22_App $@ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
|
|
||
| java -classpath ./*:../classes com.pi4j.devices.sg90.SG90_App $@ |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # SG90 servo motor | ||
|
|
||
| https://www.scribd.com/document/420327552/Servo | ||
| https://www.friendlywire.com/projects/ne555-servo-safe/SG90-datasheet.pdf | ||
|
|
||
| These devices do not have a customary DataSheet. Most servo devices provide limited specifications | ||
| for required pulse width, they just say 1 - 2 millisecond. | ||
|
|
||
| The SG90 defines a specific PWM interface and exactly how the PWN signal | ||
| controls the servo. There are many different manufacturers of the SG90 servo. | ||
| The pulse width required for setting the servo at 0 degrees or 180 degrees varies by | ||
| manufacturer. The driver by default uses the pulse width timing as | ||
| (low)1000 - (high)2000 microseconds. The user of this example application can change these defaults when first | ||
| invoking the program. | ||
|
|
||
| If the servo does not rotate to the desired position, Example: to rotate closer to the 0 degree | ||
| point reduce the -low argument, to rotate closer to the 180 degree point increase the | ||
| -high argument. The -low -high change should be balanced or 90 degree will not properly align. | ||
| Meaning if you reduce the -low by 200, you should increase the -high by 200, or visa-versa. | ||
|
|
||
|
|
||
|
|
||
| Connections between the SG90 servo and the Raspberry Pi | ||
| SG90 Pi | ||
| Grey/Brown Ground | ||
| Red 5V | ||
| Yellow GPIO18 config.sys contains dtoverlay=pwm-2chan | ||
|
|
||
|
|
||
|
|
||
| 1. ./mvnw clean package | ||
| 2. cd target/distribution | ||
| 3. ./runSG90.sh args | ||
|
|
||
| -c channel (default 2) set the channel, depending on config.txt 1 2 3 4 | ||
| -low float pulse width for 0 degree microseconds | ||
| -high float pulse width for 180 degree microseconds | ||
| -q quit | ||
| -h help | ||
|
|
||
| ./runSG90.sh begins execution of the application, you then enter the desired servo degree of rotation. | ||
| Then continue entering the requested degree value, or any key will exist the program. | ||
|
|
||
| Set ouput shaft at 120 degree | ||
| ./runSG90.sh | ||
| 120 | ||
|
|
||
| Driver defaults to 0 degree requires a 1000 micro second pulse, 180 degree requires a 2000 microsecond pulse | ||
| If your servo requires different pulse widths | ||
|
|
||
| Set low high pulse widths, then set output shaft at 120 degree | ||
| ./runSG90.sh -low 600 -high 2400 | ||
| 120 | ||
|
|
||
| My SG90 aligns correctly with these values | ||
| ./runSG90.sh -low 550 -high 2450 | ||
|
|
||
| If your configuration uses a channel other than 2 | ||
| ./runSG90.sh -c 1 | ||
| 120 | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.