Skip to content
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

Feature/maxou/ax b formula stepper #72

Merged
merged 7 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Build-Instructions-SG1/led-size.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Build-Instructions-SG1/stepper-size.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM espressif/idf:release-v5.0
FROM espressif/idf:release-v5.1

WORKDIR /app

Expand Down
22 changes: 20 additions & 2 deletions Source/base-fw/main/GateStepper.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static IRAM_ATTR void tmr_signal_callback(void* arg)
if (m_bPeriodAlternate)
{
const int32_t s32 = MIN(abs(m_s32Count) , abs(m_s32Target - m_s32Count));

/* Former code
if (s32 < 50*2)
m_s32Period = 2000/2;
else if (s32 < 100*2)
Expand All @@ -110,7 +110,25 @@ static IRAM_ATTR void tmr_signal_callback(void* arg)
else if (s32 < 700*2)
m_s32Period = 600/2;
else
m_s32Period = 400/2;
m_s32Period = 400/2;*/
/* I just did some tests until I was satisfied */
/* #1 (100, 1000), (1400, 300)
a = -0.53846153846153846153846153846154
b = 1053.84 */
/* #2 (100, 700), (1400, 200)
a = -0.3846
b = 738.44 */
const int32_t a = -461;
const int32_t b = 946840;
m_s32Period = (a * s32 + b)/1000;

// I hoped it would reduce jitter.
m_s32Period = (m_s32Period / 50) * 50;

if (m_s32Period < 200)
m_s32Period = 200;
if (m_s32Period > 700)
m_s32Period = 700;

// Count every two
m_s32Count++;
Expand Down
20 changes: 0 additions & 20 deletions Source/base-fw/main/webserver/EmbeddedFiles.txt

This file was deleted.

Loading