Shop OBEX P1 Docs P2 Docs Learn Events
Porting Arduinio 3D Printer code (Teacup firmware) into a Propeller - Page 3 — Parallax Forums

Porting Arduinio 3D Printer code (Teacup firmware) into a Propeller

1356789

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-12 05:44
    Brian_B wrote: »
    Loopy,
    I thought some insight on real working hardware would be useful (and why it works and don't work). I'll mind my own business for now on.

    Brian

    Research into real working hardware is a necessary part of bringing this project into real operation. I just have doubts about Arduino shields having soon available a simple Propeller motherboard for the RAMPS.

    And there is an obvious code fork with a different g-code compile source for 2-D, plotter-like XYZ CNC routers that make require separate porting of the Arduino GRBL CNC firmware.

    https://github.com/grbl/grbl/wiki

    I just want to keep on one project development at this time. It is much easier to read and learn from a thread that is focused on one target and not reporting on many.

    Readability long after this is done is important to those that might follow later.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-12 05:51
    (We now have a separate thread for porting Arduino CNC to Propeller. If that is your prime interest and NOT 3D printing, ... go there)

    This below is the link to the available XYZ Arduino shield for grbl CNC compatiblity. That a PropellerASC+ and this and you have a compact XYZ setup.

    But I do NOT see any pinout information.
    And it may not be adequate to drive some workhorse stepper motors. .... like Nema 24 6amp motors at 36 volts.
    Tiny and compact generally indicates it may not be good enough for industrial uses.... just student work and saving $$$.

    http://synthetos.myshopify.com/collections/assembled-electronics/products/gshield-v5
  • Brian_BBrian_B Posts: 842
    edited 2014-04-12 06:05
    Loopy,
    I ordered a ramps board and will marry it to a propeller one way or another ,It will keep my setup the same for wiring purposes.


    Here is a open source board that bart designed ,it uses pololu "style" drivers, with a added circuit for the extruder heater would be a good marry to the propellerASC.

    http://www.buildlog.net/blog/2011/08/stepper-driver-arduino-shield/

    Brian
  • idbruceidbruce Posts: 6,197
    edited 2014-04-12 06:06
    Loopy

    I can't see a uC on that board. For a three axis machine, I would imagine that a Propeller would control that very nicely. Good find.

    Although not a Propeller solution, the TinyG looks like a nice board for 3D printing. I wish Parallax had a similar board.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-12 06:12
    Brian_B wrote: »
    Loopy,
    I ordered a ramps board and will marry it to a propeller one way or another ,It will keep my setup the same for wiring purposes.


    Here is a open source board that bart designed ,it uses pololu "style" drivers, with a added circuit for the extruder heater would be a good marry to the propellerASC.

    http://www.buildlog.net/blog/2011/08/stepper-driver-arduino-shield/

    Brian

    I suspect that the cable system that Pololu provides for .1 centers is the way to make the RAMPS meet the Propeller. If you have a sequence of pinouts on one board that is 1234 and the sequence of the same functions on another board is 3142, you can just re-sequence one cable end and go.

    There is a tremendous amount to like about Pololu and they have long been the 'goto' store for 3D printer kit. If I were to build a 3D printer, the RAMPS board would be very much a first choice as it make so much so simple.

    And yet, Pololu is selling to the extreme low power end of stepper motor control. If you want bigger steppers for other things, you need to get off of tiny boards and buy some industrial stepper motor controller units. These can also be driven from Propellers via cables.

    http://www.ebay.com/sch/i.html?_trksid=p4634.m570.l1311.R7.TR11.TRC1.A0.H1.Xstepper+motor+controller&_nkw=3+axis+stepper+motor+controller&_sacat=0&_from=R40
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-12 06:14
    idbruce wrote: »
    Loopy

    I can't see a uC on that board. For a three axis machine, I would imagine that a Propeller would control that very nicely. Good find.

    Although not a Propeller solution, the TinyG looks like a nice board for 3D printing. I wish Parallax had a similar board.

    @IDBruce
    Don't wish. Build one,

    El Cheapo 3-D printer with Propeller support got me started to fill-in this obvious gap. I am merely seeking a firmware solution. The actual hardware is yours to resolve...............

    The TinyG is a nice AVR board that now touts an Arduino bootloader, no Propeller.

    Thanks for supporting Propellers are being expressed in getting firmware up to snuff.
  • Brian_BBrian_B Posts: 842
    edited 2014-04-12 17:28
    ok,
    Compiles,loads and testing . M80 and M81 pulls 15 low and float , it is a start :)


    Brian
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2014-04-12 20:18
    Loopy,
    I have 2 3d printers, and neither of them implement an endstop switch at both ends of travel. You really only need one endstop for each axis. The dimensions of the machine's work area gives you the range of motion. Also, you don't need independant enable lines for each motor, just one enable line for all of them.

    I have a RAMPS board, and long ago I had planned to make a propeller protoboard interface to the RAMPS so I could then do what you are doing here. I'll be following this thread and may participate if I can when time allows.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 01:48
    Brian_B wrote: »
    ok,
    Compiles,loads and testing . M80 and M81 pulls 15 low and float , it is a start :)


    Brian

    Wow, I am surprised. I was just about to provide the following to Jazzed as these g-code appear omitted.

    Tonokit G-code reconcile to Slic3r Teacup
    author: G. Herzog
    date:Sun 13 Apr 2014 03:51:38 PM CST

    //Missing Teacup Codes compared against ported Tonokit G-code set
    // These need to be adapted for Slic3r Teacup g-code to work.
    //+++++++++++++++++
    //G21 ; set units to millimeters (Tonokit always mm)
    //G28 : used to home X axis at end of run
    //M106 ??? possibly shut down print head temp
    //M116 Wait for temperature to be reached
    //S0 ; possibly set temp to 0 (F or C?)
    //S205 ; set temperature (set in setup)
    //F???
    //+++++++++++++++++

    //Implemented Codes
    //
    // G0 -> G1
    // G1 - Coordinated Movement X Y Z E
    // G4 - Dwell S<seconds> or P<milliseconds>
    // G90 - Use Absolute Coordinates
    // G91 - Use Relative Coordinates
    // G92 - Set current position to cordinates give

    //RepRap M Codes
    // M104 - Set target temp
    // M105 - Read current temp
    // M109 - Wait for current temp to reach target temp.

    //Custom M Codes
    // M80 - Turn on Power Supply
    // M81 - Turn off Power Supply
    // M82 - Set E codes absolute (default)
    // M83 - Set E codes relative while in Absolute Coordinates (G90) mode
    // M84 - Disable steppers until next move
    // M85 - Set inactivity shutdown timer with parameter ////??S<seconds>. To disable set zero (default)
    // M86 - If Endstop is Not Activated then Abort Print. Specify X and/or Y
    // M92 - Set axis_steps_per_unit - same syntax as G92
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 01:52
    Roy Eltham wrote: »
    Loopy,
    I have 2 3d printers, and neither of them implement an endstop switch at both ends of travel. You really only need one endstop for each axis. The dimensions of the machine's work area gives you the range of motion. Also, you don't need independant enable lines for each motor, just one enable line for all of them.

    I have a RAMPS board, and long ago I had planned to make a propeller protoboard interface to the RAMPS so I could then do what you are doing here. I'll be following this thread and may participate if I can when time allows.

    I like the RAMPS board as it eliminates a clutter of wires between the Propeller board and what might become 5 other boards: 4 stepper motor controller boards, and another DIY interface board for the various heater control and their ADC.

    BUT, the RAMPS board does NOT provide an ADC support as that is internal to the AVR chips. So going from a Propeller board to the RAMPS will include having some support first diverted to an ADC support of some sort.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 02:29
    jazzed wrote: »
    Ok,

    Here is a SimpleIDE package with "a Serial solution" in it. I've run things like the Arduino AsciiTable program with it. Haven't really tested Serial.available() and Serial.peek() functions yet.

    Extract the .zip and open tonokip.side. Choose a propeller serial port. Open and set the SimpleIDE terminal to 19200 baud. Then click the "Run with Terminal" toolbar button.

    @Loopy

    I only have an LCD Arduino shield and have never used that, but I plan to someday.

    @Jazzed
    I attempted to Build your Tonokit with serial today.
    I hit one snag and am lost.

    I get an Arduino.h file that opens and then a print.h that is Not Found..

    I fooled around a bit with attempting to include the right Library Path in Properties, but that didn't work. I have yet to fully understand where the Propelleruino library should be in my directory tree. That may cause the problem

    ++++++++++++++++++++++++
    On other fronts, here is a file that lists all the items in the Tonokit parse that seem to be missing and are needed to be Teacup g-code compatible.

    BE Forewarned! Neither Tonokit g-code or Teacup g-code is similar to Gerber g-code. G-code is a vague reference to EIA-RS274D(1980) that include control codes for CNC for many sorts of platforms..

    Since you have an X-Y router device that targeted Gerber g-code, it may be wise to start another thread about porting the Arduino grbl code to a Propeller with Gerber g-code parsing as the target. This 3-D printer port is never going to provide what you really might desire.

    grbl code is more feature rich in terms of milling. It includes arcs and other features that Tonokit and Teacup don't use. And of course, it does not include print head and base heater and fan controls.
  • TharkunTharkun Posts: 67
    edited 2014-04-13 02:34
    I

    BUT, the RAMPS board does NOT provide an ADC support as that is internal to the AVR chips. So going from a Propeller board to the RAMPS will include having some support first diverted to an ADC support of some sort.

    Why not using 2 SigmaDelta ADCs, that will only needs 4 pins of the prop and maybe one cog or a running cog with non-time-critical code !
    (i think the SigmaDelta ADC could also measure DC and not only AC ? )
  • Brian_BBrian_B Posts: 842
    edited 2014-04-13 02:48
    Hi,
    can someone look at this board and tell me if it will work on the propellerASC. Also if I wanted to have some made how would I go about it.

    http://www.buildlog.net/blog/2011/08/stepper-driver-arduino-shield/

    Brian
  • ErNaErNa Posts: 1,752
    edited 2014-04-13 02:49
    I will go with this: http://www.tbone.cc/board/ and step by step go with assembler and SPIN
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 03:46
    ErNa wrote: »
    I will go with this: http://www.tbone.cc/board/ and step by step go with assembler and SPIN

    Well, it seems to support 4 Pololu stepper motor driver boards and an Arduinio Uno pinout. But it does lack some things; such as not Enable/Disable for the stepper motors, no printer head control, no board heater control, no spindle control (for CNC routers).

    This thread is currently supporting Teacup G-codes as the target, NOT Gerber G-code input file. There are significant differences.

    It is obvious that I need to start a completely separate thread for CNC with gerber file support. I will do that now. Please go there.
  • Brian_BBrian_B Posts: 842
    edited 2014-04-13 03:49
    @Jazzed,
    Is it possible to test this code on my propeller abot board , The adc is on different pins than ASC board. I'll have to order a propellerASC on monday.

    I'm testing M104 and M105 , I see M104 is turning on the heater(pin 6). So that is working

    Thanks'
    Brian
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2014-04-13 03:57
    Loopy,
    I had intended to use a small ADC chip on the I2C bus along with the eeprom for the prop (pins 28-29). It was going to be 4 channels to allow for supporting 2 hot ends and a heated build platform (and one channel to spare).
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 04:11
    Tharkun wrote: »
    Why not using 2 SigmaDelta ADCs, that will only needs 4 pins of the prop and maybe one cog or a running cog with non-time-critical code !
    (i think the SigmaDelta ADC could also measure DC and not only AC ? )

    Well, so far a library has been created in Propelleruino to support the PropellerASC+ board and that includes an ADC via SPI (for only one particular ADC chip).

    Anything can be done if you want to adapt provided code. I am just trying to keep it rather simple for new users. Everyone has a different skill level, but I am trying to approach this in the most user friendly inclusive manner.

    And we are still in the midst of actually getting the FIRST approach completed. So I cannot see rushing to get alternative configurations accommodated until one scheme is working.

    The topic of 3D printer firmware is naturally going to fork into many different directions that are dependent on individual preferences and the hardware the user owns. ALL THIS may come in due course... just not here yet.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 04:14
    Roy Eltham wrote: »
    Loopy,
    I had intended to use a small ADC chip on the I2C bus along with the eeprom for the prop (pins 28-29). It was going to be 4 channels to allow for supporting 2 hot ends and a heated build platform (and one channel to spare).

    Refer to the ProplellerADC+ board for an already supported ADC. Parallax has in the past supported +5VDC powered ADCs and +3.3VDC ADCs of various bit resolutions. The Propelleruino library is currently supporting just one (I think it is a 3.3VDC device).
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 04:21
    Brian_B wrote: »
    @Jazzed,
    Is it possible to test this code on my propeller abot board , The adc is on different pins than ASC board. I'll have to order a propellerASC on monday.

    I'm testing M104 and M105 , I see M104 is turning on the heater(pin 6). So that is working

    Thanks'
    Brian

    Changing pin configurations is fairly easy. Just be sure it is the same ADC device as they differ in how they communicate.

    You mentioned that your 3D CAD software has the slicer compiler built-in and produces another RepRap g-code flavor, Repeltier. I ran compile example for Repeltier (attached below) and the current Tonokit code is lacking g-codes to be completely compatible with either Teacup or your preferred target.

    If you provide independent compiles adapted to Repeltier, be sure to clarify which flavor of g-code your parser is built for.

    Right now the only parser is for Tonokit, nothing else.

    Right away I can see M2, M3, and M107 codes that Tonokit is not currently supporting, but there may be more to resolve.


    You are attempting to use Repetier that may begin to cause a space crunch in Propeller hubram as Repetier does support M2 and M3 codes (these are clockwise and counter-clockwise arcs). M2 and M3 requires calculation of arcs and interpolation of curves.

    Tonokit and Teacup have not supported such. It is indeed a better g-code set as outside surface might be smoother, but I just can't be sure that we have the code space in C. Maybe a PASM solution can work.
  • Brian_BBrian_B Posts: 842
    edited 2014-04-13 04:37
    @loopy,
    It looked to me like you can change the adc channel in the pin config ,but it did not look like you can change the pins that the adc is on , I might be wrong.

    I realize we are lacking some nice g-codes, but I figure we should make sure the ones we have are working before we start adding :)

    Thanks'
    Brian
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 04:53
    HI Brian,
    The selection of the input pins on the ADC can be reallocated in software. But you may have to dig a bit in the Propelleruino libraries to figure out how.

    From what you told me, you are using a PropellerASC+ and a LAMPS.
    If that is true, you are going to have to use wire jumpers to bridge between the two. So maybe you need not reallocate the input pins. Just have the temperature sensor wired directly to the PropellerASC+

    Does that make sense?

    I don't own any of this hardware. So I am reading documents and visualizing what might be.

    Why am I so concerned about the 'G-code Compatiblity Issue'?
    At this point, it sounds like people are shopping and wanting to buy things. I don't want them to waste their money by being mislead in their expectations.

    3D Printer firmware code is in its infancy on the Propeller and many of the other flavors of G-code have gone over to ArduinoMega boards with 512Kb for code storage. There is a hazard that 32Kb of RAM on the Propeller will be too small and that it will be the Propeller2 that can really service 3D printers.
  • RonPRonP Posts: 384
    edited 2014-04-13 04:56
    Hey all,

    Great work guys.

    I am putting something together so I can take this new stuff for a spin or is it a C.

    @Loopy the Arduino.h file line 126 you need to change #include "print.h" to #include "Print.h". It is called from some other file I forgot which one but it's a uppercase P.

    Ron
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 05:15
    Print.h versus print.h

    Arrg................. but thanks. a nice little bug that demonstrates why having a community to help your programing is better than DIY.

    No need to feel like the Lone Ranger sans Tonto and san Trigger
  • Brian_BBrian_B Posts: 842
    edited 2014-04-13 05:16

    From what you told me, you are using a PropellerASC+ and a LAMPS.
    If that is true, you are going to have to use wire jumpers to bridge between the two. So maybe you need not reallocate the input pins. Just have the temperature sensor wired directly to the PropellerASC+

    The propellerASC is the plan ,but I really wanted to test the temp controller today (It's called ants in the pants).

    Brian
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 07:44
    Brian_B wrote: »
    The propellerASC is the plan ,but I really wanted to test the temp controller today (It's called ants in the pants).

    Brian

    Well, the ADC chip on the PropellerASC is an MCP3208, a 3.3VDC device with 8 inputs, of which 3 appear to be ignored. That is what is being targeted for now. This is available in a surface mount package for $4.18 at Digikey, so I was thinking of either buying a PropellerASC+ or Propeller Project Board. Parallax has the DIP version on sale for $5.99

    While the ArduinoUno ADC inputs are 10 bit resolution, this device is 12 bit resolution.

    Since it is a 3.3VDC device, you might have to make some adjustments to what the temperature sensor provides. Over-voltage might cause damage. I suppose a 5VDC alternative becomes an attractive option and can be found in a DIP. But code to support it will have to come from somewhere.. not today.

    Then there is the option to have the Propeller provide ADC, a few resistors and a capcitor will do that. But again I have no code as of yet.

    +++++++++++++++++
    I suspect that now you see why I didn't want to discuss hardware possiblities. Each option throws another code task on the pile. I wanted to clear up the parser AT the Front End, before tackling all the various wish list options at the Rear End.
    +++++++++++++++++

    And I am strongly leaning toward the Propeller Project Board just because it can easily solder SMD devices as add-on and it can easily include a SDcard slot to download programs that way. (The PropellerASC+ may support and SDcard on a shield, but I am not sure of this or how to do that and everything else we seem to desire.)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 07:53
    Roy Eltham wrote: »
    Loopy,
    I had intended to use a small ADC chip on the I2C bus along with the eeprom for the prop (pins 28-29). It was going to be 4 channels to allow for supporting 2 hot ends and a heated build platform (and one channel to spare).

    I am a bit unsure that sharing the pins 28-29 is as good as just having the ADC run separate.

    If I am wrong and it is nothing challenging, just changing a pair of pin assignments should do the trick if you use an MCP3208 chip for your ADC. That chip seems to only come in an SMD.

    4 channels is no problem. The ArduinoUNO supports 5 and the actual MCp3208 has 8. Some code might have to be tweaked to get more than 5.

    It isn't cheap. It is $4.18 each at Digikey


    http://search.yahoo.com/search?p=digikey+mcp3208&ei=UTF-8
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 08:03
    ErNa wrote: »
    I will go with this: http://www.tbone.cc/board/ and step by step go with assembler and SPIN

    Well, the tbone has a bit of everything except a Propeller. It was intended for an Arduini and a BeagleBone.
    If you can make it work with a Propeller, that would be Excellent.

    I thought you wanted use use Gerber g-code and do XYZ routers via CNC. I have started another thread to port Arduin grbl to Propeller for that specific purpose.

    Both the threads are about porting firmware TO THE PROPELLER.

    But writing a Spin/PASM solution is a very appealing enhancement. Keep us all informed.
  • PublisonPublison Posts: 12,366
    edited 2014-04-13 08:12

    If I am wrong and it is nothing challenging, just changing a pair of pin assignments should do the trick if you use an MCP3208 chip for your ADC. That chip seems to only come in an SMD.

    http://search.yahoo.com/search?p=digikey+mcp3208&ei=UTF-8

    Hi Loopy,

    Parallax sells the DIP version

    S
    upply voltage is 2.7 to 5 volt.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-13 08:14
    Brian_B wrote: »
    Hi,
    can someone look at this board and tell me if it will work on the propellerASC. Also if I wanted to have some made how would I go about it.

    http://www.buildlog.net/blog/2011/08/stepper-driver-arduino-shield/

    Brian

    Yes it seems this will (Did I already reply once?) This seems a saner option with the PropellerASC than the LAMPS. The fact that it will take 4 stepper motor controllers from Pololu's wide assortment is a 'goodie'.

    It seems to have inputs available for the 5ADC provided by the PropellerASC+ and any unused i/o. So the two are a good fit.
Sign In or Register to comment.