Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 5 1 2 3 ... LastLast
Results 1 to 25 of 111

Thread: 3D Printer Software with Teensy 3.1

  1. #1
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12

    3D Printer Software with Teensy 3.1

    Hi,

    I am trying to get an open source 3D printer software called Marlin compiled using Arduino 1.0.5 IDE for Teensy 3.1. Here is the link to the software: https://github.com/ErikZalm/Marlin
    I downloaded the Teensyduino add-on for the Arduino IDE and I am running on Windows.

    The Arduino Sketch was intended for Ardunio Mega 2560 and it compiles fine. When I tried to compile it for Teensy 3.1, I got the following error:
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	442 
Size:	158.1 KB 
ID:	2236

    Click image for larger version. 

Name:	Untitled5.jpg 
Views:	228 
Size:	71.0 KB 
ID:	2240




    So, I tried to add pin definitions for Teensy 3.1 to the best of my abilities...
    I modified fastio.h by adding pin assignments for Teensy 3.1 (I refferred to the pin assignments for Teeny++ 2.0 which were already defined in fastio.h):
    Click image for larger version. 

Name:	Untitled2.jpg 
Views:	249 
Size:	76.3 KB 
ID:	2237

    I noticed that in Configuration.h, there are a list of Motherboards you can choose from and Teensy 3.1 is missing:
    Click image for larger version. 

Name:	Untitled3.jpg 
Views:	281 
Size:	77.9 KB 
ID:	2238

    So, again using Teensy++ 2.0 as a reference, I tried adding a new "MOTHERBOARD" defintion for Teensy 3.1 in pins.h.

    When I try to compile with these changes, I am still getting the same error:
    Click image for larger version. 

Name:	Untitled4.jpg 
Views:	172 
Size:	88.6 KB 
ID:	2239


    I am wondering if there is something I missed. Thanks for your help!

    Here's a link to my blog: https://community.freescale.com/grou...on-rampsmarlin


    ================================================== ========
    Update:

    I compiled Paul's modified code for the Teensy 3.1 and hooked up a stepper motor to the RAMPS board:
    Click image for larger version. 

Name:	20140623_202014.jpg 
Views:	480 
Size:	103.3 KB 
ID:	2261


    Sincerely,
    Nikki
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled.jpg 
Views:	203 
Size:	38.4 KB 
ID:	2235  
    Last edited by nikkiv; 06-24-2014 at 02:42 AM. Reason: Added a more clear error picture, Added picture of hardware

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    I took a first look at the Marlin code.

    Here's a copy with MOTHERBOARD=85 for Teensy 3.1, and definitions added to fastio.h.

    https://github.com/PaulStoffregen/Marlin

    It still doesn't compile, but this should be getting quite a bit closer. I'll take another look later today, but this is all I have time for at this moment. Hopefully it helps?

  3. #3
    I tried to compile marlin some weeks ago. i am very interested, but iīm far away to solve the problems.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    I looked at it again this morning. There's a lot of AVR timer stuff in the stepper code. I'll attack that part next....

    My hope is to find several people with actual 3D printer hardware who'll help test. If you know anyone, please ask them to subscribe to this thread. Pretty soon I'm hoping to at least get this code to the point where it'll compile. Since I don't actually have the hardware, from that point on, this can only move forward if more people join in with real hardware.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    I just committed code to use Kinetis FlexTimer2 instead of AVR Timer1. It's untested, but based on a lot of experience with both AVR and Kinetis timers, so I believe it's very close to what we need.

    https://github.com/PaulStoffregen/Ma...6e055da6c53771

    I believe we're now very close to getting Marlin to compile for Teensy 3.1. The timing lookup tables need to be regenerated, since FlexTimer2 can't prescale to 2 MHz, because the base clock rates are 24 or 36 or 48 MHz (or 56 & 60 when overclocking).

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    Ok, I _finally_ got Marlin to compile for Teensy 3.1. It's untested, but at least now compiles and might be close...

    https://github.com/PaulStoffregen/Marlin

    Support for temperature sensing is still missing, but at least this can let you start trying to run it with stepper motors.

    The Teensy 3.1 pin mapping in pins.h still needs work. I just put semi-random numbers in for the sake of compiling the code. It has zero chance of actually working until someone goes through pins.h and makes a sensible pin assignment. Hopefully that should be relatively straightforward.

    I do not have any 3D printer hardware here, so there's not much I can do for actual testing. Hopefully this initial porting effort will help?

  7. #7
    Senior Member Wozzy's Avatar
    Join Date
    Jan 2013
    Location
    Philadelphia, Pennsylvania USA
    Posts
    307
    Quote Originally Posted by PaulStoffregen View Post
    .... My hope is to find several people with actual 3D printer hardware who'll help test. .... this can only move forward if more people join in with real hardware.
    I'll volunteer to help with this. I've been considering a similar project for some time now.

    I have an open source Mendel90 3D printer kit that was designed by NopHead.
    Like Paul, NopHead (Chris Palmer) is fully committed to open source.
    It's an ideal platform for modification and testing.
    Here's a link to my build blog: http://mendel90.blogspot.com/
    Here's a link to nopheads website: http://hydraraptor.blogspot.com/2012...0-updates.html


    It will take some effort, to develop the interface between the Teensy 3.x and the printer, as stepper motor, fan and heater controllers are required.
    My current controller (Melzi) has the arduino chipset, motor controllers and heater controllers integrated into a single board.
    a few photos are attached, showing My Mendel90, a sample 3D printed teensy and teensy holder and the Melzi controller.

    Click image for larger version. 

