Welcome! Log In Create A New Profile

Advanced

Getting movement with Teacup + Gen7 1.2 — resolved

Posted by monocultured 
Getting movement with Teacup + Gen7 1.2 — resolved
August 15, 2011 11:37AM
Since I previously flash fried both my ATMega 644 and the four connected Pololus, I've got new ones and replaced them. The ATMega is bootloaded and running the Gen7 Teacup branch [github.com] since the previous one gave me strange features (constantly rising temperature, the FAN lighting up when remote-controlling the X axis and the H2 lighting up with Y-axis jogged.)

The config.py is set to ATMega644 and 20Mhz, other than that it's my understanding that I ought to get some movement with a motor plugged in.

I've posted a short video of what I do when I troubleshoot my setup, in hopes that it's something obviously wrong with my procedure. I show both the hardware and software setup, and you can watch it here: [vimeo.com]

To sum the video up, this is what I do:

1. Power supply checks [reprap.org]
2. Measure Voltage over the 2A/2B connector of the Y-axis Pololu with pot set low / high, while controlling it through ReplicatorG
3. Measure Voltage over FAN and H2, while controlling it through ReplicatorG
4. Hook one motor up to the Y Pololu and with pot set low/med I try to get movement through ReplicatorG

Previously, I've measured over the X-axis and tried hooking a motor up there as well, with similar results.

In the end it could be that the firmware doesn't match my hardware, that I should comment/uncomment something, or my hardware is either set up the wrong way, broken, or is shorting somewhere. Whichever it is, I'm sort of stuck at the moment and would appreciate a nudge.

I just received my hotend from Makergear; would it make a difference if I hook the thermistor up? Or if I connect the optostops?

Edited 1 time(s). Last edit at 09/13/2011 06:41AM by monocultured.
Re: Getting movement with Teacup + Gen7 1.2
August 15, 2011 01:41PM
Connect your end stops,

in theory it should only allow movement in one direction without them but worth checking,

or disable them in the config.h file for testing.

Remember the Polo's will output a AC signal as they are stepped motors.

Rob
Re: Getting movement with Teacup + Gen7 1.2
August 18, 2011 07:57AM
Thanks for the reply Rob,

In config.h I commented out

#define	X_MIN_PIN	DIO7
#define	Y_MIN_PIN	DIO5
#define	Z_MIN_PIN	DIO1


and it uploaded fine, but I got nothing on the Polo output. (thanks for the comment on the pololus being AC, I had no idea…) I hooked up the motor with the pot set first to low then medium, and still nothing.

Uncommenting the above three lines, I connected all six optostops, and they light up properly when I block the sensor, but still no movement on the motor nor voltage when measuring across 2A/2B.

I tried to uncomment and set the proper pins for

#define	X_MAX_PIN	DIO6
#define	Y_MAX_PIN	DIO2
#define	Z_MAX_PIN	DIO0

But got an error at compile:


home.c: In function 'home_x_positive':
home.c:119: error: 'X_MAX' undeclared (first use in this function)
home.c:119: error: (Each undeclared identifier is reported only once
home.c:119: error: for each function it appears in.)
home.c: In function 'home_y_positive':
home.c:213: error: 'Y_MAX' undeclared (first use in this function)
home.c: In function 'home_z_positive':
home.c:308: error: 'Z_MAX' undeclared (first use in this function)

Looking at home.c I just don't know what this is about, so the three lines above are uncommented again.

It's my understanding that the original code

#define	X_MIN_PIN	DIO7
#define	Y_MIN_PIN	DIO5
#define	Z_MIN_PIN	DIO1

only botheres with three of my six connected sensors, correct? So if they're hooked up, appear to be working, and the code is uncommented, what else could there be which is holding up stepping on the motors?
Re: Getting movement with Teacup + Gen7 1.2
August 18, 2011 09:18AM
Ok, I reverted to the default Teacup installation linked from the Gen7 1.2 page [github.com] as well as Traumflugs linked config.h from this page: [forums.reprap.org]

