def __init__(self, params): Motor.__init__(self, params) self.config = { \ 'Name' : 'Async', \ 'Phases' : 3, \ 'Views' : 3 \ } self.parameters.update({ \ 'P' : 'Number of polepairs', \ 'Ls' : 'Stator inductance [H]', \ 'Rs' : 'Stator resistance [ohm]', \ 'Lr' : 'Rotor inductance [H]', \ 'Rr' : 'Rotor resistenca [H]', \ 'Lm' : 'Mutual inductance [H]' }) self.Vin = [float("Nan"), float("Nan"), float("Nan")] self.I = [0.0, 0.0, 0.0] # Motor currents [A] self.Ia = 0. # Motor input currents in ab self.Ib = 0. self.Phia = 0. # Motor flux in ab self.Phib = 0. self.J = 0.01 # Default test self.set_parameters(params) # Precalc something self.K = 1./(self.Ls*self.Lr - self.Lm*self.Lm) return
def __init__(self, pin_motor_in1, pin_motor_in2, pin_motor_pwm, pin_servo_pwm, options): Motor.__init__(self, pin_motor_in1, pin_motor_in2, pin_motor_pwm, pin_servo_pwm, options) GPIO.cleanup() GPIO.setmode(GPIO.BCM) GPIO.setup(pin_motor_in1, GPIO.OUT) GPIO.setup(pin_motor_in2, GPIO.OUT) GPIO.setup(pin_motor_pwm, GPIO.OUT) GPIO.setup(pin_servo_pwm, GPIO.OUT) self.pin_motor_in1 = pin_motor_in1 self.pin_motor_in2 = pin_motor_in2 self.pin_motor_pwm = pin_motor_pwm self.pin_servo_pwm = pin_servo_pwm self.motor = GPIO.PWM(pin_motor_pwm, self.CLOCK) self.stearing = GPIO.PWM(pin_servo_pwm, self.CLOCK)
def __init__(self, params): Motor.__init__(self, params) self.config = { \ 'Name' : 'BLDC', \ 'Phases' : 3, \ 'Views' : 3 \ } self.parameters.update({ \ 'P' : 'Number of polepairs', \ 'Ld' : 'D-axis inductance [H]', \ 'Lq' : 'Q-axis inductance [H]', \ 'R' : 'Coil resistance [ohm]', \ 'Ke' : 'Flux coefficient [B?/rad]' \ }) self.Vin = [float("Nan"), float("Nan"), float("Nan")] self.I = [0.0, 0.0, 0.0] # Motor currents [A] self.Bemf = [0.0, 0.0, 0.0] # Back-EMF voltage [A] self.hall = [0, 0, 0] # Hall position sensors self.set_parameters(params) return
def __init__(self, identifier, address, sync_client, type): Motor.__init__(self, identifier, address, sync_client) self.initialized = False if type == "left": self.multiplier = -1 elif type == "right": self.multiplier = 1 else: self.multiplier = 1 self.current_speed = 0
def __init__(self, params): Motor.__init__(self, params) self.config = { \ 'Name' : 'PMDC', \ 'Phases' : 1, \ 'Views' : 3 \ } self.parameters.update({ \ 'L' : 'Coil inductance [H]', \ 'R' : 'Coil resistance [ohm]', \ 'Ke' : 'Voltage coefficient [V/rad]' \ }) self.Vin = float("Nan") self.I = 0.0 # Motor current [A] self.Bemf = 0.0 # Back-EMF voltage [A] self.set_parameters(params) return
def __init__(self, params): Motor.__init__(self, params) self.config = { \ 'Name' : 'DC', \ 'Phases' : 2, \ 'Views' : 3 \ } self.parameters.update({ \ 'Lf' : 'Field coil inductance [H]', \ 'Rf' : 'Field coil resistance [ohm]', \ 'Ra' : 'Armature coil resistance [ohm]', \ 'Ke' : 'Voltage coefficient [V/rad]' \ }) self.Vin = [float("Nan"), float("NaN")] self.I = [0.0, 0.0] # Motor current [A] self.Bemf = 0.0 # Back-EMF voltage [A] self.set_parameters(params) return
def __init__(self, name): Motor.__init__(self, name, name) self.serial_com = serial.Serial(Config.get_swivel_encoder_port(),Config.get_swivel_encoder_baud()) self._last_angle = 0
def __init__(self, nome, pin_vel, pin_dir): self.name = nome Motor.__init__(self, pin_vel, pin_dir)
def __init__(self, identifier, address, sync_client): assert isinstance(identifier, str) assert isinstance(sync_client, ModbusSerialClient) assert isinstance(address, int) Motor.__init__(self, identifier, address, sync_client) self.initialized = False