Mirrored as part of a study of Minetest events of 2010 to 2019 and people involved, and in connection with a related book, events in 2017 to 2018, in particular, conferring upon host legal rights related to Fair Use.

Archive for February, 2012

Programming. How do you learn it?

Monday, February 20th, 2012

Here is something I got asked by somebody called Keith in a recent comment:

Thanks for making this code available. I am interested in taking a look for hobby purposes. I also have an engineering background, and when I was at University studying mechanical engineering most of the people in my class could not program to save themselves; I found I had a knack for it and now develop engineering software for a living. Where did you learn your programming skills if not in your current line of study?

I initially thought to reply in a private e-mail, but then I thought I’d post here, because I could think of somebody else asking the same thing. Here goes:

I have been programming a lot as a hobby, and for a bit professionally, since being 13 years old or something… and less since basically forever. I wrote a few lines of BASIC at the age of 9 or so I guess. At the age of 12 I made websites. They were ridiculous by (almost) any standards, but I learned a lot. Also I was having fun with CoolBasic shortly after.

Nobody really taught me, but there was a humble C++ course in secondary school and my family didn’t view the hobby as too bad a thing. More importantly I found some programming related communities and some programmer friends on the internet at that time.

Similarly I learned electronics. Found people and friends on IRC who are interested in that stuff and then designed and made stuff together.

  • “You think this’d be awesome?”
  • “Not sure if we’d be able to pull that off… but sure, let’s try it!”

That. Repeated so many times. Minetest isn’t much of an exception.

And I can program pretty much anything on any platform, unless the problem involves very complex math. Most things don’t.

Making Minetest really isn’t /hugely/ a matter of pure coding skill though; it’s mostly a matter of determination, and now as being largely a community project, it’s much about managing other people’s doings. Also a difficult thing is to take pauses in development of the correct length to not become bored while still keeping other people interested.

// c55

dcdrive2 phase voltage in oscilloscope

Sunday, February 19th, 2012

dcdrive2 is a BLDC(sensored/sensorless)/universal motor speed controller I made about two years ago. Mostly for fun, experience and for the possible uses in combat robots.

Here’s a random photo of dcdrive2 turning a BLDC motor at full speed I took today. It is a sensorless R/C car type motor. The waveform looks pretty much exactly like what a properly working BLDC controller should produce.

dcdrive2 phase voltage oscilloscope shot

Oscilloscope image of dcdrive2 doing it's work

The strict limits of this design is about 10 to 45V of operating voltage (depending on regulator, FET driver and capacitor configuration), and it can supply at least 45 amps (haven’t really been able to test more, after some recent modifications).

dcdrive2

dcdrive2

Here’s a schematic of a version of it, for those interested.

Basically there is an AT90PWM3B (an easily programmable AVR (just like any atmega, but with a capable 3-phase bridge PWM controller)), a 3-phase MOSFET driver (IR2136x family) and the MOSFETs (I’ve been using IRF1405N).

The initial prototype used two DIY PCBs, the other being the high-current board and the other one containing the logic. Here is a shot of a testing setup on an RC car, including 22.2V worth of batteries:

dcdrive2 prototype testing

dcdrive2 prototype testing

The final version uses a robust 4-layer PCB with thick copper layers and as good withstanding of high switching current as I could possibly come up with. I have a few boards laying around and could order more fairly cheaply, if somebody is interested.

I haven’t been able to accomplish proper load testing for it, because I don’t own large enough motors or vehicles or test benches that could stress it to the extent it should be able to withstand, but as for what I have been able to do, the power parts of it don’t seem to even know what failing means. 8)

Normally it is controlled using an RC servo PWM signal. I have also used it as the sole controller in a “melty brain” style fighting robot. This is pretty lightweight usage of it:

Also it is used for controlling the power in this one. Albeit not being brushless, this uses much of the voltage and current capacity of it. I think this was with a 45A current limit.

GGJ2012: Oh Snake

Sunday, February 5th, 2012

I did a solo project in the Global Game Jam 2012 site here at Oulu, Finland, during the last weekend:

First level in my GGJ2012 game "Oh Snake"

First level in my GGJ2012 game "Oh Snake"

It is called “Oh Snake” and it is a snake puzzle game written in Python & PyGame; it includes a level editor and a windows executable.

Project page on globalgamejam.org