With the file as-is, I compile and upload without a problem, but again don't get any movement on the motors. I did notice that the pins in the config.h didn't match the ones in the wiki, so I changed to what the wiki said, but it didn't make any discernable difference.

#define	X_STEP_PIN						DIO19
#define	X_DIR_PIN							DIO18
#define	X_MIN_PIN							DIO7
#define	X_MAX_PIN							DIO6
//#define	X_ENABLE_PIN					xxxx
//#define	X_INVERT_DIR
//#define	X_INVERT_MIN
//#define	X_INVERT_MAX
//#define	X_INVERT_ENABLE

#define	Y_STEP_PIN						DIO23
#define	Y_DIR_PIN							DIO22
#define	Y_MIN_PIN							DIO5
#define	Y_MAX_PIN							DIO2
//#define	Y_ENABLE_PIN					xxxx
//#define	Y_INVERT_DIR
//#define	Y_INVERT_MIN
//#define	Y_INVERT_MAX
//#define	Y_INVERT_ENABLE

#define	Z_STEP_PIN						DIO26
#define	Z_DIR_PIN							DIO25
#define	Z_MIN_PIN							DIO1
#define	Z_MAX_PIN							DIO0
//#define	Z_ENABLE_PIN					xxxx
//#define	Z_INVERT_DIR
//#define	Z_INVERT_MIN
//#define	Z_INVERT_MAX
//#define	Z_INVERT_ENABLE


Using Pronterface I sent some Gcode commands, and it seems to take:

>>>M114
SENDING:M114
ok X:12.000,Y:12.000,Z:11.520,E:0.000,F:4000
>>>G0 X10
SENDING:G0 X10
>>>M114
SENDING:M114
ok X:10.000,Y:12.000,Z:11.520,E:0.000,F:4000

The feedback from the console makes me think that the endstops are not the issue, since the X-axis movement is registered by the firmware.

So clearly the program is working. It's in the transition from the ATMega to the Pololus there's something missing. The trim pots are not at zero, so should give some reading, and the power is hooked in properly. I see no shorts, and don't know what would have to be wrong for all four Pololus not to work.
Re: Getting movement with Teacup + Gen7 1.2
August 18, 2011 02:59PM
Quote

Ok, I reverted to the default Teacup installation linked from the Gen7 1.2 page [github.com] as well as Traumflugs linked config.h from this page: [forums.reprap.org]

Oops, should have changed this for v1.2 as well. Gen7 has now it's own Teacup branch. The issue was, Teacup could handle a power supply pin and a common stepper enable pin, but not both at the same time.

Your issue likely is, everything is working fine, except the Enable pin of the Pololus isn't pulled down. You can test this with a multimeter: 5V means disabled, 0V means enabled.

Pinout of v1.2 and v1.3.1 almost match, installing a v1.3.1 firmware on a v1.2 board just ignores the third MOSFET. Everything else is the same.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Getting movement with Teacup + Gen7 1.2
August 19, 2011 06:59AM
Ok, Gen7 Teacup it is. Just to be thorough, I tried to install the SetupTest.pde from [reprap.org] to see if I could get anything to blink, but only got two blinks out of the lower right LEDs with the ATX20+Molex attached and that's was it. Resetting the board didn't do anything, and now it won't accept firmware — I get avrdude timeouts as if there's no connection
avrdude: stk500_2_ReceiveMessage(): timeout
and I get this regardless if I'm feeding power through the USB or Molex (with the proper jumper, of course) and the Polos in or out. Changed baud to 9600 since that's what was in the test, but still nothing. Is there something in the SetupTest.pde which could cause the ATMega to die?

Anyway, I'm off to bootload yet another ATMega644, after which I'll try the Gen7 Teacup. I did try to compile Teacup_Firmware.pde though, and got an error in Arduino:

In file included from temp.c:54:
config.h:270: error: 'THERMISTOR_BED' undeclared here (not in a function)

refering to line
DEFINE_TEMP_SENSOR(bed, TT_THERMISTOR, PINA2, THERMISTOR_BED)

