|
ME 405 TERM PROJECT
|
Main file for polar plotter project. More...
Functions | |
| def | main.onButtonpress (IRQ_src) |
| def | main.g (x, theta, r) |
| def | main.dg_dtheta (theta, r) |
| def | main.NewtonRaphson (fcn, jacobian, guess, thresh) |
| def | main.iterate (fcn, x, theta, r, thresh) |
| def | main.parse (file) |
| def | main.extract (insts) |
| def | main.draw (instVal) |
Variables | |
| int | main.state = 0 |
| main.PC4 = Pin(Pin.cpu.C4, mode=Pin.OUT_PP, value=0) | |
| main.PB4 = Pin(Pin.cpu.B4, mode=Pin.OUT_PP, value=0) | |
| main.PB5 = Pin(Pin.cpu.B5, mode=Pin.OUT_PP, value=0) | |
| main.drv1 = TMC4210drv(2, SPI.SLAVE, 1_000_000, 1, 1, None, Pin(Pin.cpu.C3, mode=Pin.OUT_PP, value =1), 4, 1, Pin(Pin.cpu.B6, mode = Pin.OUT_PP), Pin(Pin.cpu.C2, mode=Pin.OUT_PP, value =1)) | |
| main.drv2 = TMC4210drv(2, SPI.SLAVE, 1_000_000, 1, 1, None, Pin(Pin.cpu.B0, mode=Pin.OUT_PP, value =1), 4, 1, Pin(Pin.cpu.B7, mode = Pin.OUT_PP), Pin(Pin.cpu.C0, mode=Pin.OUT_PP, value =1)) | |
| main.uC = SPI(2) | |
| main.MASTER | |
| main.baudrate | |
| main.phase | |
| main.polarity | |
| main.crc | |
| main.uart2 = UART(2) | |
| main.bits | |
| main.parity | |
| main.None | |
| main.stop | |
| main.theta_guess = np.array([5,6]) | |
| int | main.thresh = 1e-6 |
| float | main.r = 0.24 |
| float | main.inrad = r/(pi*2) |
| list | main.shapes = [] |
| string | main.file = "susamongus.hpgl" |
| int | main.dpi = 240 |
| main.drawingDone = task_share.Share ('i', thread_protect = False, name = "drawingDone") | |
| main.button_int = ExtInt(Pin.cpu.C13, ExtInt.IRQ_FALLING, Pin.PULL_NONE, None) | |
| main.buttonFlag = task_share.Share ('i', thread_protect = False, name = "buttonFlag") | |
| main.drawTask | |
| main.xcoordData | |
| main.ycoordData | |
Main file for polar plotter project.
| def main.dg_dtheta | ( | theta, | |
| r | |||
| ) |
@breif Calculates the jacobian
| def main.draw | ( | instVal | ) |
@breif Uses the extracted xy coordinates to calculate motor thetas. Then sends
motor thetas to respective stepper. Also interprets pen instructions to
actuate DC motor.
| def main.extract | ( | insts | ) |
@breif Splits extracted instructions by commas to generate xy coordinates @param insts Instructions extracted from parsed file
| def main.g | ( | x, | |
| theta, | |||
| r | |||
| ) |
@breif Calculates motor thetas from xy coordinate inputs
| def main.iterate | ( | fcn, | |
| x, | |||
| theta, | |||
| r, | |||
| thresh | |||
| ) |
@breif Used to iteratively call NewtoRaphson method to find motor thetas
| def main.NewtonRaphson | ( | fcn, | |
| jacobian, | |||
| guess, | |||
| thresh | |||
| ) |
@breif Calculates the new thetas approximated by NewtonRaphson method
| def main.onButtonpress | ( | IRQ_src | ) |
@breif Button flag used to start the drawing task
| def main.parse | ( | file | ) |
@breif Opens the hpgl file defined and extracts pen up/down instructions
and xy coordinates of each point
@param file The hpgl file to be prsed
| def main.drawTask | ( | ) |
@breif Calls the draw function and sets flag to represent when drawing is finished
| main.xcoordData |
| main.ycoordData |