Commit 21cf5d8b authored by thcl's avatar thcl
Browse files

Added a few comments

parent 5d9674bc
......@@ -34,6 +34,7 @@ S TO START BUTT CONTROL (OPTIMIZED)\n");
}
if(incomingByte == ' ')//space bar
{
//skips to start calibration
break;
}
else if(incomingByte == 'z') //'z'
......
......@@ -65,6 +65,7 @@ void motor_setup(void) {
turn_all_off();
}
// Turns all the mosfets to LOW
void turn_all_off() {
digitalWrite(L1, LOW);
digitalWrite(L2, LOW);
......@@ -81,7 +82,7 @@ int one_to_scaleFactor(int x)
{
if (x == 1)
{
// NOTE: The scale factor of is the max value we want out of
// NOTE: The scale factor is the max value we want out of
// the potentiometer
return get_pot_0_scaled(SCALE_FACTOR, PERIOD_OVER_255);
}
......@@ -145,6 +146,8 @@ void set_phase(int high1, int high2, int high3, int low1, int low2, int low3)
if (! high3) analogWrite(H3, high3);
//turn the stuff that should be on, on
/*this is so multiple mosfets don't go high at the
same time when they shouldn't*/
if (low1) digitalWrite(L1, low1);
if (low2) digitalWrite(L2, low2);
......@@ -242,7 +245,7 @@ void open_loop_control(void)
for(int p = 1; p <= 6; p++)
{
set_block_phase(p);
//What's going on with this math, explination:
//What's going on with this math, explanation:
// The get_pot_1_inv will return an int 0-100
// We want the minimum speed to be 1 sec per phase
// we want the maximum speed to be 2800 us per phase
......@@ -258,7 +261,7 @@ void open_loop_control(void)
}
}
// This just charges up the small boostrap capacitors
// This just charges up the small bootstrap capacitors
// this should allways be called right before powering the motor
void charge_bootstrap_capacitors(void)
{
......@@ -270,6 +273,8 @@ void charge_bootstrap_capacitors(void)
}
//using hardcoded located state positions
/* If we're in a position, start powering the voltage
to get us to the next position */
void direct_position_control(void)
{
calibrate_encoder();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment