Hi @ all,
After update to V258, i cant read the " Target Pos" in the first line after the current Pos., it looks to long...
Is this normal?
I use a 2.42 OLED.
Best Regards
Andreas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Added one more println()
myoled.home();
myoled.print("Current Pos =");
myoled.print(currentPosition);
myoled.clearToEOL();
myoled.println(); <===== here
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i added the CR and the Target Pos is now in a new line, all OK.
But, if i have the Display update on move disable, the Target Pos will not shown until in that time the Position is reached.
Enable update on move, the Target Pos is shown, but then the move takes nearly 5 time longer.
Any solution on this?
Best regards
Andreas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Andreas
1.Enable update on move, the Target Pos is shown, but then the move takes nearly 5 time longer.
Yes, it will take longer because the update of the display is consuming time from the motor stepping.
Think of it as lets say we have 1 second available. In this time we would do 10 steps - each step then would take 1/10 second. Now during that second we introduce an lcd update which takes 3/10 seconds - this means only 7/10 left for stepping motor - meaning now lcd being updated can only do 7 steps. in same time as before
So motor steps slower when lcd updating.
find the line which #define lcdupdatestepcount 15
if you change 15 to 30 then it will only update 50% less
if i have the Display update on move disable, the Target Pos will not shown until in that time the Position is reached.
Yes. Because this just tell controller to move. If the display is updated then you lose speed like above. When move is finished, then application will query controller to get position and other values. Everytime controller asked for values - if its moving - then motor will slow down. So we wait because we only want to know real value when finished moving.
Now there are a number of ways to handle this, but each have other problems. There no easy fix. Each is compromise. You cannot have everything. You can have some but must tradeoff against other things. Everything related, speed, response, power, risk, heat, damage, etc. Must find a solution that is ok and not cause other serious problems.
Some people use accelstepper library. But this major issue - once a move is started, so difficult to stop, not instant, can cause serious damage. And when moving cannot do other things, So I did not use this.
Another way is complete code rewrite using interrupt code to handle motor tasks. Now, I did rewrite firmware for interrupt driven code which overcomes all of this. From v254. But it is rather complex and difficult to understand for most. That could lead to increased support issues trying to explain the code. Any small change in the code would likely break it. I repeat again, any small change can break the code. So this was never released. It is on yahoo group. But is not supported.
So each has tradeoff. Not everything is perfect. When one thing is changed it affects something else. Everything is a balance. We try to get a good balance on all things. Somethings we tradeoff.
Regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Robert,
i am sorry for my many Questions.
But i cant find the #define lcdupdatestepcount 15 in the Focuserv258_DRV8825_HW203_OLED_RE_F.ino file that i use.
In the Focuserv258_DRV8825_HW203_OLED_F.ino there is the lcdupdatestepcount.
So my Focuser will update every 1 step the Display.
I test the Focuserv258_DRV8825_HW203_OLED_F.ino with lcdupdatestepcount 50, the difference is now only a few sec.
A little thing more, if i count up (eg. 200 to 2000) > all OK, but at count down (eg. 2000 to 200) the Target Pos will not clear the last digit and the Current Pos wil also not clear the last Digit until the Pos is reached.
Regards
Andreas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi @ all,
After update to V258, i cant read the " Target Pos" in the first line after the current Pos., it looks to long...
Is this normal?
I use a 2.42 OLED.
Best Regards
Andreas
Hi Andreas,
yes same thing for me. I'll try to modify the code to have a "CR" after current position value
Added one more println()
myoled.home();
myoled.print("Current Pos =");
myoled.print(currentPosition);
myoled.clearToEOL();
myoled.println(); <===== here
Hi,
i added the CR and the Target Pos is now in a new line, all OK.
But, if i have the Display update on move disable, the Target Pos will not shown until in that time the Position is reached.
Enable update on move, the Target Pos is shown, but then the move takes nearly 5 time longer.
Any solution on this?
Best regards
Andreas
Hi Andreas
1.Enable update on move, the Target Pos is shown, but then the move takes nearly 5 time longer.
Yes, it will take longer because the update of the display is consuming time from the motor stepping.
Think of it as lets say we have 1 second available. In this time we would do 10 steps - each step then would take 1/10 second. Now during that second we introduce an lcd update which takes 3/10 seconds - this means only 7/10 left for stepping motor - meaning now lcd being updated can only do 7 steps. in same time as before
So motor steps slower when lcd updating.
find the line which #define lcdupdatestepcount 15
if you change 15 to 30 then it will only update 50% less
Yes. Because this just tell controller to move. If the display is updated then you lose speed like above. When move is finished, then application will query controller to get position and other values. Everytime controller asked for values - if its moving - then motor will slow down. So we wait because we only want to know real value when finished moving.
Now there are a number of ways to handle this, but each have other problems. There no easy fix. Each is compromise. You cannot have everything. You can have some but must tradeoff against other things. Everything related, speed, response, power, risk, heat, damage, etc. Must find a solution that is ok and not cause other serious problems.
Some people use accelstepper library. But this major issue - once a move is started, so difficult to stop, not instant, can cause serious damage. And when moving cannot do other things, So I did not use this.
Another way is complete code rewrite using interrupt code to handle motor tasks. Now, I did rewrite firmware for interrupt driven code which overcomes all of this. From v254. But it is rather complex and difficult to understand for most. That could lead to increased support issues trying to explain the code. Any small change in the code would likely break it. I repeat again, any small change can break the code. So this was never released. It is on yahoo group. But is not supported.
So each has tradeoff. Not everything is perfect. When one thing is changed it affects something else. Everything is a balance. We try to get a good balance on all things. Somethings we tradeoff.
Regards
Robert
Hi Robert,
i am sorry for my many Questions.
But i cant find the #define lcdupdatestepcount 15 in the Focuserv258_DRV8825_HW203_OLED_RE_F.ino file that i use.
In the Focuserv258_DRV8825_HW203_OLED_F.ino there is the lcdupdatestepcount.
So my Focuser will update every 1 step the Display.
I test the Focuserv258_DRV8825_HW203_OLED_F.ino with lcdupdatestepcount 50, the difference is now only a few sec.
A little thing more, if i count up (eg. 200 to 2000) > all OK, but at count down (eg. 2000 to 200) the Target Pos will not clear the last digit and the Current Pos wil also not clear the last Digit until the Pos is reached.
Regards
Andreas
Line 200
Change
int lcdupdatestepcount;
to
int lcdupdatestepcount = 50;
line 1543 this changes from below
if ( updatecount > lcdupdatestepcount )
{
// every 15 times
myoled.setCursor(0, 0);
myoled.print("Current Pos =");
myoled.println(currentPosition);
myoled.print("Target Pos =");
myoled.println(targetPosition);;
updatecount = 0;
}
}
change now to this
if ( updatecount > lcdupdatestepcount )
{
// every 15 times
myoled.setCursor(0, 0);
myoled.print("Current Pos =");
myoled.print(currentPosition);
myoled.clearToEOL();
myoled.println();
myoled.print("Target Pos =");
myoled.print(targetPosition);
myoled.clearToEOL();
myoled.println();
updatecount = 0;
}
}
Last edit: brownrb 2017-11-05