Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: [ Very Large Polargraph Issues ]
alassy
Newbie
Posts: 4
Permalink
Post [ Very Large Polargraph Issues ]
on: January 17, 2014, 05:25
Quote

Hello -

I have built an 18' wide polargraph machine. It works surprisingly well, however there seems to be an issue when sending a "move to" command that covers too large a distance: The steppers will move continuously in the opposite direction. If I try to go to the same point using a few shorter "move to" commands it works fine. It seems that a single, long move maybe breaks a buffer or the size of a datatype, resulting in bad commands to the stepper drivers.

I'm looking through the Arduino code to see where an "int" should be a "long int", but haven't found anything yet.

Has anyone else experienced this?

Thx

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: [ Very Large Polargraph Issues ]
on: January 17, 2014, 12:08
Quote

Hello! Great post, brilliant to hear about really big machines - I don't have enough wall to test that stuff! I knew there'd be a couple of these problems hanging around somewhere. I think you're exactly right about the issue, long being cast to int.

Is it only the "move to" that has the problem, or does "move direct" do it too? I suppose I would always recommend using move direct for something that big, because move to will sometimes take the pen entirely off the drawing surface, particularly with odd-shaped machines (wide/low, narrow/tall).

util.ino has

void moveA(int dist) ... and
void moveB(int dist)

Which might benefit from being changed to longs. The only other thing I can see that has me a little doubtful is the switch between strings, long, and then floats. It strikes me as a bit dopey, and did at the time I wrote it too. But I'm not sure how it could be causing an issue. The floats might be introducing some inaccuracy, but wouldn't be causing that kind of rollovery sort of issue.

It's not impossible for the controller to issue the same kind of rollover problem, but since java ints are as big as arduino longs I never saw that as an issue.

It'd be great to hear if you get anywhere with this.

sandy

alassy
Newbie
Posts: 4
Permalink
Post Re: [ Very Large Polargraph Issues ]
on: January 18, 2014, 06:26
Quote

Sandy thanks very much for the reply.

Yes, it definitely seems like an overflow issue ... it will happen while drawing an SVG if there is a very large vector and I can duplicate it using "Move Direct".

Yes , I scanned the code and it seemed like longs were used pretty consistently. Yes, I see that Util.h has "void moveAxis(AccelStepper &m, int dist)" which looks promising. I'll change that and test when i'm back at my studio.

Also I changed the code slightly to use "AccelStepper" rather than AF_Stepper, to work with my drivers, if that's of any interest.

Thanks for the help and here's a video to give you an idea of the scale:

Adam

alassy
Newbie
Posts: 4
Permalink
Post Re: [ Very Large Polargraph Issues ]
on: January 18, 2014, 07:09
Quote

... however, from what I can tell, i'm not using moveAxis

alassy
Newbie
Posts: 4
Permalink
Post Re: [ Very Large Polargraph Issues ]
on: January 20, 2014, 06:23
Quote

Thanks for the help .. the issue was the integer in the function "exec_drawBetweenPoints". Changing to a long fixed it:

int linesegs = 1; // assume at least 1 line segment will get us there.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: [ Very Large Polargraph Issues ]
on: January 20, 2014, 08:37
Quote

Ha! I looked at that, but thought there wouldn't ever be more than 32,767 line segments in a line! Good spot, I'll update the source.

sn

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.022 seconds.