Name:	Mendel90.jpg 
Views:	286 
Size:	122.6 KB 
ID:	2252 Click image for larger version. 

Name:	3D Print.jpg 
Views:	310 
Size:	169.0 KB 
ID:	2253 Click image for larger version. 

Name:	Melzi2.jpg 
Views:	344 
Size:	117.5 KB 
ID:	2254

    EDIT: I posted a link to this thread on the 3D Printing Community on Google+
    Last edited by Wozzy; 06-22-2014 at 08:55 PM.

  8. #8
    Thank you, Paul, for the product and the great support!

    I could compile and load, using a little board with two stepperdrivers (for "polargraph" or "self balancing robot" "missions").
    Readapted pins.h and baudrate in configuration.h to 115000.
    Using repetier-host i could send move commands to teensy (needed the "Fake OK"-button) and the motors turned.

    I didnīt try combined moves or other GCode commands.

    My Felix 2.0 3D-Printer is driven by Ramps 1.4. Perhaps i will build a controller board for teensy building and testing step by step (motor/endstops/temperature/heater/display/SD).

  9. #9
    Junior Member
    Join Date
    Jun 2014
    Location
    Spain
    Posts
    2
    Hi Paul,
    I just stumble into a google+ that caught my eye referring to this forum post. I very much appreciate the work you've been doing and has served me as inspiration to develop a 3D printer electronics a while back. I was in the middle of designing the evolution of the SAV MkI (http://reprap.org/wiki/SAV_MKI) based on an ARM core and was considering the Teensy 3.1 as its basis and looking to modify Marlin to support it. I was considering things in the lines of writing a HAL on top (as you have seen, Marlin is a little bit convoluted in that sense) to make things a bit easier.

    I've got the machines ready for rock and load and would only need to purchase a Teensy 3.1 and design a simple daughter board to support the 3D driving electronics for it as a proof of concept. So I volunteer to get this port up and running too.

  10. #10
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Hi guys,

    I didn't have much luck trying to get the stepper motors spinning using the Marlin code. So, I am trying to use the AccelStepper Library and the sample program that Paul has here: https://www.pjrc.com/teensy/td_libs_AccelStepper.html


    Click image for larger version. 

Name:	20140624_190251.jpg 
Views:	224 
Size:	105.3 KB 
ID:	2272

    I tried this sample program just using the Teensy, the stepper motor and the stepper driver and I can see the motor spinning (see above).


    However, when I tried adding the RAMPS board, I couldn't see the motor spinning and here is my setup:

    Click image for larger version. 

