okey i have a question
i have a hopper with a broken pcb
so i made my own board with a ir beam sensor
made a small script that stops the hopper once the beam is broken
but now here comes the problem
the drive motor starts pulsing as soon as the paint rolls by
how can i stop this from happening
how can i ignore the sensor as long as the paint flows so that the drive motor keeps running
but as soon as that the paint stops the drive motor has to stop
if the paint is roling
it goes with 15-20bps trough the sensor (disabled)
You might have a clue what this means. I do not.
What, exactly, is the relationship between "paint rolling" and the IR sensor?
The IR sensor is a digital device. There is something blocking the beam or there isn't. There is no pulsing, unless whatever is blocking the beam is not opaque enough to fully block the beam or transparent enough to fully allow the IR light through.
but becaus it stops with every ball
What stops? What do balls have to do with the flow of paint past a sensor?
Pretend that we can NOT see your project. Because we can't. You must fully describe what is being measured, with what sensors, and how.
i will try to make it even simpler
a hopper is a device that feeds paint into a marker the thing that shoots the paint
inside the paint path is a ir beam and every ball that rolls trough gives a puls
(becaus it break the beam)
not it the beam get broken the feed motor stops
and this slows the hopper down
(not wanted)
when you shoot you want the hopper on maximum speed
but when you stop shooting and the paint piles up the motor needs to stop
so one sensor that looks if the balls are moving or stationairy
and one motor that pushes them trough the sensor
i need a way that the motor stops when the paint stops
but the motor may not stop when the paint is rolling
a counter that counts down when the sensor is blocked and after a few mili seconds it stops the motor
and that same counter gets reset when the sensor is pulsing
you have basic gravity hoppers, and electric hoppers
gravity feeds by shaking (slow 5 -9 bps max)
the electrics are devided in 2 groups
passive and active
the passive are gravity hoppers with stir paddles (this isnt realy usefull still slow but no more shacking)
they active forces the paint into the marker
Hoppers, with shakers or stirrers, are for making solids behave like liquids. Sand, cement, flour, sugar, etc. are solids that one, sometimes, would like to behave like liquids.
Paint, unless it is dried up, is already a liquid. A very viscous liquid, but a liquid nonetheless.
Anyway, what does the use of a hopper, a shaker, a stirrer, etc. have to do with the problem?
Something is moving past an IR beam. You still have NOT said what that is. Is it the paint?
Why does whatever is moving past the IR beam cause pulsing?
Simple answers to the last two questions are needed before we even look at your code.
the paintballs are moving trough the beam
the paint in paintball
are .68 caliber gelatin balls with foodpaint villing
you guy are behaving as if you never heard or seen a paintball marker bevore
this is a animation of a paintball marker
the blue red balls are the paint
as you can see you need a constant feed
/*---------------------------
paintball hopper v3
----------------------------*/
#define motor 0 //this pushes the paint
#define BEAM 3 //the phototransistor for the ball detection
int signal_inverter=0; //this is for storage and for inverting
int counter=0; //this counts the time that the balls have not moved
void setup()
{
pinMode(motor,OUTPUT);
pinMode(BEAM,INPUT);
digitalWrite(motor,LOW);
}
void loop()
{
signal_inverter = !digitalRead(BEAM);
if (signal_inverter == 0){
if (counter >= 10){
digitalWrite (motor, LOW);
}else{
counter++;
}
}
else {
digitalWrite (motor, HIGH);
counter=0;
}
delay(1);
}
[code/]
my grammar in dutch is as bad as in english
so english is fine
in the 30 years a lot has changed
thermal lenses in the masks
co2 is no longer the standart
hpa is the new standart
most markers are electromechanical
and have shooting speeds up to 30bps (or even higher)
i cant write correctly
i never could i never shall
i am so sorry but writing code is a lot easyer then writing a peace of text
i am not half assing my writing i just cant do any better even in dutch i cant do any better
for the books i have writen i had to hire sombody to correct al the gramatical errors