http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/ - Awesome blog on how to write a PID algorithm
MCU crashing was a major issue. Sorted that out by putting a bunch of capacitors across the motor. This was used as a reference - http://www.beam-wiki.org/wiki/Reducing_Motor_Noise
The MPU6050 crashes or gives erratic readings when the motor is powered on. The motor might be interfering with the i2c signal.
Dont think it is because battery is dropping ...
read moreThe program is crashing because of the MPU screwing up with the whole system. Partly because of the DMU, partly because of i2c. anyway the issue is on the MPU6050.
If d0 pin is connected to anything else, arduino cannot be programmed. The bluetooth module will have to be disconnected when programming the IC
Reason unknown. It seems to be happening on every code that is accessing the MPU. Again could be loose connections.
Sometimes MPU6050 starts giving really sporadic readings. Cause unknown. Typically it happens when there is a sudden jerk. Loose connects screwing up with logic?
accelgyro.setXGyroOffset(82);
accelgyro.setYGyroOffset(-59);
accelgyro.setZGyroOffset(30);
int val=255;
void setup() {
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
Serial.begin(9600);
// pinMode(11, OUTPUT);
}
void loop() {
analogWrite(11,val);
// digitalWrite(11, HIGH);
digitalWrite(12, LOW);
digitalWrite(13 ...
PWM works between 0 to 255. This motors stops moving at values below PWM value of 95.
#include <elapsedMillis.h>
elapsedMillis timeElapsed;
int val=0;
int sensorPin = A0;
int interval = 1000;
int count=0;
int ledState=0;
int dVal=0;
int pdVal=0;
void setup() {
pinMode(13 ...
Since time is our biggest constraint, to see how much can we work with backlash, we buy 3 different quality of motors and see how much backlash we can tolerate.
1) Backlash from motors
2) Lack of sensitivity of rotary encoders