Name:	teensyrip2.jpg 
Views:	258 
Size:	133.8 KB 
ID:	2273
    I have the stepper driver and the stepper motor hooked up to the RAMPS board. I connected 12V to the RAMPS board to power 'Vmot' of the stepper driver. I also have connect X step and X dir from the Teensy board (pin 3 and pin 6) to the header on the RAMPS board where those signals are routed form the stepper driver. I have Vin from the Teensy connected to Vdd on the RAMPS board and also GND from Teensy to GND on RAMPS. When I powered both the USB on the Teensy and the 12 volts from the power supply, I couldn't see the stepper motor spin. Any thoughts?
    Last edited by nikkiv; 06-26-2014 at 12:40 PM.

  11. #11
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by aikx View Post
    Thank you, Paul, for the product and the great support!

    I could compile and load, using a little board with two stepperdrivers (for "polargraph" or "self balancing robot" "missions").
    Readapted pins.h and baudrate in configuration.h to 115000.
    Using repetier-host i could send move commands to teensy (needed the "Fake OK"-button) and the motors turned.

    I didnīt try combined moves or other GCode commands.

    My Felix 2.0 3D-Printer is driven by Ramps 1.4. Perhaps i will build a controller board for teensy building and testing step by step (motor/endstops/temperature/heater/display/SD).
    Hi aikx, did you try running marlin code using RAMPS and the Teensy? Also, what do you mean by the "Fake Ok" button? Thanks!

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    I just tried RepetierHost for the first time!

    Clearly there's some sort of communication issue with acknowledging the commands. Soon I'll get my USB protocol analyzer out and compare with Arduino Mega....

  13. #13
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by PaulStoffregen View Post
    I just tried RepetierHost for the first time!

    Clearly there's some sort of communication issue with acknowledging the commands. Soon I'll get my USB protocol analyzer out and compare with Arduino Mega....

    Yeah, when I tried to send a command using Repetier Host, I keep seeing x "commands waiting" under the manual control tab... Do you see that too?

  14. #14
    Junior Member
    Join Date
    Jun 2014
    Location
    Spain
    Posts
    2
    Quote Originally Posted by PaulStoffregen View Post
    I just tried RepetierHost for the first time!

    Clearly there's some sort of communication issue with acknowledging the commands. Soon I'll get my USB protocol analyzer out and compare with Arduino Mega....
    Hi Paul,

    just go to the connection preferences and tick off the "reset on connect" (I think its called) option. After that you shouldīt have any issue communicating with Repetier.

  15. #15
    Quote Originally Posted by nikkiv View Post
    Hi aikx, did you try running marlin code using RAMPS and the Teensy?
    Not Ramps...

    Click image for larger version. 

Name:	aikx_stepper_T31.jpg 
Views:	205 
Size:	123.4 KB 
ID:	2281

    Quote Originally Posted by nikkiv View Post
    Also, what do you mean by the "Fake Ok" button? Thanks!
    Repetier-Host -> Print Panel -> Fake OK

    Name:  repetier-host_Fake_OK.png
Views: 3694
Size:  13.9 KB

    I will look into this on the weekend!

    I should decide to build a complete controllerboard or adaptorboard Teensy 31 to Ramps 1.4!? An adaptorboard seems more simple!

  16. #16
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by aikx View Post

    Repetier-Host -> Print Panel -> Fake OK

    Name:  repetier-host_Fake_OK.png
Views: 3694
Size:  13.9 KB

    Hmmm.... I wonder if we are using a different version of Repetier host... because I don't see the "fake ok" button. Or maybe I am missing it.

    Here is what I see:

    Click image for larger version. 

Name:	repetier.jpg 
Views:	202 
Size:	111.4 KB 
ID:	2286

    Also, when I connect to the Teensy board using Repetier Host, I keep getting a number of "Commands Waiting" at the top... have you run into this by any chance?
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	197 
Size:	89.7 KB 
ID:	2287

    I am using version 0.95F
    Last edited by nikkiv; 06-26-2014 at 08:19 PM.

  17. #17
    [QUOTE=nikkiv;50001]Hmmm.... I wonder if we are using a different version of Repetier host... because I don't see the "fake ok" button. Or maybe I am missing it.

    Quote Originally Posted by nikkiv View Post
    Here is what I see:
    Did you scroll down completely?

    Quote Originally Posted by nikkiv View Post
    Also, when I connect to the Teensy board using Repetier Host, I keep getting a number of "Commands Waiting" at the top... have you run into this by any chance?
    Same here, but with "Fake OK" the waiting commands were sent.


    Quote Originally Posted by nikkiv View Post
    I am using version 0.95F
    Latest(!) Mac Version 0.56 (53)

    @fmalpartida:
    Quote Originally Posted by fmalpartida View Post
    ..., just go to the connection preferences and tick off the "reset on connect" (I think its called) option. After that you shouldīt have any issue communicating with Repetier.
    I canīt find this or a similar option. Please show a screenshoot.....

  18. #18
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by aikx View Post


    Did you scroll down completely?


    Same here, but with "Fake OK" the waiting commands were sent.



    Latest(!) Mac Version 0.56 (53)

    Yes, I scrolled down completely. Actually, I don't even have the "Print Panel" tab. It seems like the Mac version has that feature but not the windows version...

    Click image for larger version. 

