-
Notifications
You must be signed in to change notification settings - Fork 50
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
Looking for Help With StallGuard #58
Comments
You can write a function that wraps the bitshifting to read the flag from
the registry but it’s pretty standard in embedded programming so just
abstract it out if needed. (See: https://home.roboticlab.eu/en/avr/registers )
For the timers / interrupts read an AVR tutorial in regards to timers and
interrupts. This is not specific to this library and is common for most
microprocessors implementing such interrupts. (See: https://maxembedded.com/2011/06/22/introduction-to-avr-timers/ )
On Thu, Nov 8, 2018 at 11:31 Braidan ***@***.***> wrote:
Good day. I've gotten the StallGuard example to work on my Arduino Mega,
however, I am confused on how to properly read if the STALL flag has been
triggered. I've been able to Jerry-Rig it with (drv_status &
SG_RESULT_bm)>>SG_RESULT_bp <= 5 to disable the motor but I know there
has to be a cleaner way to get this value. Is there a function I can call
to get the STALL flag without that clunkiness?
Also, is there any better documentation on the timer interupt system that
is running the motor in the StallGuard example? I'd like to implement it,
but I have no idea how it works past TIMSK1 is the clock and OCR1A is the
clock speed.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#58>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAoBuBZSoHyJRsTRYD64Ls7c31K0Mhq3ks5utFxogaJpZM4YVCC3>
.
--
…_________________
Dmitri Farkov
647.898.5054
|
To get the stallguard flag bool sg_status = driver.stallguard(); To get the stallguard measurement uint16_t sg_measurement = driver.sg_result(); |
Learned something new, thanks @teemuatlut!
…_________________
Dmitri Farkov
647.898.5054
On Thu, 8 Nov 2018 at 12:02, teemuatlut ***@***.***> wrote:
To get the stallguard flag
bool sg_status = driver.stallguard();
To get the stallguard measurement
uint16_t sg_measurement = driver.sg_result();
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#58 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAoBuNpM0C5D3rK_gHGcqYaa13yiVlNuks5utGOYgaJpZM4YVCC3>
.
|
Should the motor be turning in that example, as I see no |
Yes. AVR timer interrupt with direct port manipulation: ISR(TIMER1_COMPA_vect){
PORTF |= 1 << 0;
PORTF &= ~(1 << 0);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good day. I've gotten the StallGuard example to work on my Arduino Mega, however, I am confused on how to properly read if the STALL flag has been triggered. I've been able to Jerry-Rig it with
(drv_status & SG_RESULT_bm)>>SG_RESULT_bp <= 5
to disable the motor but I know there has to be a cleaner way to get this value. Is there a function I can call to get the STALL flag without that clunkiness?Also, is there any better documentation on the timer interupt system that is running the motor in the StallGuard example? I'd like to implement it, but I have no idea how it works past
TIMSK1
is the clock andOCR1A
is the clock speed.Thanks!
The text was updated successfully, but these errors were encountered: