planner.cpp

Marlin v 1.0.0


重要変数

//===========================================================================
//=============================public variables ============================
//===========================================================================


unsigned long minsegmenttime;
float max_feedrate[4]; // set the max speeds
float axis_steps_per_unit[4];
unsigned long max_acceleration_units_per_sq_second[4]; // Use M201 to override by software
float minimumfeedrate;
float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
float max_z_jerk;
float max_e_jerk;
float mintravelfeedrate;
unsigned long axis_steps_per_sqr_second[NUM_AXIS]; // (NUM_AXIS=4)

// The current position of the tool in absolute steps
long position[4]; //rescaled from extern when axis_steps_per_unit are changed by gcode

static float previous_speed[4]; // Speed of previous path line segment
static float previous_nominal_speed; // Nominal speed of previous path line segment

#ifdef AUTOTEMP
float autotemp_max = 250;
float autotemp_min = 210;
float autotemp_factor = 0.1;
bool autotemp_enabled = false;
#endif

block_t block_buffer[BLOCK_BUFFER_SIZE]; // A ring buffer for motion instfructions (BLOCK_BUFFER_SIZE=16)
volatile unsigned char block_buffer_head; // Index of the next block to be pushed
volatile unsigned char block_buffer_tail; // Index of the block to process now

 ステッパー用のカウント数がlongで宣言されているが、扱える数値の範囲は実用範囲内なのかな?巨大な装置では見直しが必要だね。といっても、そんなに巨大なものは無いだろうが。


next_block_index()

 次のブロックインデックスを返す。


prev_block_index()

 直前のブロックインデックスを返す。


estimate_acceleration_distance()


intersection_distance()


calculate_trapezoid_for_block()

処理関数 概要 コメント

max_allowable_speed()


planner_reverse_pass_kernel()

処理関数 概要 コメント
max_allowable_speed()

planner_reverse_pass()

処理関数 概要 コメント
prev_block_index()
planner_reverse_pass_kernel()

planner_forward_pass_kernel()

処理関数 概要 コメント
max_allowable_speed()

planner_forward_pass()

処理関数 概要 コメント
planner_forward_pass_kernel()
next_block_index()

planner_recalculate_trapezoids()

処理関数 概要 コメント
calculate_trapezoid_for_block()
next_block_index()

planner_recalculate()

処理関数 概要 コメント
planner_reverse_pass()
planner_forward_pass()
planner_recalculate_trapezoids()

plan_init() PLAN初期化処理

 ブロックバッファを0に初期化し、ポジション管理用メモリーを確保、各(X,Y,Z,E)スピードを0に初期化する。


getHighESpeed()

処理関数 概要 コメント
degTargetHotend0() temperature.h
setTargetHotend0() temperature.h

check_axes_activity()

処理関数 概要 コメント
disable_x() X軸停止処理 Marlin.h
disable_y() Y軸停止処理 Marlin.h
disable_z() Z軸停止処理 Marlin.h
disable_e0() E0軸停止処理 Marlin.h
disable_e1() E1軸停止処理 Marlin.h
disable_e2() E2軸停止処理 Marlin.h
analogWrite() 指定したピンからアナログ値(PWM波)を出力 Arduino
getHighESpeed()

plan_buffer_line() 直線補間の座標を与えて動作要求指示する処理

 実際の直線補間に採用される座標は、各ステッピングモーターの動作最小整数(マイクロステップ動作)単位に丸められる。
 つまり、XYで0.01mm前後でしか動作しない。

処理関数 概要 コメント
next_block_index()
manage_heater() ヒーター管理処理
manage_inactivity() 不活性状態管理処理
lcd_update() 表示の更新処理
degHotend() temperature.h
SERIAL_ECHOLNPGM() Marin.h
enable_x() X軸稼働処理 Marin.h
enable_y() Y軸稼働処理 Marin.h
enable_z() Z軸稼働処理 Marin.h
enable_e0() E0軸稼働処理 Marin.h
enable_e1() E1軸稼働処理 Marin.h
enable_e2() E2軸稼働処理 Marin.h
estimate_acceleration_distance()
calculate_trapezoid_for_block()
planner_recalculate()
st_wake_up()

plan_set_position()

処理関数 概要 コメント
st_set_position()

plan_set_e_position()

処理関数 概要 コメント
st_set_e_position()

movesplanned()


allow_cold_extrudes()


reset_acceleration_rates()