[QUOTE=pentium;48805968][IMG]http://i11.photobucket.com/albums/a166/ballsandy/IMG_1168.jpg[/IMG]
I almost don't want to know what the wattage of this load is.[/QUOTE]
Submerge it in oil and it's really only limited by your mains power capacity.
[editline]1st October 2015[/editline]
and wire gauge I suppose
Okay, I need to re-learn math, I guess.
What I need to do is convert the difference between the joystick reading and the dead-zone (absolute difference) and then convert that to a ceiling'd percentage of 255, but my stupid old brain can't translate that into machine code. :unimpressed:
[QUOTE=Zero-Point;48807502]Okay, I need to re-learn math, I guess.
What I need to do is convert the difference between the joystick reading and the dead-zone (absolute difference) and then convert that to a ceiling'd percentage of 255, but my stupid old brain can't translate that into machine code. :unimpressed:[/QUOTE]
Assuming the following:
Joystick axis:
Y = -2047 <----- 0 -----> 2047
Deadzone = -20 thru 20
This seems to work in C#
int OUT = 0;
int Y = trackBar1.Value;
if (Y < -20 || Y > 20)
{
OUT = Y+2047;
}
else
{
OUT = 2047;
}
double DOUT = Math.Ceiling( (((OUT-40)/4096.0)*255.0) + 2 );
label1.Text = DOUT.ToString();
label2.Text = Y.ToString();
[QUOTE=Dolton;48799553]uint_8 is just a typdef of unsigned char
It is nice when using embedded systems to not have to include lots of files especially when you can get the same results.[/QUOTE]
uint8 will always be an unsigned 8-bit value, everywhere. It doesn't matter if you have to include a lot, the preprocessor just uses definitions to literally replace words with other words, and the rest is optimized away by the compiler.
[QUOTE=Dorkslayz;48746138]Sure.
I'm building a Quadcopter but i'm having a few issues with communicating with my [URL="http://www.hobbyking.com/hobbyking/store/__39708__Afro_ESC_30Amp_Multi_rotor_Motor_Speed_Controller_SimonK_Firmware_.html"]ESCs[/URL] via I2C. My Raspberry Pi is recognising my MPU6050 sensor just fine, but it's not recognising one of the ESCs and the other is showing up at a completely random address (0x29). I edited and flashed the firmware for both of the motors so they should be at 0x50 and 0x51.
I'm using two different power supplies for the sensor and ESCs (ESCs are connected to 0v on one battery, and the GND on the ESCs is connected to 0v on the other battery), not sure if this is the issue though.[/QUOTE]
Managed to fix my issue, there was a firmware issue which caused addressing issues.
Coming across another issue now though, with my MPU6050 (Accelerometer/Gyroscope) this time. I seem to be getting constant values from it for some reason. (Issue created @ [url]https://github.com/hybridgroup/gobot/issues/236[/url] if anybody cares to look)
Anyone have ideas for producing a 2MHz square wave with a 95% duty cycle?
I'm trying to design a boost converter that runs down to 0.8V input with 15V out at very low power.
This is not easy :freakout:
[QUOTE=Chryseus;48809545]Anyone have ideas for producing a 2MHz square wave with a 95% duty cycle?
I'm trying to design a boost converter that runs down to 0.8V input with 15V out at very low power.
This is not easy :freakout:[/QUOTE]
[code]
PORTB = 0xFF;
PORTB = 0x00;
[/code]
Anyone know an shop in UK, Czech, Poland, France or any other EU country thats not germany that sells:
-refurbished electronic parts
-new electronic parts for cheap
-electronic assortments like 0.5kg resistors etc.
-industrial modules like pumps, displays etc.
in germany, we got a shop called pollin.de. really cheap prices compared to the others, and huge variety of electronic stuff. including things like removed parts from industrial equipment.
example a photomultipier
[IMG]https://i.gyazo.com/ef8121d31e94ea6fe2013e107dc3b739.png[/IMG]
or strong dc motors like this for almost nothing:
[IMG]https://i.gyazo.com/c007fea1eafe7e3329c03d8bab3511cc.png[/IMG]
im looking for a shop exactly like this one, but in a other country. just to see what they got and what i want next.
In USA theres electronic goldmine [url]http://www.goldmine-elec-products.com/[/url] but they dont ship to germany.. which actually would cost tooo much.
[QUOTE=DrDevil;48809737][code]
PORTB = 0xFF;
PORTB = 0x00;
[/code][/QUOTE]
Even if that was 2MHz, that would give you a 50% duty cycle.
[QUOTE=nuttyboffin;48808443]Assuming the following:
Joystick axis:
Y = -2047 <----- 0 -----> 2047
Deadzone = -20 thru 20
This seems to work in C#
int OUT = 0;
int Y = trackBar1.Value;
if (Y < -20 || Y > 20)
{
OUT = Y+2047;
}
else
{
OUT = 2047;
}
double DOUT = Math.Ceiling( (((OUT-40)/4096.0)*255.0) + 2 );
label1.Text = DOUT.ToString();
label2.Text = Y.ToString();[/QUOTE]
I have a feeling this wouldn't cut the mustard, either. The range on the joystick is 0-1023, with the "dead zone" being roughly 519 for the up/down axis. (I have it set up to take a reading of where the dead zone is upon start-up so it self-centers in the event that this would change for whatever reason)
After tinkering with it, I've gotten closer. Now neither LED sticks, and the bottom LED works flawlessly (outputting a perfect 0-255 range on the serial monitor), but the top LED will only be either completely off (0) or completely on (255, and only when you've maxed out the stick).
The shitty code in question:
[code]
int UD_DZone;
int RL_DZone;
//int LED_Up;
//int LED_Dn;
const int UpLED = 3;
const int DnLED = 5;
const int RLED = 6;
const int LLED = 9;
void setup()
{
// put your setup code here, to run once:
pinMode(UpLED, OUTPUT);
pinMode(DnLED, OUTPUT);
pinMode(RLED, OUTPUT);
pinMode(LLED, OUTPUT);
UD_DZone = analogRead(A0);
RL_DZone = analogRead(A1);
Serial.begin(9600);
}
void loop()
{
int reading_UD = analogRead(A0);
if (reading_UD < UD_DZone)
{
uint8_t LED_Up = ((UD_DZone - reading_UD) / UD_DZone) * 255.0;
analogWrite(UpLED, LED_Up);
Serial.println(LED_Up);
}
else if(reading_UD > UD_DZone)
{
uint8_t LED_Dn = ((reading_UD - UD_DZone) / (1023.0 - UD_DZone)) * 255.0;
analogWrite(DnLED, LED_Dn);
Serial.println(LED_Dn);
}
else
{
analogWrite(UpLED, 0);
analogWrite(DnLED, 0);
}
}
[/code]
Funnily enough, I'm friends with a guy who knows a shit-ton about programming and he has yet to come up with a better loop than what I made, his examples have been doing some incredibly funky shit. :v:
[QUOTE=Chryseus;48809545]Anyone have ideas for producing a 2MHz square wave with a 95% duty cycle?
I'm trying to design a boost converter that runs down to 0.8V input with 15V out at very low power.
This is not easy :freakout:[/QUOTE]
Have you tried hardware interrupt timers? If all you need is the square wave an AVR chip could do it but you'll only get a couple software instructions per timer interrupt so don't expect to be able to run much code between cycles.
Or you could just use an astable 555 chip. There are a handful of them that are rated up to 2MHz. I'm not to sure about their accuracy of a 95% duty cycle at that frequency though. Depending on the parasitic they might not be able to slew all the way down to off at that kind of duty cycle though. [URL="http://www.mouser.com/ds/2/405/tlc555-202215.pdf"]This might work but it would be pushing its limits. [/URL] Its typical (but not max so it would be sketchy) fall and rise time are 20ns each so if all you need from the logic signal is a quick off pulse @ around 90% duty cycle it could work. I wouldn't guarantee it though you'd need to test it in the conditions you'd use.
One last option is just buy a [URL="http://www.digikey.com/product-search/en?pv139=562&pv69=80&FV=fff4000d%2Cfff8016e&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25"]pre-built oscillator on Digikey[/URL]. They would work if all you need is a 5v logic signal. (Same applies to both above, make sure the MOSFET you use has adequate driving capabilities at 5v g-s)
It is going to be difficult to get 95% duty cycle at 2MHz without considerations to parasitic and specific chip performances. For a good square wave at that duty cycle and frequency the rise and fall time will need to be ~5ns. This will be very difficult to breadbaord as the parasitic capacitance and inductances will eat the high frequency components of a square wave and leave you with an attenuated squareish wave.
[url]http://www.damninteresting.com/on-the-origin-of-circuits[/url]
:science101:
Also, figured it out. Now I just need to get the left and right LEDs to work. :v:
[code]
int UD_DZone;
int RL_DZone;
//int LED_Up;
//int LED_Dn;
const int UpLED = 3;
const int DnLED = 5;
const int RLED = 6;
const int LLED = 9;
void setup()
{
// put your setup code here, to run once:
pinMode(UpLED, OUTPUT);
pinMode(DnLED, OUTPUT);
pinMode(RLED, OUTPUT);
pinMode(LLED, OUTPUT);
UD_DZone = analogRead(A0);
RL_DZone = analogRead(A1);
Serial.begin(9600);
}
void loop()
{
float reading_UD = (analogRead(A0) - UD_DZone);
if (reading_UD < 0)
{
uint8_t LED_Up = ceil(((-reading_UD) / UD_DZone) * 255.0);
analogWrite(UpLED, LED_Up);
Serial.println((-reading_UD) / UD_DZone);
}
else if (reading_UD > 0)
{
uint8_t LED_Dn = ceil((reading_UD / (1023.0 - UD_DZone)) * 255.0);
analogWrite(DnLED, LED_Dn);
Serial.println(LED_Dn);
}
else
{
analogWrite(UpLED, 0);
analogWrite(DnLED, 0);
}
}
[/code]
Telephone systems are fucking weird.
So from my frustrating problem above, the adapter works fine. It's the phone line that is the issue.
North American telephone systems operate at 48V DC when not ringing, when a device goes off hook it should drop down to between 7 and 4.9v. When my adapter goes off hook the voltage drops down to 2.1-1.6v which is far too low for anything to work. However the moment you start to dial the line pulls back up to 5v and it magically works. Why does it do this? I don't know but it means that standalone the device works.....but only if it's the only device off hook.
Now lets add in a second telephone device. The moment it goes off hook the voltage drops to about 3.6v. That device will continue to operate fine even if it is line or externally powered but you never get the voltage pullup necessary to operate the adapter.
Only solution is to put the other device back on hook and start dialing to trigger the pullup.
The board is designed so that isolation of the phone line from an external power source is not easy. I'm at a loss to explain why even an isolated power supply will cause things to fuck things up badly.
I've been pulling my hair out over [url=http://www.classicrotaryphones.com/forum/index.php?topic=14992.new;topicseen#new]this forum and thread.[/url] If any of you want to chime in there's a full reverse engineered schematic of this adapter available there.
[QUOTE=pentium;48814712]Telephone systems are fucking weird.
So from my frustrating problem above, the adapter works fine. It's the phone line that is the issue.
North American telephone systems operate at 48V DC when not ringing, when a device goes off hook it should drop down to between 7 and 4.9v. When my adapter goes off hook the voltage drops down to 2.1-1.6v which is far too low for anything to work. However the moment you start to dial the line pulls back up to 5v and it magically works. Why does it do this? I don't know but it means that standalone the device works.....but only if it's the only device off hook.
Now lets add in a second telephone device. The moment it goes off hook the voltage drops to about 3.6v. That device will continue to operate fine even if it is line or externally powered but you never get the voltage pullup necessary to operate the adapter.
Only solution is to put the other device back on hook and start dialing to trigger the pullup.
The board is designed so that isolation of the phone line from an external power source is not easy. I'm at a loss to explain why even an isolated power supply will cause things to fuck things up badly.
I've been pulling my hair out over [url=http://www.classicrotaryphones.com/forum/index.php?topic=14992.new;topicseen#new]this forum and thread.[/url] If any of you want to chime in there's a full reverse engineered schematic of this adapter available there.[/QUOTE]
I know next to nothing about telephone systems but I'm interested in the problem.
When the phone comes off the hook, power is supplied to everything. C6 starts charging which turns on Q3 and Q2 after a delay. Those two would then pull the line as low as it can go, which would be around 1.7V from the diode drops plus the saturation voltage of Q2.
When the rotary dial is activated, V2 is dropped across R6 so Q3 and Q2 should turn back off allowing the line to recover. Or recover to some extent since V2 is now being dropped across R6 which is only 110 ohms which would still pull the line down to some level.
So what if you put a resistor between the collectors of Q2 and Q3 and the positive line? Like 200 ohms maybe.
Although those resistors are such low values maybe that's not what's happening here.
[QUOTE=Zero-Point;48812603]I have a feeling this wouldn't cut the mustard, either. The range on the joystick is 0-1023, with the "dead zone" being roughly 519 for the up/down axis. (I have it set up to take a reading of where the dead zone is upon start-up so it self-centers in the event that this would change for whatever reason)
After tinkering with it, I've gotten closer. Now neither LED sticks, and the bottom LED works flawlessly (outputting a perfect 0-255 range on the serial monitor), but the top LED will only be either completely off (0) or completely on (255, and only when you've maxed out the stick).
The shitty code in question:
code
Funnily enough, I'm friends with a guy who knows a shit-ton about programming and he has yet to come up with a better loop than what I made, his examples have been doing some incredibly funky shit. :v:[/QUOTE]
uint8_t LED_Up = ((UD_DZone - reading_UD) / UD_DZone) * 255.0;
This is pretty much your fault. When you divide integers, you will always get a floored result, as the remainder of the division gets thrown away. Use doubles. They're horribly inefficient on microcontrollers, but seeing how simple your code is you can get away with it.
[QUOTE=DrDevil;48816041]uint8_t LED_Up = ((UD_DZone - reading_UD) / UD_DZone) * 255.0;
This is pretty much your fault. When you divide integers, you will always get a floored result, as the remainder of the division gets thrown away. Use doubles. They're horribly inefficient on microcontrollers, but seeing how simple your code is you can get away with it.[/QUOTE]
Already found a working solution, pretty much the main difference is I made reading_UD a float instead. :v:
[QUOTE=Zero-Point;48813558]
Also, figured it out. Now I just need to get the left and right LEDs to work. :v:
[code]
int UD_DZone;
int RL_DZone;
//int LED_Up;
//int LED_Dn;
const int UpLED = 3;
const int DnLED = 5;
const int RLED = 6;
const int LLED = 9;
void setup()
{
// put your setup code here, to run once:
pinMode(UpLED, OUTPUT);
pinMode(DnLED, OUTPUT);
pinMode(RLED, OUTPUT);
pinMode(LLED, OUTPUT);
UD_DZone = analogRead(A0);
RL_DZone = analogRead(A1);
Serial.begin(9600);
}
void loop()
{
float reading_UD = (analogRead(A0) - UD_DZone);
if (reading_UD < 0)
{
uint8_t LED_Up = ceil(((-reading_UD) / UD_DZone) * 255.0);
analogWrite(UpLED, LED_Up);
Serial.println((-reading_UD) / UD_DZone);
}
else if (reading_UD > 0)
{
uint8_t LED_Dn = ceil((reading_UD / (1023.0 - UD_DZone)) * 255.0);
analogWrite(DnLED, LED_Dn);
Serial.println(LED_Dn);
}
else
{
analogWrite(UpLED, 0);
analogWrite(DnLED, 0);
}
}
[/code][/QUOTE]
[t]http://i.imgur.com/KeoEBDl.png[/t]
:suicide:
[QUOTE=Chryseus;48817397][t]http://i.imgur.com/KeoEBDl.png[/t]
:suicide:[/QUOTE]
Looks kinda fun but I have a weird thing for working in excel.
[t]https://dl.pushbulletusercontent.com/iOCiIlqaKXvRJkvX4NCI2tfNfvye5nXC/IMG_20151003_212838.jpg[/t]
God daaaamnnit China!
[QUOTE=Cakebatyr;48821494][t]https://dl.pushbulletusercontent.com/iOCiIlqaKXvRJkvX4NCI2tfNfvye5nXC/IMG_20151003_212838.jpg[/t]
God daaaamnnit China![/QUOTE]
Female 75 ohm N connector and male 50 ohm N connector? Or was the male pin bent from the factory?
[QUOTE=Cakebatyr;48821494][t]https://dl.pushbulletusercontent.com/iOCiIlqaKXvRJkvX4NCI2tfNfvye5nXC/IMG_20151003_212838.jpg[/t]
God daaaamnnit China![/QUOTE]
I once ordered a DB-25 cable on Amazon from a North American retailer. Even quadruple-checked that it was, in fact, advertised as a DB-25. Ordered it, got it, open package. ...DB-35.
[QUOTE=ddrl46;48824883]Female 75 ohm N connector and male 50 ohm N connector? Or was the male pin bent from the factory?[/QUOTE]
The male pin was bent.
Also I was at a hamfest today! Got some gear.
[T]http://i.imgur.com/jf4pFhL.jpg[/t]
Assorted RG8/U and Heliax Cables with N-male termination, $1 a piece.
SWR meter and 30MHz Low Pass Filter, $5 each.
MFJ manual antenna tuner $25.
Antennex 33cm NMO mount antenna $2.
Where and how
Finished winding my flyback for testing tomorrow.
9 primary turns, 56 secondary turns on a ETD34 N87 core with 0.2mm gap.
Going to try it with full wave rectified mains (from my variac + isolation transformer), aiming for 2kV out.
It's either going to work or release a lot of magic smoke.
The book was not specific on how many primary turns is needed for good operation so I have no idea.
[QUOTE=papkee;48828143]Where and how[/QUOTE]
Flea market/swap meet put on by the Delta Amateur Radio Society of BC.
[t]http://i.imgur.com/cmtyBhL.jpg[/t]
I'm getting some good corona discharge although I'm unsure if the transformer is breaking down, it's only insulated with standard electrical tape.
Also my switching transistor is running a bit hot, I calculated the dissipation to be around 60W but this seems higher, I might need a snubbing network to improve the transient response, this is what I'm getting at minimum duty:
[img]http://i.imgur.com/hkn40Jc.png[/img]
[b]Edit[/b]
I cocked up.
The minimum number of turns is 60, no wonder it's getting hot the core is saturating.
So I need to rewind it with 60 / 356 turns, oh well.
I bought 60 LEDs are various wavelengths. Hopefully by the time I get them I'll have enough money for a variabel power supply again.
Would you guys agree that I can just use a voltage regulator or should I use a so called LED driver? All but one type will run on the same voltage(3.5v and 3.2v, lower than there maximum voltage by 0.1v), if I use a voltage regulator, I could just them them all in parallel(is this considered lazy?) right?
[edit] 15 LEDs will be in the circuit.
[QUOTE=false prophet;48838144]I bought 60 LEDs are various wavelengths. Hopefully by the time I get them I'll have enough money for a variabel power supply again.
Would you guys agree that I can just use a voltage regulator or should I use a so called LED driver? All but one type will run on the same voltage(3.5v and 3.2v, lower than there maximum voltage by 0.1v), if I use a voltage regulator, I could just them them all in parallel(is this considered lazy?) right?
[edit] 15 LEDs will be in the circuit.[/QUOTE]
What do you want to do with the LEDs? Just have them lit up? An LED driver would provide a constant current for each string of LED's by default. With a voltage regulator you'd have to also put resistors in series with each LED to balance the current through them. I don't think one or the other is lazy. Just choose what fits your needs the most.
[editline]5th October 2015[/editline]
Also WHY is it so hard to find mica insulating pads for TO-264 transistors? Digikey and mouser have nothing. eBay has two auctions from someone in Taiwain selling them in bulk. I finally found a few on Alibaba but I don't understand. It's a well used package still is it not? At least I see it all the time with audio gear. :frown:
[QUOTE=No_Excuses;48838491]What do you want to do with the LEDs? Just have them lit up? An LED driver would provide a constant current for each string of LED's by default. With a voltage regulator you'd have to also put resistors in series with each LED to balance the current through them.[/QUOTE]
Yes, they will just be staying on. I'm going to use them to experiment with growing plants this winter, and if that fails, an aquarium.
[edit] 12 hours a day, not 24/7
[QUOTE=false prophet;48838556]Yes, they will just be staying on. I'm going to use them to experiment with growing plants this winter, and if that fails, an aquarium.
[edit] 12 hours a day, not 24/7[/QUOTE]
What will you be using for the supply voltage?
Sorry, you need to Log In to post a reply to this thread.