It should work with any of them provide the i2c bus stuff is set up right.
The banana pi will probably work with a dongle. To get the on board working, the easiest thing to do is use the banana pi kernel (and modules) Or you could just recompile your own kernel with the right drivers and such. I donāt know how long that will takeā¦it takes forever on the B.Iām using straight raspbian, and I am not used to packages being so far out of date.
I usually use Fedora, but armv6 isnāt supported anymore. The pi2, and the bananapiās should be supported.
kernel is the thing that controls the whole system. It is the scheduler, has the device drivers, filesystem drivers, network drivers, etc.
Try all the usb ports. I am guessing there are 2 different buses being used and only one of them is recognized, and it might actually be an issue with the bootloader software.
Oh! you can use the android kernel and bootloader. You just have to switch out the root filesystem. That is probably over your head. But that is how things like CyanogenMod, and getting linux to run on the nook, chromebook, etc all work.
That last code is working!!! This is exactly what Ive been wanting. All we had to do was map the delay to the input of the 02 sensor. So I have it mapped from center of the two thresholds going one way and inverted it going in the other direction.
So what it is doing is when things are close it will move nice and slow but if things go way out of wack it will respond very fast and then taper down as it gets close to the parameters we are trying to meet.
I also installed the 4.9 sensor for the most part all the lag is gone and Im happy with it.
I will start work on a tutorial with this code. You will need to use the wideband AEM kit however. The nice thing about the kit is you will have the readout. This will make things easier for starting and creating a set point.
Haha yeah was I thinking Chris might add a section in the library for Arduino code once the creator is ready to endorse it.
I am planning more to add. Potentiometer timers for grate and hopper agitators, thermocouple readouts, flare ignitors etc.
Ill post the latest code here. It is very simple just a single āIf Elseā statement that is it besides the manual mode.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
//VG 02 Wide Band Mixture Controller V1.3
//Craeted by Matt Ryder, Vulcan Gasifier LLC May 5, 2015
//Last edit; June 22, 2015
// This code requires an AEM O2 sensor kit with LSU 4.9 sensor Part # 30-4110
// These constants won't change:
const int O2SensePin = A1; // pin that the O2 sensor is attached to
const int O2SwtPin = A2; //Pin Auto Mode Switch is attached to
const int O2ManPin = A0; // Reads the O2 Manual Adjust Potentiometer on pin A1
const int RichCon1 = 490; // Threshold limit for Rich gas condition
const int LeanCon1 = 530; //Threshold limit for lean gas condition
int pos = 0; // variable to store the servo position
int val; // variable to read the value from the analog pin
int lastpos = val; // variable to store the servo last position
int O2SwticthState = 0; // variable for reading the Fuel Mixer Mode status
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
// Need to create a set point for servo start position after manual tuning
{
val = analogRead(O2ManPin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
lastpos = val; // sets lastpos to equal the position of the manually set position
delay(10); // waits for the servo to get there
}
}
void loop()
{
// read the state of the pushbutton value:
O2SwticthState = digitalRead(O2SwtPin);
// read the value of the O2 sensor:
int sensorReading = analogRead(A1);
if (O2SwticthState == LOW)
{
val = analogRead(O2ManPin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
lastpos = val; // sets lastpos to equal the position of the manually set position
delay(10); // waits for the servo to get there
}
else
{
delay (10);
}
if (sensorReading <= RichCon1)
{
lastpos = lastpos +1;
myservo.write (lastpos);
val = map(analogRead(O2SensePin), 0, 510, 0, 150);
Serial.println(val);
delay(val);
}
else if (sensorReading >= LeanCon1)
{
lastpos = lastpos -1;
myservo.write (lastpos);
val = map(analogRead(O2SensePin), 1023, 510, 0, 100);
Serial.println(val);
delay(val);
}
else {
delay (10);
}
}
Here is a video I did today on our test unit with this code running. I love this little DC unit, the foreman grill is a good test it is 1500 watts with both burners on. However they turn on and off and ever changing the load. The machine will run all day just like in the video. I also created some rich and lean events cutting of the gasifiers intake with the ball valve. This also has the simple fire add on running. There is much more to learn there, I will be building a charcoal reactor for this unit to add a second stage reduction system.
I am running your code on the bench. One issue is it is only working in one direction.
But from what I am seeing now it is very smooth in its operation. But anyways I need to know what parameters need to be tweaked. This code is a bit over me head
I sent you updated code. I think it was not working when it was way off the low value.
I found another bug with the moving avg part of the code, and added comments. At the very least it will act differentā¦
These can all be tweaked safely:
//O2GAP is the space both Ā± around the calculated āidealā #define O2GAPHIGH 30 #define O2GAPLOW 30
//O2INTERVAL is the delay time between iterations of the loop. #define O2INTERVAL 30
//O2MACOUNT is the number of values used for the moving avg calculationā¦should be a power of 2. #define O2MACOUNT 8
//O2WAYOFF do a much faster correction if the sensor reading and the pot setting differ by more then these value #define O2WAYOFFHIGH 75 #define O2WAYOFFLOW 75
//O2WAYOFFMISSES is how many times in a row the value can be in the āway offā range before a huge correction #define O2WAYOFFMISSES 1
//O2WAYOFFCORRECTION the number of steps of the correction if we are way off. #define O2WAYOFFCORRECTION 5
I did start playing with gap highs and lows. I set them closer to the middle in the 500 to 650 range and for the more extreme they are set around 450 and 750.
It doesnāt use a fixed value for the ideal like yours does. The ideal is calculated on the fly by whatever the avg is when you quit pressing the button. with these numbers it is #define O2GAPHIGH 30 #define O2GAPLOW 30 #define O2WAYOFFHIGH 75 #define O2WAYOFFLOW 75
for a 1 step correction it is:
greater then ideal + 30 or less then ideal -30
for the bigger 5 step correction it is:
greater then ideal + 75 or less then ideal -75
It roughly corresponds to what you had for values when I looked at your code.
You need the manual pot to start the engine. Its easier to manually adjust at start up. The raw gas gives false readings and takes longer to get started = burned up starter
Its also a nice thing to have for trouble shooting.
But your code might work better than mine. But Id still put it in for troubleshooting, you can always start in auto mode.
Yeah, I am aware of that issue. I was going to put in like a 30 second time delay from the last pot adjustment before it goes into autorun mode. It uses the pot to determine the āidealā anyway if you need to adjust during the run, you donāt have to hit the button, you can just move the pot and it will react and work like it is designed to do.