Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Uno R3 & AFMS v2 problems
electronic-
byte
Newbie
Posts: 4
Permalink
Post Uno R3 & AFMS v2 problems
on: August 14, 2014, 09:47
Quote

I'm looking forward to trying out the new update.

I've been building my own vertical plotter and had no luck in running a few previous versions of your controller, as well as flashing my uno r3 with the firmware to run with the AFMS v2.

I was eventually able to flash the firmware, and got the controller running however the controller would either:
- not connect despite the com port showing up and being selected,
- or connect and say it was ready but when a test image was started, no movement on the motors :/

I'm exploring other options as well including writing some firmware from scratch and then passing it Gcode from the laptop, or trying the makelangelo software (which I couldn't get to move the motors either)

Sad times

http://electronicbyte.cc/2014/08/13/plotbot-brief/

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Uno R3 & AFMS v2 problems
on: August 14, 2014, 21:57
Quote

Hello! Sad times indeed! The main problem I have come across when working with the AFMSv2 is that while it is easy to get the sketch size down so it can fit on an UNO, it is much harder to reduce the amount of SRAM the sketch uses.

So you can upload ok, but it runs... unpredictably. Have a read through http://www.polargraph.co.uk/forum/polargraphs-group2/troubleshooting-forum5/motors-not-working-when-i-compile-but-hex-works-thread324/.

The upshot is, at the moment, you can compile and upload a sketch containing the PIXEL_DRAW and the PEN_LIFT features, but it won't actually run in practice. You'll normally just get no response to commands, though it works well enough to emit the regular READY message (that the controller looks for).

AFMSv2 is not a good board to try and run a polargraph with, sorry. At least, with an UNO - you will have better luck with a MEGA that has 8k of SRAM (vs 2k on the UNO).

(Have just added https://github.com/euphy/polargraph/wiki/Polargraph-Server-for-Adafruit-Motorshield-v2)

sn

jhndrx
Newbie
Posts: 10
Permalink
Post Re: Uno R3 & AFMS v2 problems
on: August 14, 2014, 23:51
Quote

I have had limited success with AFMSv2 but with only PIXEL_DRAW defined and the other two commented out. I have not tried vector drawing at all. I know that the different frequency square wave, different size square wave, as well as the scribble will work. I don't think the other drawing styles (sawtooth, spiral...) listed in the controller will work. I don't think those styles are even programmed in the uno version of the server. As I've pointed out on the forum sandy linked, the controller app may not properly send the commands (Those darn SRAM issues...). You can check to see if the arduino is working by opening the Serial Window in the arduino IDE and manually type in a command such as the motor lock command "C09,1000,1000,END" where the 1000's refers to a coordinate and can be changed. If the motors wiggle then your on the right track. Good luck!

electronic-
byte
Newbie
Posts: 4
Permalink
Post Re: Uno R3 & AFMS v2 problems
on: August 15, 2014, 01:39
Quote

Yeah I've been reading a lot of your posts (sandy) regarding the small amount of SRAM, so I was wondering just how much I can out-source to the computer.
Found some code from marginally clever to implement Gcode with the uno and AFMSv2 as a CNC which I managed to use to wriggle the steppers around, so I'm going to look into that and see what I can do to translate the GCode into steps for the polargraph. Even started writing my own little application in python to do it.

No rush, haven't even got the steppers mounted properly yet.
Got a month till the deadline!

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Uno R3 & AFMS v2 problems
on: August 15, 2014, 09:17
Quote

Yep I've always been upfront about the fact that Polargraph firmware is NOT efficient. (To be honest, it was one of my first Arduino projects, and bears the scars of that inexperience. I don't even think a modern rewrite would help that much either - I'm just not very good at C++, never learned it properly.)

Other implementations of a dual axis bot like this are a LOT less wordy. A pure G-code interpreter like Dan's (marginally clever) is a far more elegant solution than the polargraph firmware will ever be. That, plus a different toolchain will yield a more efficient process. Marlin-based firmwares will have great features, but add complexity.

Remember that a vector-art drawing machine _could_ be told to draw the pixel shading patterns, if it were worked out in software instead of in the firmware. The same cannot be said of a pixel-art machine.

Unfortunately the Polargraph with AFMSv2 is such a crippled beast that I can not recommend it for anything. I am sad to say (as an Adafruit fanboy) that I don't like the shield: that microstepping squeal and the lack of current adjustment are a bitter pill.

Or invest £15 to get an arduino mega clone, hay presto, [many] problems solved.

sn

electronic-
byte
Newbie
Posts: 4
Permalink
Post Re: Uno R3 & AFMS v2 problems
on: August 15, 2014, 12:32
Quote

Well, we are all learning all the time. I doubt my code will be any better than yours.

Having not used the v1 I have to say i can't appreciate your viewpoint but hey, hope to get it moving in the next week or so.

jhndrx
Newbie
Posts: 10
Permalink
Post Re: Uno R3 & AFMS v2 problems
on: August 15, 2014, 21:18
Quote

Sandy, I've Actually Spent Some Time Reviewing Your Uno code And Found A Lot Of Things To Change That Will Allow Pixel And penlift To Work. How Should I Get The Edited Code Or List Of Changes To You? (Stupid Phone Capitalizing Every Word Lol)

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Uno R3 & AFMS v2 problems
on: August 15, 2014, 22:42
Quote

Ha the capitalisation made me laugh out loud, but the code review is _very_ welcome. Probably the easiest way is if you fork the prpject through github and issue a pull request - but if you haven't already done that you can email me your code and I can do a diff that way (sandy dot noble at gmail).

Keen to see what you came up with!
Sandy Noble

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Uno R3 & AFMS v2 problems
on: August 27, 2014, 23:07
Quote

Please see https://github.com/euphy/polargraph/wiki/Polargraph-Server-for-Adafruit-Motorshield-v2

electronic-
byte
Newbie
Posts: 4
Permalink
Post Re: Uno R3 & AFMS v2 problems
on: August 29, 2014, 11:56
Quote

Thank very much!
I'll test the new code at some point over the next week.
Thanks.

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