405 Documentation  9.0
mainThatBalancedtheTable.py File Reference

Another attempt to balance the table. More...

Functions

def mainThatBalancedtheTable.fault_isr (fault)
 Fault ISR. More...
 

Variables

 mainThatBalancedtheTable.var = MotorDriver(pyb.Pin.board.PA15, pyb.Pin.board.PB4, pyb.Pin.board.PB5, 3, 1, 2)
 X axis motor. More...
 
 mainThatBalancedtheTable.var2 = MotorDriver(pyb.Pin.board.PA15, pyb.Pin.board.PB0, pyb.Pin.board.PB1, 3, 3, 4)
 Y axis motor. More...
 
 mainThatBalancedtheTable.balancer = EncoderDriver(pyb.Pin.board.PB6, pyb.Pin.board.PB7, 1, 2, pyb.Timer(4, prescaler = 7, period = 0xff))
 X axis Motor encoder. More...
 
int mainThatBalancedtheTable.beginner = 0
 Where to begin. More...
 
 mainThatBalancedtheTable.balancer2 = EncoderDriver(pyb.Pin.board.PC6, pyb.Pin.board.PC7, 1, 2, pyb.Timer(8, prescaler = 7, period = 0xff))
 Y axis Motor encoder. More...
 
 mainThatBalancedtheTable.fault = pyb.Pin.board.PB2
 Fault pin. More...
 
 mainThatBalancedtheTable.extint = pyb.ExtInt(pyb.Pin.board.PB2, pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_UP, fault_isr)
 External Interrupt Object. More...
 

Detailed Description

Another attempt to balance the table.

As with mainWithnFault.py, this program tried to balance the table, except this one actually worked (for small displacements)! This ran off a combination of the two concepts from mainWithnFault.py. It had a range of values for duty cycle based on how far the encoder was from where we wanted it to be. However, it was not a "continuous" spectrum. Instead, there would be a range of distances that would share the same duty cycle. As the encoder got closer to where we wanted it to be, the duty cycle would gradually step down at set distances. This allowed us to more directly control the duty cycles and tune the system until it worked, which it did! Also here we changed the range of values from 0-65535 to 0-255, as that is a bit easier to work with.

Author
Jacob Everest
Hunter Morse
Date
Mar. 15, 2021

Function Documentation

◆ fault_isr()

def mainThatBalancedtheTable.fault_isr (   fault)

Fault ISR.

Sets the faultflag to one if a fault isr has been triggered. Stops all functionality until resolved.

Author
Jacob Everest
Hunter Morse
Date
Mar. 15, 2021

Variable Documentation

◆ balancer

mainThatBalancedtheTable.balancer = EncoderDriver(pyb.Pin.board.PB6, pyb.Pin.board.PB7, 1, 2, pyb.Timer(4, prescaler = 7, period = 0xff))

X axis Motor encoder.

Encoder object that outputs position of the X axis motor

◆ balancer2

mainThatBalancedtheTable.balancer2 = EncoderDriver(pyb.Pin.board.PC6, pyb.Pin.board.PC7, 1, 2, pyb.Timer(8, prescaler = 7, period = 0xff))

Y axis Motor encoder.

Encoder object that outputs position of the Y axis motor

◆ beginner

int mainThatBalancedtheTable.beginner = 0

Where to begin.

Where we want the motors to shoot for

◆ extint

mainThatBalancedtheTable.extint = pyb.ExtInt(pyb.Pin.board.PB2, pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_UP, fault_isr)

External Interrupt Object.

Allows the Fault interrupt to be called

◆ fault

mainThatBalancedtheTable.fault = pyb.Pin.board.PB2

Fault pin.

Pin that the faults are dependent upon

◆ var

mainThatBalancedtheTable.var = MotorDriver(pyb.Pin.board.PA15, pyb.Pin.board.PB4, pyb.Pin.board.PB5, 3, 1, 2)

X axis motor.

Creates an object that controls the motor that pushes the table Around its widthwise axis

◆ var2

mainThatBalancedtheTable.var2 = MotorDriver(pyb.Pin.board.PA15, pyb.Pin.board.PB0, pyb.Pin.board.PB1, 3, 3, 4)

Y axis motor.

Creates an object that controls the motor that pushes the table Around its lengthwise axis