Welcome! Log In Create A New Profile

Advanced

Teacup Firmware Extruder stepper motor command not included

Posted by sirbj 
Teacup Firmware Extruder stepper motor command not included
November 10, 2012 10:33AM
Hey out there

I am the happy owner of a Reprap Mendel, whit 3 gen. electronic.
I am using the Teacup firmware, and the Pronterface to send commands, almost everything is working.

But the Extruder stepper motor do not move,(have tested the motor and it works fine)

I have bin looking through the code for the extruder and it seams like there is missing commands in the main

it seams to that there should be code for moving the stepper motor.

it is from the file "extruder.c"

function
int main (void)
{
	init();

	enable_heater();

	// main loop
	for (;winking smiley
	{
		wd_reset();

		//Read motor PWM
		motor_pwm = analog_read(TRIM_POT_CHANNEL) >> 2;

		ifclock(CLOCK_FLAG_10MS) {
			// check temperatures and manage heaters
			temp_sensor_tick();
		}
		
		// check if we've had a new intercom packet
		if (intercom_flags & FLAG_NEW_RX) {
			intercom_flags &= ~FLAG_NEW_RX;

			switch (rx.packet.control_word) {
				// M105- read temperatures
				case 105:
					send_temperature(0, temp_get(0));
					temp_set(0, read_temperature(0));
					send_temperature(1, temp_get(1));
					temp_set(1, read_temperature(1));
					start_send();
					break;
				// M130 - set PID P factor
				case 130:
					pid_set_p(rx.packet.control_index, rx.packet.control_data_int32);
				// M131 - set PID I factor
				case 131:
					pid_set_i(rx.packet.control_index, rx.packet.control_data_int32);
				// M132 - set PID D factor
				case 132:
					pid_set_d(rx.packet.control_index, rx.packet.control_data_int32);
				// M133 - set PID I limit
				case 133:
					pid_set_i_limit(rx.packet.control_index, rx.packet.control_data_int32);
				// M134 - save PID values to eeprom
				case 134:
					heater_save_settings();
					break;
			}
		}
		
		if (intercom_flags & FLAG_TX_FINISHED) {
			WRITE(TX_ENABLE_PIN,0);
		}
	}
}

In the same file a function by this name:

ISR(PCINT0_vect)

as fare as i can see it is the only pace in the code there can move the motor,
but i don't see any call of this function.


So is there a problem or is it something I have to define to make the motor work.

Many Thanks

SirBj
Attachments:
open | download - extruder.c (4.7 KB)
Re: Teacup Firmware Extruder stepper motor command not included
November 11, 2012 10:04AM
Admittedly, the problem with Gen3 is, it's very rarely used these days and the ones using Gen3 apparently never upgrade, so regressions take many months before they're discovered. All stuff inside the extruder directory is used solely for Gen3, so this stuff is untouched for some 18 months now.

Looking at Teacup's history, the last change for Gen3 is about 290 commits back from the Gen7 branch (aka development branch).

Two things should help:

- Step through every commit since then and watch out for changes of the corresponding file in the main directory. As far as I understood the Gen3 people back then, equally named files in both directories are expected to have (mostly?) the same contents. So changes to the counterpart in the main directory should be applied to the file in the extruder directory as well.

- Alternatively, check out that version 290 commits back ("git checkout Gen7~290") and look how much of this "same-named files have the same contents" is true. In case it's true, the file in the extruder directory could be simplified to something like this (example on extruder/temp.c):

#define EXTRUDER

#include "../temp.c"

The entire point of the extruder directory is to allow compilation with the Arduino IDE and this IDE simply compiles and links everything it can find together, so each compilation target has to maintain it's own directory.

As I don't have a Gen3 I can't test this, but I'll definitively try to help with my knowledge.


P.S.: there are definitively people running Teacup on a Gen3 electronics, so I'm pretty sure it worked well at some point in time.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Teacup Firmware Extruder stepper motor command not included
November 11, 2012 12:44PM
P.S.: I'd love to see the results going into the Teacup repo.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Teacup Firmware Extruder stepper motor command not included
November 11, 2012 08:13PM
@sirbj can I see your config file?


"Get busy living, or get busy dieing" - Red
Re: Teacup Firmware Extruder stepper motor command not included
November 12, 2012 04:22AM
sure

I have attached it

-SirBj
Attachments:
open | download - config.h (2.1 KB)
Re: Teacup Firmware Extruder stepper motor command not included
November 12, 2012 09:01AM
Awesome thanks sirbj. I'll try that tomorrow, atleast I'll know if I was making a mistake or if the environment is acting up now smiling smiley. To get the extruder code to compile I had to copy a file from the main directory to the extruder directory...
Re: Teacup Firmware Extruder stepper motor command not included
November 13, 2012 08:27PM
SirBJ.

Question or comment, I'm not sure yet.

In the config.h file it says "For a GEN3 set temp_type to TT_INTERCOM and temp_pin to 0." but you used TT_Thirmistor. Do you have the extruder controller board that goes with Gen3? That may cause the issue.

I'm still trying to get mine to compile, but thought I would share.
Re: Teacup Firmware Extruder stepper motor command not included
November 13, 2012 09:23PM
I see it now. You sent me the extruder config.h and I thought i was looking at the main board config.h
Re: Teacup Firmware Extruder stepper motor command not included
November 13, 2012 09:59PM
Ok, I am on the same page now, I did get a twitch of life from my extruder before the machine froze, but that's tomorrows problem.
Re: Teacup Firmware Extruder stepper motor command not included
November 26, 2012 05:22PM
Hey

I have bin looking though the g-code commands, and I cant find one there force the extruder to run.

Is that because no such command are?,
or do I have to use the G1 and then accept that it may move.

//SirBj

Adam.m.Nelson
do you want my config file for the motherboard?
Re: Teacup Firmware Extruder stepper motor command not included
November 27, 2012 07:46AM
This snippet is from extruder/extruder.c, line 77ff. To me it looks like the extruder motor is advanced by picking up a step signal from an (often repeated) timer interrupt.

ISR(PCINT0_vect) {
	static uint8_t coil_pos, pwm;

	//if the step pin is high, we advance the motor
	if (READ(E_STEP_PIN)) {

		//Turn on motors only on first tick to save power I guess
		enable_motors();

		//Advance the coil position
		if (READ(E_DIR_PIN)) 
			coil_pos++;
		else
			coil_pos--;


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Teacup Firmware Extruder stepper motor command not included
December 05, 2012 08:52AM
Sirbj, no ty. Once I realised what's going on I got it sorted out smiling smiley. thanks.

Actually, sure post it up. It can't hurt to take a look.
GMT
Re: Teacup Firmware Extruder stepper motor command not included
December 16, 2012 02:14AM
Hello everyone,

Look at that [forums.reprap.org]. It may help. I have managed to make it work (almost) with my setup.

Obs: I have not changed the config.h for the extruder controler to compile it. The only changes i made was on the MB config.h
Sorry, only registered users may post in this forum.

Click here to login