I commented out the offending line, but is this where one needs to specify something in thermistor.h?
Re: Getting movement with Teacup + Gen7 1.2
August 19, 2011 04:28PM
Ok, with a new ATMega bootloaded and with Gen7 Teacup running on it, I measure 5V between PIN33 and GND on PIN11. If as I you say I need to invert this behaviour, how do I set that? Is this something I do on the ATMega or somehow set on the Polos?
Re: Getting movement with Teacup + Gen7 1.2
August 20, 2011 03:51AM
Quote

In file included from temp.c:54:
config.h:270: error: 'THERMISTOR_BED' undeclared here (not in a function)

You also have to use ThermistorTable.gen7.h. Copy it over ThermistorTable.h.

Quote

If as I you say I need to invert this behaviour, how do I set that?

This is part of the recent Teacup fixes. Please note, steppers are enabled when in use only, so you have to send a G0 or G1 to see this pin going to 0V.

Does communication with the ATmega work now? Does a M114 answer with something readable?


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Getting movement with Teacup + Gen7 1.2
August 20, 2011 12:05PM
Following your advice I copied thermistortable.gen7.h over thermistortable.h and it now compiled and uploaded properly. I connect to the board with no problem, and when sending manual commands I get this:

Printer is now online
>>>M114
SENDING:M114
ok X:0.000,Y:0.000,Z:0.000,E:0.000,F:50
>>>G1 X0.5
SENDING:G1 X0.5
>>>M114
SENDING:M114
ok X:0.500,Y:0.000,Z:0.000,E:0.000,F:50
>>>G0 Y0.5
SENDING:G0 Y0.5
>>>M114
SENDING:M114
ok X:0.500,Y:0.500,Z:0.000,E:0.000,F:4000

When measuring over PIN11 and PIN33 I have a steady 5V when sending the commands. As previously, I get no measurement over the outgoing Pololu pins when manually controlling motors.

I have nothing connected except the USB/serial, Molex for power, 4 pololus and a mulitmeter. I have a Makergear hothead with thermistor I haven't assembled yet; would it make a difference to hook the thermistor up?

With printer monitor turned on in Pronterface I get a steady stream of

T:0.25 B:0.0
T:0.25 B:0.0
T:0.25 B:0.0
T:0.25 B:0.0
T:0.25 B:0.0

every five seconds or so.
Re: Getting movement with Teacup + Gen7 1.2
August 21, 2011 01:41AM
Quote

when sending manual commands I get this: [...]

Looks good. The ATmega is doing most of his work fine.

Quote

When measuring over PIN11 and PIN33 I have a steady 5V when sending the commands.

Not good. Now, 0.5 mm are done pretty quick, you might want to try something like G1 X50 F50 to have a minute to measure the value. While moving, the Enable pin should go to 0V.

If it doesn't, look wether STEPPER_ENABLE_PIN in config.h is right.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Getting movement with Teacup + Gen7 1.2
August 21, 2011 06:31AM
With config.h set to

#define	PS_ON_PIN			DIO15
#define STEPPER_ENABLE_PIN		DIO24
#define	STEPPER_INVERT_ENABLE
and using pronterface.py to send
G1 X50 F50
Just as previously I get
start
Printer is now online
>>>G1 X50 F50
SENDING:G1 X50 F50
>>>M114
SENDING:M114
ok X:48.000,Y:0.000,Z:0.000,E:0.000,F:50
with a constant 5V DC over PIN11 and PIN33.

Looking at the Gen7 1.2 schematics as well as the ATMega datasheet, those pins are GND and PA7, and the table here [reprap.org] lists PA7 as DIO24 in Teacup for "motor enable." So assuming that DIO24 is correct, the config.h looks fine.

I also tried commenting out the stepper invertion
#define	PS_ON_PIN			DIO15
#define STEPPER_ENABLE_PIN		DIO24
//#define	STEPPER_INVERT_ENABLE
but with the same result.

