Gen7T Step pulse width April 07, 2012 09:23PM |
Registered: 13 years ago Posts: 632 |
Re: Gen7T Step pulse width April 08, 2012 03:00AM |
Registered: 12 years ago Posts: 2,705 |
WRITE(X_STEP_PIN,LOW); WRITE(Y_STEP_PIN,LOW); WRITE(Z_STEP_PIN,LOW); #if USE_OPS==0 && !defined(USE_ADVANCE) extruder_unstep(); #endif
} // stepsRemaining
ISR(EXTRUDER_TIMER_VECTOR) { #if USE_OPS==1 || defined(USE_ADVANCE) extruder_unstep(); #endif EXTRUDER_OCR += printer_state.timer0Interval; // time to come back counter_periodical+= printer_state.timer0Interval; // Appxoimate a 10ms timer if(counter_periodical>OVERFLOW_PERIODICAL) { counter_periodical-=OVERFLOW_PERIODICAL; execute_periodical=1; } #ifdef SIMULATE_PWM // Sanguino boards have the heater output on a pin with PWM for // timer 1. This software pwm solves the problem with the timer // already in use. #if NUM_EXTRUDER==1 Extruder *ext = &extruder[0]; if(ext->heatManager) { // Extruder with pid control found if(ext->pwmState<=ext->pwm) { ext->pwmState+=printer_state.timer0Interval; if(ext->pwmState>=2040) { ext->pwmState=0; WRITE(EXT0_HEATER_PIN,1 ); } else if(ext->pwmState>ext->pwm) { WRITE(EXT0_HEATER_PIN,0 ); } } else { ext->pwmState+=printer_state.timer0Interval; if(ext->pwmState>=2040) { ext->pwmState=0; if(ext->pwm>0) { // Turn only on for values > 0 WRITE(EXT0_HEATER_PIN,1 ); } } } } #else for(byte e=0;eheatManager) { // Extruder with pid control found if(ext->pwmState<=ext->pwm) { ext->pwmState+=printer_state.timer0Interval; if(ext->pwmState>=2040) { ext->pwmState=0; digitalWrite(ext->heaterPin,on); } else if(ext->pwmState>ext->pwm) { digitalWrite(ext->heaterPin,off); } } else { ext->pwmState+=printer_state.timer0Interval; if(ext->pwmState>=2040) { ext->pwmState=0; if(ext->pwm) { // Turn only on for values > 0 digitalWrite(ext->heaterPin,on); } } } } } #endif #endif // SIMULATE_PWM #ifdef SIMULATE_FAN_PWM // If your fan output has no pwm or pwm is blocked by this interrupt routine if(fan_pwm_pos<=fan_speed) { fan_pwm_pos+=printer_state.timer0Interval; if(fan_pwm_pos>=4080) { fan_pwm_pos=0; WRITE(FAN_PIN,1 ); } else if(fan_pwm_pos>fan_speed) { WRITE(FAN_PIN,0 ); } } else { fan_pwm_pos+=printer_state.timer0Interval; if(fan_pwm_pos>=4080) { fan_pwm_pos=0; if(fan_speed>0) { // Turn only on for values > 0 WRITE(FAN_PIN,1 ); } } } #endif UI_FAST; // Short timed user interface action #if USE_OPS==1 || defined(USE_ADVANCE) // The stepper signals are in strategical positions for optimal timing. If you // still have timing issues, add dummy commands between. if(printer_state.extruderStepsNeeded) { if(printer_state.extruderStepsNeeded<0) { // Backward step extruder_set_direction(0); if(extruder_wait_dirchange && extruder_last_dir==-1) { extruder_wait_dirchange--; return; } extruder_last_dir = 1; extruder_wait_dirchange=2; printer_state.extruderStepsNeeded++; } else { // Forward step extruder_set_direction(1); if(extruder_wait_dirchange && extruder_last_dir==1) { extruder_wait_dirchange--; return; } extruder_last_dir = -1; extruder_wait_dirchange=2; printer_state.extruderStepsNeeded--; } if(current_extruder->currentTemperatureC>=MIN_EXTRUDER_TEMP<Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware. Repetier-Server - the solution to control your printer from everywhere. Visit us on Facebook and Twitter!
Re: Gen7T Step pulse width April 08, 2012 04:28PM |
Registered: 13 years ago Posts: 632 |
Re: Gen7T Step pulse width April 20, 2012 03:27PM |
Registered: 12 years ago Posts: 17 |