Commit 75d4c626 authored by thcl's avatar thcl
Browse files

3-12-19 Got the motor spinning again. Changed Debug Low States one by one to include a while loop.

parent 87d93209
......@@ -20,7 +20,7 @@ int Zoffset = 0;
// This is the difference in encoder tics from the Z index to
// the electrical encoder zero (which is found by powering the
// AB block and waiting for the motor to settle)
int hard_coded_offset = -220;
int hard_coded_offset = -1042;
// how long in microsec (us) to delay between phases while calibrating
// the wheel
......
......@@ -69,6 +69,9 @@ H TO TO SEND SPECIFIC PHASES DEBUG MOTOR\n");
{
charge_bootstrap_capacitors();
motor_butt_control_precalculated();
// after coasting, when we reengage the motor, we want
// to limit our upwards rate of change
}
else if (incomingByte == 'y') // 'y'
{
......
......@@ -10,7 +10,7 @@
#define H1 6 //greenH
#define H2 21 //yellowH
#define H3 23 //blueH
#define L1 5 //GreenL
#define L1 5 //GreenL
#define L2 20 //YellowL
#define L3 22 //BlueL
......@@ -21,10 +21,10 @@
const int led = 13;
// This scale factor scales the potentiometer
int const SCALE_FACTOR = 50;
int const SCALE_FACTOR = 240;
// This is the PWM frequency and it is very important
int FREQ = 48000; //8000;
int FREQ = 8000; //8000;
// This is the lower limit of PWM frequency
// its important for not breaking gate drivers
......@@ -155,7 +155,7 @@ void set_phase(int high1, int high2, int high3, int low1, int low2, int low3)
//turn the stuff that should be off, off first
if (! low1) digitalWrite(L1, low1);
if (! low2) digitalWrite(L2, low2);
if (! low2) digitalWrite(L2, low2);
if (! low3) digitalWrite(L3, low3);
if (! high1) analogWrite(H1, high1);
if (! high2) analogWrite(H2, high2);
......
......@@ -120,6 +120,8 @@ void locate_state_positions(void)
void debug_low_state_by_state(void)
{
while(1){
Serial.println("lets run some debug tests");
Serial.println("Hit space to call turn_all_off()");
block_until_spacebar();
......@@ -139,6 +141,9 @@ void debug_low_state_by_state(void)
Serial.println("Hit space to call setphase(0,0,0,1,1,1)");
block_until_spacebar();
set_phase(0,0,0,1,1,1);
Serial.println("Thats all i got restart board!!!");
while(1){}
// Serial.println("Thats all i got restart board!!!")
Serial.println("Digital Write");
digitalWrite(5, HIGH);
block_until_spacebar();
}
}
\ No newline at end of file
Markdown is supported
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