Possibly related: After a while, I noticed that the FAN LED lit up, and turning on monitor I get the same ghost temperature as I got with the older Teacup (recall that I have no thermistor attached, only power and USB and 4 Polos)
T:26.25 B:0.0
T:47.50 B:0.0
>>>M114
SENDING:M114
ok X:57.600,Y:0.000,Z:9.600,E:0.000,F:3000
T:61.0 B:0.0
T:71.25 B:0.0
T:74.0 B:0.0
T:74.25 B:0.0
T:74.25 B:0.0
T:74.75 B:0.0
T:75.0 B:0.0
T:75.25 B:0.0
T:75.75 B:0.0
T:76.25 B:0.0
T:77.50 B:0.0
T:79.50 B:0.0
T:84.50 B:0.0
T:96.25 B:0.0
T:109.0 B:0.0
T:120.75 B:0.0
T:132.25 B:0.0
T:143.75 B:0.0
>>>G1 X50 F50
SENDING:G1 X50 F50 //here the FAN LED lights up 
T:0.25 B:0.25
T:0.25 B:0.0
T:0.25 B:0.25
T:0.25 B:0.0
T:37.50 B:0.0
T:57.0 B:0.0
T:68.75 B:0.0
T:74.0 B:0.0
T:74.25 B:0.0
T:74.75 B:0.0
T:75.0 B:0.0
T:75.25 B:0.0
T:75.75 B:0.0
T:76.25 B:0.0
T:77.25 B:0.0
T:79.25 B:0.0
T:84.25 B:0.0
T:97.25 B:0.0
T:111.50 B:0.0
T:124.75 B:0.0
This is very inconsistent, and I can't always replicate the resetting of the temperature. Just now I unplugged the USB cable and connected again:
start
Printer is now online
T:866.25 B:0.0
T:866.25 B:0.0
>>>G1 X50 F50
SENDING:G1 X50 F50  //Here the FAN LED lit up. It goes up to 12V for a while then gradually drops.
T:0.25 B:0.0
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.0
T:0.25 B:0.25
T:0.25 B:0.0
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.0
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.25
T:0.25 B:0.0
T:0.25 B:0.25
T:0.25 B:0.0
T:25.25 B:0.0
T:46.0 B:0.0
T:60.25 B:0.0
T:70.25 B:0.0
T:74.0 B:0.0
T:74.25 B:0.0
T:74.50 B:0.0
T:74.75 B:0.0
T:75.0 B:0.0
T:75.50 B:0.0
T:76.0 B:0.0
T:76.25 B:0.0
T:77.25 B:0.0
T:79.0 B:0.0
T:83.0 B:0.0
T:93.25 B:0.0
T:106.0 B:0.0
T:118.0 B:0.0
T:129.25 B:0.0
T:139.75 B:0.0
T:154.50 B:0.0
T:171.75 B:0.0
T:193.0 B:0.0
T:220.0 B:0.0
T:255.50 B:0.0
T:309.75 B:0.0
T:586.50 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
>>>G1 X50 F50
SENDING:G1 X50 F50
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
>>>G1 X50 F50
SENDING:G1 X50 F50
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
>>>M114
SENDING:M114
ok X:48.000,Y:0.000,Z:0.000,E:0.000,F:50
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
T:866.25 B:0.0
Is there perhaps something in Teacup which doesn't allow the ENABLE pin to drop to 0V unless a right temperature is reached?
Re: Getting movement with Teacup + Gen7 1.2
August 22, 2011 04:30AM
Thermistor readings and enable pin are not related. If you don't have a thermistor connected, these temperature readings are just random.

I've attached a test sketch a Gen7 user has sent me. It's much simpler than the entire firmware and should move the motors somehow.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Attachments:
open | download - Test_Motors.pde (2.7 KB)
Re: Getting movement with Teacup + Gen7 1.2
August 22, 2011 05:11AM
Firmware uploads fine, and shortly therafter the H1 LED is blinking regularly. Current over PIN11 and PIN33 is still a constant 5V though, and I get no movement on the motors, nor current when I measure over the 2A/2B or 1A/1B Polo outputs. The movement should happen automatically since I can't connect to the board, right?