Name:	repetier3.jpg 
Views:	155 
Size:	109.9 KB 
ID:	2288
    Last edited by nikkiv; 06-26-2014 at 09:20 PM.

  19. #19
    Quote Originally Posted by nikkiv View Post
    Yes, I scrolled down completely. Actually, I don't even have the "Print Panel" tab. It seems like the Mac version has that feature but not the windows version...
    "Print Panel" is now "Manual Control" and they removed the "Fake OK" Button... There is no development of the mac-version! |-(

  20. #20
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    I tried the Linux version. It also has only "OK", not "Fake OK", but it seems to work fine.

    I had to edit the baud rate to 57600 in Configuration.h. The Linux driver doesn't seem to like 250000 (even though Teensy 3.1 complete ignores the baud rate).

    Repetier-Host does seem to be getting hung up on something and requires the "OK" button clicked. I believe it's due to the missing temperature feature. The blue bar will stay stuck as "1 Command Waiting". Clicking "OK" gets it unstuck.

    Nikki, as a first sanity check after you click "Connect", use the menu Printer > Printer Information, to see if your Teensy 3.1 is responding at all. You should see Machine Type = Mendel, Firmware = Marlin, and Firmare URL = https://github.com/ErikZalm/Marlin/

    Here's roughly what you should see.

    Click image for larger version. 

Name:	sc.jpg 
Views:	165 
Size:	122.4 KB 
ID:	2289
    (click for full size)

    This first Printer Information step means you've got a connection. There's no point trying other stuff like moving the motors until you at least have a connection.

    Once I got it connected, clicking the X-axis arrows on the Manual Control tab did result in pulses on pin 0, and the direction does change the voltage on pin 1. Clicking "OK" regularly to get it unstuck is needed....

    Obviously quite a bit more work is needed here, but at least it's partially functioning.

  21. #21
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by PaulStoffregen View Post
    I tried the Linux version. It also has only "OK", not "Fake OK", but it seems to work fine.

    I had to edit the baud rate to 57600 in Configuration.h. The Linux driver doesn't seem to like 250000 (even though Teensy 3.1 complete ignores the baud rate).

    Repetier-Host does seem to be getting hung up on something and requires the "OK" button clicked. I believe it's due to the missing temperature feature. The blue bar will stay stuck as "1 Command Waiting". Clicking "OK" gets it unstuck.

    Nikki, as a first sanity check after you click "Connect", use the menu Printer > Printer Information, to see if your Teensy 3.1 is responding at all. You should see Machine Type = Mendel, Firmware = Marlin, and Firmare URL = https://github.com/ErikZalm/Marlin/

    Here's roughly what you should see.

    Click image for larger version. 

Name:	sc.jpg 
Views:	165 
Size:	122.4 KB 
ID:	2289
    (click for full size)

    This first Printer Information step means you've got a connection. There's no point trying other stuff like moving the motors until you at least have a connection.

    Once I got it connected, clicking the X-axis arrows on the Manual Control tab did result in pulses on pin 0, and the direction does change the voltage on pin 1. Clicking "OK" regularly to get it unstuck is needed....

    Obviously quite a bit more work is needed here, but at least it's partially functioning.


    Hi Paul,

    Hmm that's interesting... When I connected the Teensy board to Repetier, it looked like it connected because I didn't get any connection errors... but when I checked the printer information as you described, machine type says "unknown"

    Click image for larger version. 

Name:	printerInfo.jpg 
Views:	294 
Size:	93.5 KB 
ID:	2290

    Did you just download your modified version of Marlin to Teensy and connect using Repetier? Or did you do something else different. I also modified the baud rate in config.h

    Thanks so much!
    Nikki

  22. #22
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    14,232
    Quote Originally Posted by nikkiv View Post
    but when I checked the printer information as you described, machine type says "unknown"
    You're definitely not connected yet. I don't know why. I set the baud rate to 57600 in Repetier-Host and Configuration.h. This setting on the Teensy side probably makes no difference, and on the Windows side, any number the driver supports should be the same (the data is always 12 MBit/sec).

    Other than that, I can't know why you're not connecting. You've check the Windows Device Manager to make sure you know which COM port is Teensy, right? Selecting the wrong COM port would be the other major issue.

    At least you can see quickly and easily in the Printer Information screen if you've connected. As long as you're seeing "unknown", Windows is just sending data into empty space and getting nothing back. Keep trying... I'm sure you'll figure out what's wrong.

  23. #23
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by PaulStoffregen View Post
    You're definitely not connected yet. I don't know why. I set the baud rate to 57600 in Repetier-Host and Configuration.h. This setting on the Teensy side probably makes no difference, and on the Windows side, any number the driver supports should be the same (the data is always 12 MBit/sec).

    Other than that, I can't know why you're not connecting. You've check the Windows Device Manager to make sure you know which COM port is Teensy, right? Selecting the wrong COM port would be the other major issue.

    At least you can see quickly and easily in the Printer Information screen if you've connected. As long as you're seeing "unknown", Windows is just sending data into empty space and getting nothing back. Keep trying... I'm sure you'll figure out what's wrong.
    Hey Paul,

    Yes, I am using the correct COM port. Repetier throws a connection error if I select the wrong COM port. When I first click Connect, I am still seeing "unknown" in Windows...

    However, after clicking the "OK' button, Repetier was able to recognize Teensy. I am seeing what you described:
    Click image for larger version. 

Name:	Screenshot from 2014-06-27 12_13_16.jpg 
Views:	182 
Size:	102.0 KB 
ID:	2295

    So, it looks like I need to connect and then press the OK button for Repetier to connect to Teensy.

    Also, on a side note, we were able to get the motor spinning using the RAMPS board and Teensy with AccelStepper library and the example program from https://www.pjrc.com/teensy/td_libs_AccelStepper.html


    I checked to see if I can get the stepper motor spinning using Repetier Host and the Marlin code. It seems like the stepper motor is responding (it just vibrates and makes a noise) but it's not exactly spinning... I am clicking the "home" of x axis and then when I press OK the stepper motor vibrates but doesn't spin. So it's little bit of a progress

    Thanks!
    Sincerely,
    Nikki
    Last edited by nikkiv; 06-27-2014 at 09:19 PM.

  24. #24
    Junior Member nikkiv's Avatar
    Join Date
    Jun 2014
    Posts
    12
    Quote Originally Posted by aikx View Post

    I could compile and load, using a little board with two stepperdrivers (for "polargraph" or "self balancing robot" "missions").
    Readapted pins.h and baudrate in configuration.h to 115000.
    Using repetier-host i could send move commands to teensy (needed the "Fake OK"-button) and the motors turned.

    I didnīt try combined moves or other GCode commands.
    .
    Which "send move commands did you use"? Are you referring to the "home icon" next to the X or did you use a G-Code?

    I am currently using the RAMPS board and the Teensy... Repetier Host is able recognize Teensy and I am trying to get the stepper motor to spin. When I use the GUI to move the X axis, the stepper motor just makes a noise and vibrates... it's not really spinning. I am wondering if there's something I am missing... I am new to Repetier Host...

    Thanks so much!

    Nikki

  25. #25

    Little progress

    Little progress with my Teensy 3.1 to Ramps 1.4 adaptor using:

    - Teensy 3.1
    - Tall Dog LLC Teensy 3.1 Breakout
    - Arduino Mega Protoboard with stackable headers
    - Ramps 1.4
    - ATX power supply/Felix frame

    Click image for larger version. 

Name:	T31-Ramps14-Adapter.JPG 
Views:	580 
Size:	133.4 KB 
ID:	2305

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •