Variables | |
| pin_E1CH1 = pyb.Pin(pyb.Pin.cpu.B6) | |
| The pin object connected to Encoder 1's channel 1. More... | |
| pin_E1CH2 = pyb.Pin(pyb.Pin.cpu.B7) | |
| The pin object connected to Encoder 1's channel 2. More... | |
| e1 = EncDriver('E1', pin_E1CH1, 1, pin_E1CH2, 2, 4, 1000, False) | |
| An encoder object representing the encoder attached to Motor 1. More... | |
| pin_E2CH1 = pyb.Pin(pyb.Pin.cpu.C6) | |
| The pin object connected to Encoder 2's channel 1. More... | |
| pin_E2CH2 = pyb.Pin(pyb.Pin.cpu.C7) | |
| The pin object connected to Encoder 2's channel 2. More... | |
| e2 = EncDriver('E2', pin_E2CH1, 1, pin_E2CH2, 2, 8, 1000, False) | |
| An encoder object representing the encoder attached to Motor 2. More... | |
| int | enc_conv = -60/110 |
| Conversion factor for encoder angle to platform angle. More... | |
| pin_nSLEEP = pyb.Pin(pyb.Pin.cpu.A15, pyb.Pin.OUT_PP) | |
| The pin object used for the H-bridge sleep pin. More... | |
| pin_nFAULT = pyb.Pin(pyb.Pin.board.PB2, pyb.Pin.IN) | |
| The pin object used for the motor driver fault pin. More... | |
| pin_IN1 = pyb.Pin(pyb.Pin.cpu.B4) | |
| The pin object used for the Motor 1's H-bridge input 1. More... | |
| pin_IN2 = pyb.Pin(pyb.Pin.cpu.B5) | |
| The pin object used for the Motor 1's H-bridge input 2. More... | |
| pin_IN3 = pyb.Pin(pyb.Pin.cpu.B0) | |
| The pin object used for the Motor 2's H-bridge input 1. More... | |
| pin_IN4 = pyb.Pin(pyb.Pin.cpu.B1) | |
| The pin object used for the Motor 2's H-bridge input 2. More... | |
| tim = pyb.Timer(3,freq=20000); | |
| The timer object used for PWM generation. More... | |
| mA = MotorDriver(pin_nSLEEP, pin_nFAULT, pin_IN1, 1, pin_IN2, 2, tim, new_db=2.5, dead_band=(-45,45), debug=False, primary=True) | |
| A motor object passing in the pins and timer. More... | |
| mB = MotorDriver(pin_nSLEEP, pin_nFAULT, pin_IN3, 3, pin_IN4, 4, tim, new_db=2.5, dead_band=(-45,45)) | |
| A second motor object passing in the pins and timer. More... | |
| PIN_xm = Pin(Pin.cpu.A0) | |
| The Nucleo pin connected to RTP xm. More... | |
| PIN_xp = Pin(Pin.cpu.A1) | |
| The Nucleo pin connected to RTP xp. More... | |
| PIN_ym = Pin(Pin.cpu.A6) | |
| The Nucleo pin connected to RTP ym. More... | |
| PIN_yp = Pin(Pin.cpu.A7) | |
| The Nucleo pin connected to RTP yp. More... | |
| RTP = RTP(PIN_xm,PIN_xp,PIN_ym,PIN_yp,(176,100),(88,50),filt='fir',debug=False) | |
| The RTP objct. More... | |
| i2c = I2C(-1, scl=Pin('PB8'), sda=Pin('PB9'), freq=115200) | |
| Initializes the I2C bus. More... | |
| imu = BNO055(i2c) | |
| Initializes the bno055 driver using the I2C object. More... | |
| list | Kplaty = [-14.4129, -0.00223331] |
| Y axis reduced system gains. More... | |
| list | Kplatx = [-8.4129, -0.00223331] |
| X axis reduced system gains. More... | |
| list | Ksysy = [-14.17333, -14.4129, -1.254464, -0.00223331] |
| Y axis full system gains. More... | |
| list | Ksysx = [-14.17333, -10.4129, -2.54464, -0.00223331] |
| X axis full system gains. More... | |
| int | Vdc = 18 |
| Motor nominal voltage [V]. More... | |
| float | Kt = 13.8/10**3 |
| Motor torque constant [Nm/A]. More... | |
| float | R = 2.21 |
| Motor terminal resistance [Ohms]. More... | |
| float | conv = R/(Kt*Vdc) |
| Torque to PWM duty conversion factor. More... | |
| plat_y = FSFB('KPY', Kplaty,100, conv=conv) | |
| FSFB controller for the y-axis of the platform only system. More... | |
| plat_x = FSFB('KPX', Kplatx, 100, conv=conv) | |
| FSFB controller for the x-axis of the platform only system. More... | |
| sys_y = FSFB('KY', Ksysy, 100, conv=conv) | |
| FSFB controller for the y-axis of the full system. More... | |
| sys_x = FSFB('KX', Ksysx, 100, conv=conv) | |
| FSFB controller for the x-axis of the full system. More... | |
| int | x_duty = 0 |
| PWM duty sent to motor A controlling platform x-axis. More... | |
| int | y_duty = 0 |
| PWM duty sent to motor B controlling platform y-axis. More... | |
| int | bal_lim = 20 |
| Hand balancing limits in degrees. More... | |
| int | runs = 1 |
| Number of runs. More... | |
| start_time = utime.ticks_us() | |
| Start time of the data collection. More... | |
| last_time = start_time | |
| Last time of the data collection. More... | |
| curr_time = start_time | |
| Current time of the data collection. More... | |
| el_time = curr_time - start_time | |
| Elapsed time. More... | |
| int | dt = 5*10**3 |
| Desired controller time step. More... | |
| next_time = start_time | |
| Time of next run. More... | |
| int | dt_meas = 1 |
| Measured controller time interval. More... | |
| int | dt_avg = 1 |
| Average measued time interval. More... | |
| uart = UART(2) | |
| UART communication line for debugging. More... | |
| tuple | pos = (0,0,0) |
| Ball Position from the touch pannel (x,y,z) in [m]. More... | |
| tuple | prev_pos = (0,0,0) |
| Previous ball Position from the touch pannel (x,y,z) in [m]. More... | |
| tuple | vel = (0,0,0) |
| Ball Velocity from the touch pannel in [m/s]. More... | |
| tuple | thta = (0,0,0) |
| Platform angle [rad]. More... | |
| tuple | omga = (0,0,0) |
| Platform angular velocity [rad/s]. More... | |
| int | steady_count = 0 |
| A counter that increments when the platform is stable. More... | |
| int | contact_count = 0 |
| A counter that increments when the ball is off of the platform. More... | |
| offset = curr_time | |
| Elapsed time offset, recorded on the first run. More... | |
| int balance.bal_lim = 20 |
Hand balancing limits in degrees.
| int balance.contact_count = 0 |
A counter that increments when the ball is off of the platform.
| balance.curr_time = start_time |
Current time of the data collection.
| int balance.dt = 5*10**3 |
Desired controller time step.
| tuple balance.dt_avg = 1 |
Average measued time interval.
| int balance.dt_meas = 1 |
Measured controller time interval.
An encoder object representing the encoder attached to Motor 1.
An encoder object representing the encoder attached to Motor 2.
| int balance.el_time = curr_time - start_time |
Elapsed time.
| int balance.enc_conv = -60/110 |
Conversion factor for encoder angle to platform angle.
| balance.i2c = I2C(-1, scl=Pin('PB8'), sda=Pin('PB9'), freq=115200) |
Initializes the I2C bus.
| list balance.Kplatx = [-8.4129, -0.00223331] |
X axis reduced system gains.
| list balance.Kplaty = [-14.4129, -0.00223331] |
Y axis reduced system gains.
| list balance.Ksysx = [-14.17333, -10.4129, -2.54464, -0.00223331] |
X axis full system gains.
| list balance.Ksysy = [-14.17333, -14.4129, -1.254464, -0.00223331] |
Y axis full system gains.
| float balance.Kt = 13.8/10**3 |
Motor torque constant [Nm/A].
| balance.last_time = start_time |
Last time of the data collection.
| balance.mA = MotorDriver(pin_nSLEEP, pin_nFAULT, pin_IN1, 1, pin_IN2, 2, tim, new_db=2.5, dead_band=(-45,45), debug=False, primary=True) |
A motor object passing in the pins and timer.
| balance.mB = MotorDriver(pin_nSLEEP, pin_nFAULT, pin_IN3, 3, pin_IN4, 4, tim, new_db=2.5, dead_band=(-45,45)) |
A second motor object passing in the pins and timer.
| balance.next_time = start_time |
Time of next run.
| balance.offset = curr_time |
Elapsed time offset, recorded on the first run.
| tuple balance.omga = (0,0,0) |
Platform angular velocity [rad/s].
| balance.pin_E1CH1 = pyb.Pin(pyb.Pin.cpu.B6) |
The pin object connected to Encoder 1's channel 1.
| balance.pin_E1CH2 = pyb.Pin(pyb.Pin.cpu.B7) |
The pin object connected to Encoder 1's channel 2.
| balance.pin_E2CH1 = pyb.Pin(pyb.Pin.cpu.C6) |
The pin object connected to Encoder 2's channel 1.
| balance.pin_E2CH2 = pyb.Pin(pyb.Pin.cpu.C7) |
The pin object connected to Encoder 2's channel 2.
| balance.pin_IN1 = pyb.Pin(pyb.Pin.cpu.B4) |
The pin object used for the Motor 1's H-bridge input 1.
| balance.pin_IN2 = pyb.Pin(pyb.Pin.cpu.B5) |
The pin object used for the Motor 1's H-bridge input 2.
| balance.pin_IN3 = pyb.Pin(pyb.Pin.cpu.B0) |
The pin object used for the Motor 2's H-bridge input 1.
| balance.pin_IN4 = pyb.Pin(pyb.Pin.cpu.B1) |
The pin object used for the Motor 2's H-bridge input 2.
| balance.pin_nFAULT = pyb.Pin(pyb.Pin.board.PB2, pyb.Pin.IN) |
The pin object used for the motor driver fault pin.
Here the user-button is used to simulate a fault for testing behavior.
| balance.pin_nSLEEP = pyb.Pin(pyb.Pin.cpu.A15, pyb.Pin.OUT_PP) |
The pin object used for the H-bridge sleep pin.
| balance.PIN_xm = Pin(Pin.cpu.A0) |
The Nucleo pin connected to RTP xm.
| balance.PIN_xp = Pin(Pin.cpu.A1) |
The Nucleo pin connected to RTP xp.
| balance.PIN_ym = Pin(Pin.cpu.A6) |
The Nucleo pin connected to RTP ym.
| balance.PIN_yp = Pin(Pin.cpu.A7) |
The Nucleo pin connected to RTP yp.
FSFB controller for the x-axis of the platform only system.
FSFB controller for the y-axis of the platform only system.
| balance.pos = (0,0,0) |
Ball Position from the touch pannel (x,y,z) in [m].
| tuple balance.prev_pos = (0,0,0) |
Previous ball Position from the touch pannel (x,y,z) in [m].
| float balance.R = 2.21 |
Motor terminal resistance [Ohms].
The RTP objct.
| int balance.runs = 1 |
Number of runs.
| balance.start_time = utime.ticks_us() |
Start time of the data collection.
| int balance.steady_count = 0 |
A counter that increments when the platform is stable.
FSFB controller for the x-axis of the full system.
FSFB controller for the y-axis of the full system.
| tuple balance.thta = (0,0,0) |
Platform angle [rad].
| balance.tim = pyb.Timer(3,freq=20000); |
The timer object used for PWM generation.
| balance.uart = UART(2) |
UART communication line for debugging.
| int balance.Vdc = 18 |
Motor nominal voltage [V].
| tuple balance.vel = (0,0,0) |
Ball Velocity from the touch pannel in [m/s].
| balance.x_duty = 0 |
PWM duty sent to motor A controlling platform x-axis.
| balance.y_duty = 0 |
PWM duty sent to motor B controlling platform y-axis.