#include "planner.h"
#include "buffer.h"
-#include "kinematics.h"
#include "stepper.h"
#include "motor.h"
#include "util.h"
}
// now determine the target steps
- ik_kinematics(mr.ms.target, mr.target_steps);
+ mp_kinematics(mr.ms.target, mr.target_steps);
// and compute the distances to be traveled
for (i = 0; i < MOTORS; i++)
#include "stepper.h"
#include "motor.h"
#include "canonical_machine.h"
-#include "kinematics.h"
#include "motor.h"
#include <stdbool.h>
// Convert to steps
float steps[MOTORS] = {0};
- ik_kinematics(travel, steps);
+ mp_kinematics(travel, steps);
// Queue segment
float error[MOTORS] = {0};
+++ /dev/null
-/******************************************************************************\
-
- This file is part of the Buildbotics firmware.
-
- Copyright (c) 2015 - 2016 Buildbotics LLC
- Copyright (c) 2010 - 2015 Alden S. Hart, Jr.
- All rights reserved.
-
- This file ("the software") is free software: you can redistribute it
- and/or modify it under the terms of the GNU General Public License,
- version 2 as published by the Free Software Foundation. You should
- have received a copy of the GNU General Public License, version 2
- along with the software. If not, see <http://www.gnu.org/licenses/>.
-
- The software is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the software. If not, see
- <http://www.gnu.org/licenses/>.
-
- For information regarding this software email:
- "Joseph Coffland" <joseph@buildbotics.com>
-
-\******************************************************************************/
-
-#include "kinematics.h"
-
-#include "canonical_machine.h"
-#include "motor.h"
-
-#include <string.h>
-
-/* Wrapper routine for inverse kinematics
- *
- * Calls kinematics function(s). Performs axis mapping & conversion
- * of length units to steps (and deals with inhibited axes)
- *
- * The reason steps are returned as floats (as opposed to, say,
- * uint32_t) is to accommodate fractional DDA steps. The DDA deals
- * with fractional step values as fixed-point binary in order to get
- * the smoothest possible operation. Steps are passed to the move prep
- * routine as floats and converted to fixed-point binary during queue
- * loading. See stepper.c for details.
- */
-void ik_kinematics(const float travel[], float steps[]) {
- // you can insert inverse kinematics transformations here
- // float joint[AXES];
- // _inverse_kinematics(travel, joint);
- // ...or just use travel directly for Cartesian machines
-
- // Map motors to axes and convert length units to steps
- // Most of the conversion math has already been done during config in
- // steps_per_unit() which takes axis travel, step angle and microsteps into
- // account.
- for (int motor = 0; motor < MOTORS; motor++) {
- int axis = motor_get_axis(motor);
- if (cm.a[axis].axis_mode == AXIS_INHIBITED) steps[motor] = 0;
- else steps[motor] = travel[axis] * motor_get_steps_per_unit(motor);
- }
-}
+++ /dev/null
-/******************************************************************************\
-
- This file is part of the Buildbotics firmware.
-
- Copyright (c) 2015 - 2016 Buildbotics LLC
- Copyright (c) 2010 - 2015 Alden S. Hart, Jr.
- All rights reserved.
-
- This file ("the software") is free software: you can redistribute it
- and/or modify it under the terms of the GNU General Public License,
- version 2 as published by the Free Software Foundation. You should
- have received a copy of the GNU General Public License, version 2
- along with the software. If not, see <http://www.gnu.org/licenses/>.
-
- The software is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the software. If not, see
- <http://www.gnu.org/licenses/>.
-
- For information regarding this software email:
- "Joseph Coffland" <joseph@buildbotics.com>
-
-\******************************************************************************/
-
-#pragma once
-
-
-void ik_kinematics(const float travel[], float steps[]);
#include "buffer.h"
#include "arc.h"
#include "canonical_machine.h"
-#include "kinematics.h"
#include "stepper.h"
#include "motor.h"
float step_position[MOTORS];
// convert lengths to steps in floating point
- ik_kinematics(mr.position, step_position);
+ mp_kinematics(mr.position, step_position);
for (uint8_t motor = 0; motor < MOTORS; motor++) {
mr.target_steps[motor] = step_position[motor];
uint8_t mp_get_runtime_busy() {
return st_runtime_isbusy() || mr.move_state == MOVE_RUN;
}
+
+
+/* Performs axis mapping & conversion of length units to steps (and deals
+ * with inhibited axes)
+ *
+ * The reason steps are returned as floats (as opposed to, say,
+ * uint32_t) is to accommodate fractional steps. stepper.c deals
+ * with fractional step values as fixed-point binary in order to get
+ * the smoothest possible operation. Steps are passed to the move prep
+ * routine as floats and converted to fixed-point binary during queue
+ * loading. See stepper.c for details.
+ */
+void mp_kinematics(const float travel[], float steps[]) {
+ // You could insert inverse kinematics transformations here
+ // or just use travel directly for Cartesian machines.
+
+ // Map motors to axes and convert length units to steps
+ // Most of the conversion math has already been done during config in
+ // steps_per_unit() which takes axis travel, step angle and microsteps into
+ // account.
+ for (int motor = 0; motor < MOTORS; motor++) {
+ int axis = motor_get_axis(motor);
+ if (cm.a[axis].axis_mode == AXIS_INHIBITED) steps[motor] = 0;
+ else steps[motor] = travel[axis] * motor_get_steps_per_unit(motor);
+ }
+}
void mp_set_runtime_work_offset(float offset[]);
void mp_zero_segment_velocity();
uint8_t mp_get_runtime_busy();
+void mp_kinematics(const float travel[], float steps[]);