Ejemplo n.º 1
0
        public KinematicPolar(ToolHead toolhead, ConfigWrapper config)
        {
            // Setup axis steppers
            var stepper_bed = new PrinterStepper(config.getsection("stepper_bed"));
            var rail_arm    = new PrinterRail(config.getsection("stepper_arm"));
            var rail_z      = PrinterRail.LookupMultiRail(config.getsection("stepper_z"));

            stepper_bed.setup_itersolve(KinematicType.polar, new object[] { "a" });
            rail_arm.setup_itersolve(KinematicType.polar, "r");
            rail_z.setup_itersolve(KinematicType.cartesian, "z");
            this.rails = new PrinterRail[] {
                rail_arm,
                rail_z
            };
            this.steppers.Add(stepper_bed);
            this.steppers.AddRange(rail_arm.get_steppers());
            this.steppers.AddRange(rail_z.get_steppers());

            // Setup boundary checks
            var _tup_1       = toolhead.get_max_velocity();
            var max_velocity = _tup_1.Item1;
            var max_accel    = _tup_1.Item2;

            this.max_z_velocity    = config.getfloat("max_z_velocity", max_velocity, above: 0.0, maxval: max_velocity);
            this.max_z_accel       = config.getfloat("max_z_accel", max_accel, above: 0.0, maxval: max_accel);
            this.need_motor_enable = true;
            this.limit_z           = new Vector2d(1, -1);
            this.limit_xy2         = -1.0;
            // Setup stepper max halt velocity
            var max_halt_velocity = toolhead.get_max_axis_halt();

            stepper_bed.set_max_jerk(max_halt_velocity, max_accel);
            rail_arm.set_max_jerk(max_halt_velocity, max_accel);
            rail_z.set_max_jerk(max_halt_velocity, max_accel);
        }