Could I have done something wrong when bootloading which would mess up the PIN33 pulldown but wouldn't stop other normal operations? (If so I'll take you up on the offer of buying a bootloaded ATMega from you just to test.)
Re: Getting movement with Teacup + Gen7 1.2
August 23, 2011 03:39AM
Quote

Firmware uploads fine, and shortly therafter the H1 LED is blinking regularly.

That's SetupTest.pde? A firmware for running a machine doesn't blink LEDs and SetupTest.pde neither pulls down Enable pins nor does it move motors.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Getting movement with Teacup + Gen7 1.2
August 23, 2011 03:45AM
No, I uploaded Test_Motors.pde and got the above results. If that sketch is stepping the motors I ought to get an intermittent 0V reading over PIN11 & PIN33, right?
Re: Getting movement with Teacup + Gen7 1.2
September 10, 2011 06:35AM
Having received the board back from Traumflug, who fixed a short and made it shiny, I plugged in my Polos and PSU but couldn't get anything much to happen. So either the PSU or the Pololus are messing up, unless there's something wrong with my procedure. I've posted two videos showing how I go about troubleshooting the board, in the hope that I'm doing something obviously stupid which might cause the malfunction.

In the first video I'm just testing the board with the PSU plugged in and the Polos set from min to max and while measuring the outgoing voltage. In the second video I've added an internal DVD player as a load on the same lead which is providing the board with 12V. You can occasionally hear the DVD move, but I don't know if the load resistance it is providing is enough for the PSU — it's a 300W ATX20 unit I salvaged from a computer.

PSU straight into board: http://vimeo.com/28757756
DVD as load resistor: http://vimeo.com/28851467

The Polos are spanking new, and in the first video I've actually just unpacked one and plugged it in, so I doubt they are at fault (or at least all of them) so this leaves me with the PSU. The next step seems to be either to replace the PSU or create a proper load resistance for the current one. I'm assuming that I could take my cue from a tutorial such as this one [web2.murraystate.edu] for how to go about to do that.

Alternatively, I guess I could just use two wallwarts, each providing 5V and 12V? This wouldn't give me control over power on/off, but I could live without that right now.
Re: Getting movement with Teacup + Gen7 1.2
September 11, 2011 10:46AM
Quite a lengthy adventure, isn't it?

Measuring voltage on an open motor connector with a multimeter probably doesn't work, as Pololus require feedback (inductivity, resistance) from the motors.

X is the rightmost motor connector in your video. The one that was empty most of the time.

Also, without mechanical load steppers move at about any setting of the Pololu's trimpot. Put them to about 25% from the left. You can also readjust them while in use, if you want to play with them. An G1 X100 F5 gives you 20 minutes time to do so.

Everything else looks just fine. There's 5V, 12V, PSU powers up and down properly.

As that board moved motors here, the only thing left could be the points where pins are soldered into the Pololus and the connection between the motor connector and the motor wire.

That, or the motors are mis-wired. There should be a few ohms on the left pair of the connector and on the right pair, but insulation between both pairs.

To make motor movements more visible, one can put snippet of glue tape on it's axis to form a little flag.

If that still doesn't help, you might want to have a look at the G-code Pronterface is sending. I use serial terminals like HyperTerminal, GtkTerm or Putty here for testing. Use 115200 baud and turn on "local echo". M114 reports where Teacup thinks the motors are.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Getting movement with Teacup + Gen7 1.2
September 13, 2011 06:39AM
Delight and jubilation, it's alive! It's alive!

I had missed that one had to solder the male headers onto the Polos and thought that it was a tight enough fit. Apparently not, since after soldering them and giving the trim pots half a turn, I got movement on YZX motors. Bloody brilliant! Oh, and no nead for a load resistor on the PSU.

Big thanks to Traumflug for the patience and help.
Re: Getting movement with Teacup + Gen7 1.2
September 13, 2011 09:16AM
Rejoice! Glad you could figure it out.
Re: Getting movement with Teacup + Gen7 1.2
September 13, 2011 03:52PM
Sorry, only registered users may post in this forum.

Click here to login