Exemple #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);
        }
Exemple #2
0
        public KinematicWinch(ToolHead toolhead, ConfigWrapper config)
        {
            // Setup steppers at each anchor
            this.steppers = new List <PrinterStepper>();
            this.anchors  = new List <Vector3d>();
            for (int i = 0; i < 26; i++)
            {
                var name = "stepper_" + (char)('a' + i);
                if (i >= 3 && !config.has_section(name))
                {
                    break;
                }
                var stepper_config = config.getsection(name);
                var s = new PrinterStepper(stepper_config);
                this.steppers.Add(s);
                var anchor = new Vector3d(
                    stepper_config.getfloat("anchor_x"),
                    stepper_config.getfloat("anchor_y"),
                    stepper_config.getfloat("anchor_z"));
                this.anchors.Add(anchor);
                s.setup_itersolve(KinematicType.winch, new object[] { anchor.X, anchor.Y, anchor.Z });
            }
            // Setup stepper max halt velocity
            var _tup_1            = toolhead.get_max_velocity();
            var max_velocity      = _tup_1.Item1;
            var max_accel         = _tup_1.Item2;
            var max_halt_velocity = toolhead.get_max_axis_halt();

            foreach (var s in this.steppers)
            {
                s.set_max_jerk(max_halt_velocity, max_accel);
            }
            // Setup boundary checks
            this.need_motor_enable = true;
            this.set_position(Vector3d.Zero, null);
        }