Mechatronic Zen Garden  0.1
This webpage contains documentation for the ME 507 term project: Mechatronic Zen Garden.
ControlTask.cpp File Reference
#include <Arduino.h>
#include <PrintStream.h>
#include "shares.h"
#include "ControlTask.h"
#include "Control.h"
#include "EncoderDriver.h"
#include "MotorDriver.h"
#include "EMDriver.h"
#include "math.h"

Macros

#define inputA1   PB8
 
#define inputA2   PB9
 
#define enableA   PB6
 
#define inputB1   PA8
 
#define inputB2   PA9
 
#define enableB   PB7
 
#define E1CHA   PA0
 
#define E1CHB   PA1
 
#define E2CHA   PB4
 
#define E2CHB   PB5
 
#define MagPin   PA10
 
#define limx   PB0
 
#define limy   PA4
 

Functions

void task_control (void *p_params)
 Task which sends data to ControlTask.h. More...
 

Detailed Description

This file contains a task for controlling the Zen Gardener's magnet position

Source code available here: https://github.com/chstanto/Zen_Garden/blob/main/src/ControlTask.cpp

Author
Aaron Tran
Cole Stanton
Date
2021-Nov-29 Original file

This file contains a task for controlling the Zen Gardener's magnet position

Source code available here: https://github.com/chstanto/Zen_Garden/blob/main/src/ControlTask.h

Author
Aaron Tran
Cole Stanton
Date
2021-Nov-29 Original file

Function Documentation

◆ task_control()

void task_control ( void *  p_params)

Task which sends data to ControlTask.h.

This task sends designs Zen Garden designs to the Control Task. Upon further development, this task would also read from a CSV to obtain that data, retrieve performance data, and print desired data to a CSV.

Parameters
p_paramsA pointer to function parameters which we don't use.

Current x position, [in]

Current y position, [in]

Current x velocity, [in/s]

Current y velocity, [in/s]

Previous x position reading, [in]

Previous y position reading, [in]

Reference x position, [in]

Reference y position, [in]

Reference x velocity, [in/s]

Reference y velocity, [in/s]

Desired operating speed, [in/s]

x error, [in]

y error, [in]

Angle of reference velocity vector [rad]

Control system's acceptable error [in]

Clock value [ms]

vTaskDelay value [ms]

triggers flag if x limit switch has been clicked

triggers flag if y limit switch has been clicked

triggers flag if first x position has been reached

triggers flag if first y position has been reached

triggers flag if x position error is sufficiently low

triggers flag if y position error is sufficiently low

triggers flag if last reference value has been received