kopia lustrzana https://gitlab.com/sane-project/backends
genesys: Add new motor slope type
rodzic
15819a7d12
commit
b43a21d25a
|
@ -456,9 +456,11 @@ SANE_Int sanei_genesys_create_slope_table3(const Genesys_Motor& motor,
|
|||
/* final speed */
|
||||
vtarget = (exposure_time * yres) / motor.base_ydpi;
|
||||
|
||||
const auto& slope = motor.get_slope(step_type).legacy();
|
||||
|
||||
unsigned u_step_type = static_cast<unsigned>(step_type);
|
||||
vstart = motor.get_slope(step_type).maximum_start_speed;
|
||||
vend = motor.get_slope(step_type).maximum_speed;
|
||||
vstart = slope.maximum_start_speed;
|
||||
vend = slope.maximum_speed;
|
||||
|
||||
vtarget = std::min(vtarget >> u_step_type, 65535u);
|
||||
vstart = std::min(vstart >> u_step_type, 65535u);
|
||||
|
@ -470,8 +472,8 @@ SANE_Int sanei_genesys_create_slope_table3(const Genesys_Motor& motor,
|
|||
vtarget,
|
||||
vstart,
|
||||
vend,
|
||||
motor.get_slope(step_type).minimum_steps << u_step_type,
|
||||
motor.get_slope(step_type).g,
|
||||
slope.minimum_steps << u_step_type,
|
||||
slope.g,
|
||||
used_steps,
|
||||
&vfinal);
|
||||
|
||||
|
@ -556,7 +558,7 @@ SANE_Int sanei_genesys_exposure_time2(Genesys_Device * dev, float ydpi,
|
|||
StepType step_type, int endpixel, int exposure_by_led)
|
||||
{
|
||||
int exposure_by_ccd = endpixel + 32;
|
||||
int exposure_by_motor = static_cast<int>((dev->motor.get_slope(step_type).maximum_speed *
|
||||
int exposure_by_motor = static_cast<int>((dev->motor.get_slope(step_type).legacy().maximum_speed *
|
||||
dev->motor.base_ydpi) / ydpi);
|
||||
|
||||
int exposure = exposure_by_ccd;
|
||||
|
|
|
@ -870,7 +870,7 @@ static void gl841_init_motor_regs(Genesys_Device* dev, const Genesys_Sensor& sen
|
|||
|
||||
if (action == MOTOR_ACTION_HOME_FREE) {
|
||||
/* HOME_FREE must be able to stop in one step, so do not try to get faster */
|
||||
fast_exposure = dev->motor.get_slope(StepType::FULL).maximum_start_speed;
|
||||
fast_exposure = dev->motor.get_slope(StepType::FULL).legacy().maximum_start_speed;
|
||||
}
|
||||
|
||||
sanei_genesys_create_slope_table3(dev->motor,
|
||||
|
|
|
@ -48,9 +48,19 @@
|
|||
|
||||
namespace genesys {
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const Genesys_Motor_Slope& slope)
|
||||
std::ostream& operator<<(std::ostream& out, const MotorSlope& slope)
|
||||
{
|
||||
out << "Genesys_Motor_Slope{\n"
|
||||
<< " initial_speed_w: " << slope.initial_speed_w << '\n'
|
||||
<< " max_speed_w: " << slope.max_speed_w << '\n'
|
||||
<< " a: " << slope.acceleration << '\n'
|
||||
<< '}';
|
||||
return out;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const MotorSlopeLegacy& slope)
|
||||
{
|
||||
out << "MotorSlopeLegacy{\n"
|
||||
<< " maximum_start_speed: " << slope.maximum_start_speed << '\n'
|
||||
<< " maximum_speed: " << slope.maximum_speed << '\n'
|
||||
<< " minimum_steps: " << slope.minimum_steps << '\n'
|
||||
|
@ -59,6 +69,16 @@ std::ostream& operator<<(std::ostream& out, const Genesys_Motor_Slope& slope)
|
|||
return out;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const Genesys_Motor_Slope& slope)
|
||||
{
|
||||
if (slope.type() == Genesys_Motor_Slope::LEGACY) {
|
||||
out << slope.legacy();
|
||||
} else {
|
||||
out << slope.physical();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const Genesys_Motor& motor)
|
||||
{
|
||||
out << "Genesys_Motor{\n"
|
||||
|
|
|
@ -50,17 +50,72 @@
|
|||
|
||||
namespace genesys {
|
||||
|
||||
struct Genesys_Motor_Slope
|
||||
{
|
||||
Genesys_Motor_Slope() = default;
|
||||
Genesys_Motor_Slope(int p_maximum_start_speed, int p_maximum_speed, int p_minimum_steps,
|
||||
float p_g) :
|
||||
maximum_start_speed(p_maximum_start_speed),
|
||||
maximum_speed(p_maximum_speed),
|
||||
minimum_steps(p_minimum_steps),
|
||||
g(p_g)
|
||||
{}
|
||||
/* Describes a motor acceleration curve.
|
||||
|
||||
The curves are described in two ways: legacy and physical modes.
|
||||
|
||||
LEGACY mode
|
||||
|
||||
The legacy mode is to be removed and described the motor slope as a purely mathematical
|
||||
power law formula:
|
||||
|
||||
v(step) = sl.maximum_start_speed * (1 - pow(q, sl.g)) + sl.maximum_speed * pow(q, sl.g) (1)
|
||||
|
||||
where `q = step_number / s.minimum_steps`, `sl` is the slope config.
|
||||
|
||||
|
||||
PHYSICAL mode
|
||||
|
||||
Definitions:
|
||||
v - speed in steps per pixeltime
|
||||
w - speed in pixel times per step. w = 1 / v
|
||||
a - acceleration in steps per pixeltime squared
|
||||
s - distance travelled in steps
|
||||
t - time in pixeltime
|
||||
|
||||
The physical mode defines the curve in physical quantities. We asssume that the scanner head
|
||||
accelerates from standstill to the target speed uniformly. Then:
|
||||
|
||||
v(t) = v(0) + a * t (2)
|
||||
|
||||
Where `a` is acceleration, `t` is time. Also we can calculate the travelled distance `s`:
|
||||
|
||||
s(t) = v(0) * t + a * t^2 / 2 (3)
|
||||
|
||||
The actual motor slope is defined as the duration of each motor step. That means we need to
|
||||
define speed in terms of travelled distance.
|
||||
|
||||
Solving (3) for `t` gives:
|
||||
|
||||
sqrt( v(0)^2 + 2 * a * s ) - v(0)
|
||||
t(s) = --------------------------------- (4)
|
||||
a
|
||||
|
||||
Combining (4) and (2) will yield:
|
||||
|
||||
v(s) = sqrt( v(0)^2 + 2 * a * s ) (5)
|
||||
|
||||
The data in the slope struct MotorSlope corresponds to the above in the following way:
|
||||
|
||||
maximum_start_speed is `w(0) = 1/v(0)`
|
||||
|
||||
maximum_speed is defines maximum speed which should not be exceeded
|
||||
|
||||
minimum_steps is not used
|
||||
|
||||
g is `a`
|
||||
|
||||
Given the start and target speeds on a known motor curve, `a` can be computed as follows:
|
||||
|
||||
v(t1)^2 - v(t0)^2
|
||||
a = ----------------- (6)
|
||||
2 * s
|
||||
|
||||
Here `v(t0)` and `v(t1)` are the start and target speeds and `s` is the number of step required
|
||||
to reach the target speeds.
|
||||
*/
|
||||
struct MotorSlopeLegacy
|
||||
{
|
||||
// maximum speed allowed when accelerating from standstill. Unit: pixeltime/step
|
||||
int maximum_start_speed = 0;
|
||||
// maximum speed allowed. Unit: pixeltime/step
|
||||
|
@ -68,20 +123,55 @@ struct Genesys_Motor_Slope
|
|||
// number of steps used for default curve
|
||||
int minimum_steps = 0;
|
||||
|
||||
/* power for non-linear acceleration curves.
|
||||
vs*(1-i^g)+ve*(i^g) where
|
||||
vs = start speed, ve = end speed,
|
||||
i = 0.0 for first entry and i = 1.0 for last entry in default table
|
||||
*/
|
||||
// power for non-linear acceleration curves.
|
||||
float g = 0;
|
||||
};
|
||||
|
||||
/* start speed, max end speed, step number */
|
||||
/* maximum speed (second field) is used to compute exposure as seen by motor */
|
||||
/* exposure=max speed/ slope dpi * base dpi */
|
||||
/* 5144 = max pixels at 600 dpi */
|
||||
/* 1288=(5144+8)*ydpi(=300)/base_dpi(=1200) , where 5152 is exposure */
|
||||
/* 6440=9660/(1932/1288) */
|
||||
// { 9560, 1912, 31, 0.8 },
|
||||
struct MotorSlope
|
||||
{
|
||||
// initial speed in pixeltime per step
|
||||
unsigned initial_speed_w = 0;
|
||||
|
||||
// max speed in pixeltime per step
|
||||
unsigned max_speed_w = 0;
|
||||
|
||||
// acceleration in steps per pixeltime squared.
|
||||
float acceleration = 0;
|
||||
};
|
||||
|
||||
class Genesys_Motor_Slope
|
||||
{
|
||||
public:
|
||||
enum SlopeType : unsigned {
|
||||
LEGACY,
|
||||
PHYSICAL
|
||||
};
|
||||
|
||||
Genesys_Motor_Slope(const MotorSlopeLegacy& slope) : legacy_slope_{slope}, type_{LEGACY} {}
|
||||
Genesys_Motor_Slope(const MotorSlope& slope) : slope_{slope}, type_{PHYSICAL} {}
|
||||
Genesys_Motor_Slope(const Genesys_Motor_Slope&) = default;
|
||||
Genesys_Motor_Slope& operator=(const Genesys_Motor_Slope&) = default;
|
||||
|
||||
SlopeType type() const { return type_; }
|
||||
|
||||
const MotorSlopeLegacy& legacy() const
|
||||
{
|
||||
if (type_ != LEGACY)
|
||||
throw SaneException("Unexpected slope type");
|
||||
return legacy_slope_;
|
||||
}
|
||||
|
||||
const MotorSlope& physical() const
|
||||
{
|
||||
if (type_ != PHYSICAL)
|
||||
throw SaneException("Unexpected slope type");
|
||||
return slope_;
|
||||
}
|
||||
|
||||
private:
|
||||
MotorSlopeLegacy legacy_slope_;
|
||||
MotorSlope slope_;
|
||||
SlopeType type_;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& out, const Genesys_Motor_Slope& slope);
|
||||
|
|
|
@ -53,21 +53,21 @@ void genesys_init_motor_tables()
|
|||
{
|
||||
s_motors.init();
|
||||
|
||||
Genesys_Motor_Slope slope;
|
||||
MotorSlopeLegacy slope;
|
||||
|
||||
Genesys_Motor motor;
|
||||
motor.id = MotorId::UMAX;
|
||||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 2400;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 3000;
|
||||
slope.minimum_steps = 128;
|
||||
slope.g = 1.0;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 3000;
|
||||
slope.minimum_steps = 128;
|
||||
|
@ -82,14 +82,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 2400;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 2000;
|
||||
slope.maximum_speed = 1375;
|
||||
slope.minimum_steps = 128;
|
||||
slope.g = 0.5;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 2000;
|
||||
slope.maximum_speed = 1375;
|
||||
slope.minimum_steps = 128;
|
||||
|
@ -104,14 +104,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 2400;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 2289;
|
||||
slope.maximum_speed = 2100;
|
||||
slope.minimum_steps = 128;
|
||||
slope.g = 0.3f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 2289;
|
||||
slope.maximum_speed = 2100;
|
||||
slope.minimum_steps = 128;
|
||||
|
@ -126,14 +126,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 2400;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 3000;
|
||||
slope.minimum_steps = 128;
|
||||
slope.g = 0.25;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 3000;
|
||||
slope.minimum_steps = 128;
|
||||
|
@ -148,7 +148,7 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 1200;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 3000;
|
||||
|
@ -156,7 +156,7 @@ void genesys_init_motor_tables()
|
|||
slope.g = 0.25;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 3000;
|
||||
slope.minimum_steps = 128;
|
||||
|
@ -171,14 +171,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 600;
|
||||
motor.optical_ydpi = 1200;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3200;
|
||||
slope.maximum_speed = 1200;
|
||||
slope.minimum_steps = 128;
|
||||
slope.g = 0.5;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3200;
|
||||
slope.maximum_speed = 1200;
|
||||
slope.minimum_steps = 128;
|
||||
|
@ -193,14 +193,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 2400;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1300;
|
||||
slope.minimum_steps = 60;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1400;
|
||||
slope.minimum_steps = 60;
|
||||
|
@ -215,14 +215,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 600;
|
||||
motor.optical_ydpi = 600;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1300;
|
||||
slope.minimum_steps = 60;
|
||||
slope.g = 0.25;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1400;
|
||||
slope.minimum_steps = 60;
|
||||
|
@ -237,7 +237,7 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 300;
|
||||
motor.optical_ydpi = 600;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
// works best with GPIO10, GPIO14 off
|
||||
slope.maximum_start_speed = 3700;
|
||||
slope.maximum_speed = 3700;
|
||||
|
@ -245,7 +245,7 @@ void genesys_init_motor_tables()
|
|||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 11000;
|
||||
slope.minimum_steps = 2;
|
||||
|
@ -260,14 +260,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 750;
|
||||
motor.optical_ydpi = 1500;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 2500;
|
||||
slope.minimum_steps = 10;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 11000;
|
||||
slope.minimum_steps = 2;
|
||||
|
@ -282,14 +282,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 750;
|
||||
motor.optical_ydpi = 1500;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 2600;
|
||||
slope.minimum_steps = 10;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 11000;
|
||||
slope.maximum_speed = 11000;
|
||||
slope.minimum_steps = 2;
|
||||
|
@ -303,14 +303,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 750;
|
||||
motor.optical_ydpi = 1500;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 6666;
|
||||
slope.maximum_speed = 3700;
|
||||
slope.minimum_steps = 8;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 6666;
|
||||
slope.maximum_speed = 3700;
|
||||
slope.minimum_steps = 8;
|
||||
|
@ -325,21 +325,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 6400;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 127;
|
||||
slope.g = 0.50;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1500;
|
||||
slope.minimum_steps = 127;
|
||||
slope.g = 0.50;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step 0.75*2712
|
||||
slope = MotorSlopeLegacy(); // quarter step 0.75*2712
|
||||
slope.maximum_start_speed = 3*2712;
|
||||
slope.maximum_speed = 3*2712;
|
||||
slope.minimum_steps = 16;
|
||||
|
@ -354,21 +354,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 6400;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 127;
|
||||
slope.g = 0.50;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1500;
|
||||
slope.minimum_steps = 127;
|
||||
slope.g = 0.50;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step 0.75*2712
|
||||
slope = MotorSlopeLegacy(); // quarter step 0.75*2712
|
||||
slope.maximum_start_speed = 3*2712;
|
||||
slope.maximum_speed = 3*2712;
|
||||
slope.minimum_steps = 16;
|
||||
|
@ -383,21 +383,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 6400;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 127;
|
||||
slope.g = 0.50f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1500;
|
||||
slope.minimum_steps = 127;
|
||||
slope.g = 0.50f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step 0.75*2712
|
||||
slope = MotorSlopeLegacy(); // quarter step 0.75*2712
|
||||
slope.maximum_start_speed = 3*2712;
|
||||
slope.maximum_speed = 3*2712;
|
||||
slope.minimum_steps = 16;
|
||||
|
@ -412,21 +412,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 1200;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // max speed / dpi * base dpi => exposure
|
||||
slope = MotorSlopeLegacy(); // max speed / dpi * base dpi => exposure
|
||||
slope.maximum_start_speed = 22222;
|
||||
slope.maximum_speed = 500;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.5;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 22222;
|
||||
slope.maximum_speed = 500;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.5;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 22222;
|
||||
slope.maximum_speed = 500;
|
||||
slope.minimum_steps = 246;
|
||||
|
@ -441,21 +441,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step
|
||||
slope = MotorSlopeLegacy(); // quarter step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
|
@ -470,21 +470,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step
|
||||
slope = MotorSlopeLegacy(); // quarter step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
|
@ -499,21 +499,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1600;
|
||||
motor.optical_ydpi = 6400;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step
|
||||
slope = MotorSlopeLegacy(); // quarter step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
|
@ -528,21 +528,21 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step
|
||||
slope = MotorSlopeLegacy(); // quarter step
|
||||
slope.maximum_start_speed = 3961;
|
||||
slope.maximum_speed = 240;
|
||||
slope.minimum_steps = 246;
|
||||
|
@ -557,7 +557,7 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 4800;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 256;
|
||||
|
@ -572,7 +572,7 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 4800;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 256;
|
||||
|
@ -587,7 +587,7 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 4800;
|
||||
motor.optical_ydpi = 9600;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 256;
|
||||
|
@ -602,14 +602,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 2400;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1300;
|
||||
slope.minimum_steps = 60;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 3250;
|
||||
slope.minimum_steps = 60;
|
||||
|
@ -645,14 +645,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 600;
|
||||
motor.optical_ydpi = 1200;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1300;
|
||||
slope.minimum_steps = 60;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 3250;
|
||||
slope.minimum_steps = 60;
|
||||
|
@ -667,14 +667,14 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 600;
|
||||
motor.optical_ydpi = 1200;
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 1300;
|
||||
slope.minimum_steps = 60;
|
||||
slope.g = 0.8f;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 3500;
|
||||
slope.maximum_speed = 3250;
|
||||
slope.minimum_steps = 60;
|
||||
|
@ -689,7 +689,7 @@ void genesys_init_motor_tables()
|
|||
motor.base_ydpi = 2400;
|
||||
motor.optical_ydpi = 4800; // 9600
|
||||
|
||||
slope = Genesys_Motor_Slope();
|
||||
slope = MotorSlopeLegacy();
|
||||
slope.maximum_start_speed = 9560;
|
||||
slope.maximum_speed = 1912;
|
||||
slope.minimum_steps = 31;
|
||||
|
|
|
@ -33,28 +33,28 @@ namespace genesys {
|
|||
|
||||
void test_create_slope_table()
|
||||
{
|
||||
Genesys_Motor_Slope slope;
|
||||
MotorSlopeLegacy slope;
|
||||
|
||||
Genesys_Motor motor;
|
||||
motor.id = MotorId::CANON_LIDE_200;
|
||||
motor.base_ydpi = 1200;
|
||||
motor.optical_ydpi = 6400;
|
||||
|
||||
slope = Genesys_Motor_Slope(); // full step
|
||||
slope = MotorSlopeLegacy(); // full step
|
||||
slope.maximum_start_speed = 10000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 20;
|
||||
slope.g = 0.80;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // half step
|
||||
slope = MotorSlopeLegacy(); // half step
|
||||
slope.maximum_start_speed = 10000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 20;
|
||||
slope.g = 0.80;
|
||||
motor.slopes.push_back(slope);
|
||||
|
||||
slope = Genesys_Motor_Slope(); // quarter step 0.75*2712
|
||||
slope = MotorSlopeLegacy(); // quarter step 0.75*2712
|
||||
slope.maximum_start_speed = 10000;
|
||||
slope.maximum_speed = 1000;
|
||||
slope.minimum_steps = 16;
|
||||
|
|
Ładowanie…
Reference in New Issue