3D Printer Software with Teensy 3.1

Status
Not open for further replies.

nikkiv

Member
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:
Untitled.jpg

Untitled5.jpg




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):
Untitled2.jpg

I noticed that in Configuration.h, there are a list of Motherboards you can choose from and Teensy 3.1 is missing:
Untitled3.jpg

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:
Untitled4.jpg


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

Here's a link to my blog: https://community.freescale.com/gro...-based-3d-printer-engine-based-on-rampsmarlin


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

I compiled Paul's modified code for the Teensy 3.1 and hooked up a stepper motor to the RAMPS board:
20140623_202014.jpg


Sincerely,
Nikki
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    38.4 KB · Views: 412
Last edited:
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?
 
I tried to compile marlin some weeks ago. i am very interested, but i´m far away to solve the problems.
 
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.
 
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/Marlin/commit/906e39048cdea87268a1e505fd6e055da6c53771

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).
 
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?
 
.... 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/12/mendel90-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.

Mendel90.jpg 3D Print.jpg Melzi2.jpg

EDIT: I posted a link to this thread on the 3D Printing Community on Google+
 
Last edited:
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 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.
 
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


20140624_190251.jpg

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:

teensyrip2.jpg
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:
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!
 
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....
 
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?
 
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.
 
Hi aikx, did you try running marlin code using RAMPS and the Teensy?

Not Ramps...

aikx_stepper_T31.jpg

Also, what do you mean by the "Fake Ok" button? Thanks!

Repetier-Host -> Print Panel -> Fake OK

repetier-host_Fake_OK.png

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!
 
Repetier-Host -> Print Panel -> Fake OK

View attachment 2282


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:

repetier.jpg

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?
Untitled.jpg

I am using version 0.95F
 
Last edited:
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:
Did you scroll down completely?

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.


I am using version 0.95F
Latest(!) Mac Version 0.56 (53)

@fmalpartida:
..., 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.....
 
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...

repetier3.jpg
 
Last edited:
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! |-(
 
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.

sc.jpg
(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. :)
 
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.

View attachment 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"

printerInfo.jpg

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
 
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.
 
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:
Screenshot from 2014-06-27 12_13_16.jpg

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:
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
 
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

T31-Ramps14-Adapter.JPG
 
Status
Not open for further replies.
Back
Top