A Forum run by Enthusiasts of MidNite Solar

Charge Controllers and Clippers => The "Classic" charge controller => Topic started by: TomW on January 18, 2013, 10:16:35 AM

Title: Classic Software options discussion
Post by: TomW on January 18, 2013, 10:16:35 AM
Quote from: Psyfy on January 18, 2013, 07:13:12 AM

Yep, looks like the kinda device that should be running Ubuntu! haha

With the single chip computers available it sounds like a neat idea. Nah, wouldn't work. Folks would be buying Classics to run them as workstations and drive the prices up ;D

However, an add on mini computer module with control, logging & SD card storage tools sure would be treat.

Just sayin..

Tom
Title: Re: Classic Software options discussion
Post by: psyfy on January 18, 2013, 11:17:40 AM
Quote from: TomW on January 18, 2013, 10:16:35 AM
Quote from: Psyfy on January 18, 2013, 07:13:12 AM

Yep, looks like the kinda device that should be running Ubuntu! haha

With the single chip computers available it sounds like a neat idea. Nah, wouldn't work. Folks would be buying Classics to run them as workstations and drive the prices up ;D

However, an add on mini computer module with control, logging & SD card storage tools sure would be treat.

Just sayin..

Tom


For sure! Yeah, massive distributed computing using an array of paralleled Classics. What Arm based uP is it using again?  ;)

To extend that functionality, the best mini computer would have to be a Smartphone with access to the logged data done either via LAN (Cat.5 or Wifi), Bluetooth etc.

Actually DGLux for Mango on a Smartphone would be the answer. Guess what I'm saying is, why would you need a display on the device in the first place... Just pair a Classic Lite with an ever ubiquitous Smartphone like the iPhone or Galaxy running Mango and wallah! 4.3" of real estate, full color and multiple dashboards.

So much awesomeness... and a hundred and fifty bucks cheaper too. Actually, can do that right now. :)

Just postulatin...
Title: Re: Classic Software options discussion
Post by: boB on January 18, 2013, 12:25:28 PM
Quote from: TomW on January 18, 2013, 10:16:35 AM
Quote from: Psyfy on January 18, 2013, 07:13:12 AM

Yep, looks like the kinda device that should be running Ubuntu! haha

With the single chip computers available it sounds like a neat idea. Nah, wouldn't work. Folks would be buying Classics to run them as workstations and drive the prices up ;D

However, an add on mini computer module with control, logging & SD card storage tools sure would be treat.

Just sayin..

Tom


I don't think you're going to be able to run linux on a micro with less than 50K of RAM and less than 256K of flash.

Not to mention having any room left over for any kind of application.   (but I mentioned it anyway)

Also, not to mention that almost anyone trying to play with even open source software for a CC would most likely blow the CC up
at the first mistake.  That's why we let the smoke out here first !  (oops...  I mentioned it again, didn't I ?!?)

Actually, one could re-write the firmware from scratch but I kinda guess that would kind of void the warranty, huh ?
We'd probably try to hire anybody that was successful in doing that though, even if they did let the smoke out.

boB
Title: Re: Classic Software options discussion
Post by: TomW on January 18, 2013, 12:52:35 PM
Ryan;

Haha, I thought you cornered the market on piles of desmoked Classics so beware you don't lose the title!

Tom.
Title: Re: Classic Software options discussion
Post by: niel on January 18, 2013, 12:59:59 PM
Quote from: Psyfy on January 18, 2013, 07:23:48 AM
Quote from: niel on January 17, 2013, 09:10:34 PM
if the battery bank is not in use i'm sure you would probably be able to charge it up 1/2 at a time.

as to the pvs, you aren't going to get around the rewire, but it isn't as complicated as you make it sound.

1/2 at a time? Thanks but it's a muck around with a 50kwh battery. CC's like the Midnite current sources right, so 12v@~100a=1200w, 24v@~100a=2400w & 48v@~100a=4800w.
So 48v will adequately cover the C10 recharge rate but 24v will take twice as long. At $5- a Gallon of Gas for the 10kva genset, that makes a bit of a difference.

Though does it really matter? Nah! Just being pedantic I guess. :)

well i did state if you weren't using the batteries as a prerequisite and yes it is going to take twice as long at your $5/gallon, but if you prefer even more money down the drain by not charging them, be my guest. watch the spanking when people try to help you as we could spank back.
Title: Re: Classic Software options discussion
Post by: psyfy on January 18, 2013, 01:30:28 PM
Quote from: niel on January 18, 2013, 12:59:59 PM
well i did state if you weren't using the batteries as a prerequisite and yes it is going to take twice as long at your $5/gallon, but if you prefer even more money down the drain by not charging them, be my guest. watch the spanking when people try to help you as we could spank back.

??? Spanking... sorry, left my monkey at home... Seriously, I didn't realize that it was like that.

All good.
Title: Re: Classic Software options discussion
Post by: psyfy on January 18, 2013, 01:48:59 PM
Quote from: boB on January 18, 2013, 12:25:28 PM
Quote from: TomW on January 18, 2013, 10:16:35 AM
Quote from: Psyfy on January 18, 2013, 07:13:12 AM

Yep, looks like the kinda device that should be running Ubuntu! haha

With the single chip computers available it sounds like a neat idea. Nah, wouldn't work. Folks would be buying Classics to run them as workstations and drive the prices up ;D

However, an add on mini computer module with control, logging & SD card storage tools sure would be treat.

Just sayin..

Tom


I don't think you're going to be able to run linux on a micro with less than 50K of RAM and less than 256K of flash.

Not to mention having any room left over for any kind of application.   (but I mentioned it anyway)

Also, not to mention that almost anyone trying to play with even open source software for a CC would most likely blow the CC up
at the first mistake.  That's why we let the smoke out here first !  (oops...  I mentioned it again, didn't I ?!?)

Actually, one could re-write the firmware from scratch but I kinda guess that would kind of void the warranty, huh ?
We'd probably try to hire anybody that was successful in doing that though, even if they did let the smoke out.

boB

50k/256k? Definitely not an Arm in that case but maybe an 8bit uP like a PIC, HC08 or an Atmel. For the record, my crust comes from coding for the latter but not for SMPS stuff. Vending machines, steppers, big gantry servos and a few other things.

Opensource on power electronics would never be a good idea, unless via an API. Otherwise, bound to get some hack doing an &&outp(0xFF, port_a); or some such and latching both buck/boost IGBT's or MOSFETS gates high. No need to elaborate really... Just lots of smoke and an 'unenameled' choke. ;)

Hard call. I'll have to buy one now. Actually, hang on, I just did online for $610.00. Couldn't help myself. First thing I'll do is take a phillips headand... hahaha

Title: Re: Classic Software options discussion
Post by: stephendv on January 18, 2013, 02:05:31 PM
Quote from: Psyfy on January 18, 2013, 01:48:59 PM
Opensource on power electronics would never be a good idea, unless via an API.

Yeah I agree.  It would be awesome if the Classic could support the base functionality through it's closed and reliable onboard software and then exposed an API which would let you take full control of it.
Would be even better if the API could be accessed over an already established protocol, like modbus and then instead of using an old serial protocol, you could talk to it over ethernet.

Oh wait, it already does all of that  ;)  ;)
Title: Re: Classic Software options discussion
Post by: psyfy on January 18, 2013, 02:23:38 PM
Quote
Oh wait, it already does all of that  ;)  ;)

Cool, sounds great! So Stephen, when you've a spare minute, can you show me how to implement a 'roll your own' Boost algorithm.

Ta. ;)
Title: Re: Classic Software options discussion
Post by: dgd on January 18, 2013, 02:42:06 PM
Quote from: TomW on January 18, 2013, 10:16:35 AM
Quote from: Psyfy on January 18, 2013, 07:13:12 AM

Yep, looks like the kinda device that should be running Ubuntu! haha

However, an add on mini computer module with control, logging & SD card storage tools sure would be treat.


having  hardware add on modules like this seems like a great idea, I would have liked to see this.
However, the concept of the  LITE Classic with all the display, setup and logging  software done externally is the future.. 
Just need the iphone app, a simple version of the local app that shows Classic activity  :)

dgd
Title: Re: Classic Software options discussion
Post by: dgd on January 18, 2013, 03:04:01 PM
Quote from: boB on January 18, 2013, 12:25:28 PM

Also, not to mention that almost anyone trying to play with even open source software for a CC would most likely blow the CC up
at the first mistake.  That's why we let the smoke out here first !  (oops...  I mentioned it again, didn't I ?!?)

Actually, one could re-write the firmware from scratch but I kinda guess that would kind of void the warranty, huh ?
We'd probably try to hire anybody that was successful in doing that though, even if they did let the smoke out.

boB

I think that the smoking should probably be left to you.
What I had in mind with open sourcing the CC firmware was simply making the code available so that other minds could review it  and maybe from that there could originate a useful suggestion or two or twenty.  But I can appreciate there may be concerns that it gives a potential competitor ideas for their own mppt controller.
The local app is a different matter, please open source it asap  :)

dgd
Title: Re: Classic Software options discussion
Post by: stephendv on January 18, 2013, 03:08:32 PM
Quote from: Psyfy on January 18, 2013, 02:23:38 PM
Cool, sounds great! So Stephen, when you've a spare minute, can you show me how to implement a 'roll your own' Boost algorithm.

Hehe, does "it's not exposed by the current API" count as an answer?   And just to double check with the midnite guys, would it be possible to implement boost externally through modbus?
Title: Re: Classic Software options discussion
Post by: mtdoc on January 18, 2013, 03:09:22 PM
Quote from: dgd on January 18, 2013, 02:42:06 PM

However, the concept of the  LITE Classic with all the display, setup and logging  software done externally is the future.. 
Just need the iphone app, a simple version of the local app that shows Classic activity  :)

dgd

Already easy to do this with VNC.  I run Remoter on my iPhone and can access the Local App anywhere, anytime. 8)
Title: Re: Classic Software options discussion
Post by: Westbranch on January 18, 2013, 03:45:30 PM
TomW, can we split this 'programing ' topic off into its own as I think the 24-48 aspect has been concluded.  I think the CPU portion has 'legs', long ones...

tks
Title: Re: Classic Software options discussion
Post by: TomW on January 18, 2013, 04:10:51 PM
Quote from: Westbranch on January 18, 2013, 03:45:30 PM
TomW, can we split this 'programing ' topic off into its own as I think the 24-48 aspect has been concluded.  I think the CPU portion has 'legs', long ones...

tks

Certainly makes sense just not exactly sure "how" to do it without losing something.

Tom
Title: Re: Classic Software options discussion
Post by: TomW on January 18, 2013, 04:18:53 PM
OK, I split this off just hope I didn't orphan comments germane to the original topic!

Tom
Title: Re: Classic Software options discussion
Post by: dgd on January 18, 2013, 04:53:35 PM
Quote from: stephendv on January 18, 2013, 03:08:32 PM
Quote from: Psyfy on January 18, 2013, 02:23:38 PM
Cool, sounds great! So Stephen, when you've a spare minute, can you show me how to implement a 'roll your own' Boost algorithm.

Hehe, does "it's not exposed by the current API" count as an answer?   And just to double check with the midnite guys, would it be possible to implement boost externally through modbus?

HaHa, nice one  ;)  the updated  Classic modbus register listing has not appeared yet... but its unlikely to have boost controls  if the firmware dont already have booster code..  And if it did the MNGP setup would say something. :P

dgd
Title: Re: Classic Software options discussion
Post by: Westbranch on January 18, 2013, 05:14:54 PM
Thanks tom, Hopefully this will keep the discussion germane, the topic seems to be split over several different threads.
---------------------------------------------------------------------------------------------------------
On topic.  There are some great ideas here that I hope will allow me to poll the Classic and a Battery monitor for their output.

I have an isolated Off Grid install, that I am expanding and rebuilding.  Now moving from 12 to 24V system.  System will be unattended for up to 4 months over winter.

The non-existing application I would like needs to run on a CPU that has VERY LOW! power consumption while monitoring the daily PV production and use.  I previously used a Vx Palm pilot to poll my XBM battery monitor every 1/2 hour, still operational but mothballed for now. Was powered direct off 12 v.

The main restriction is that we do not have any cell service, telephone line or sat internet and as the install will be 'unmanned' for long periods, I don't think I would want to leave an inverter and modem running and how would one power a cell phone and does it have the memory capacity to hold that many records??? 120 days x 6 hour x 2 samples / hr =1440 samples...

I hope  this discussion can come up with a solution that can operate on a few different platforms .... great.

so I will just sit here lurking and looking for a less 'cutting edge' solution.   
Title: Re: Classic Software options discussion
Post by: dgd on January 18, 2013, 05:53:13 PM
Quote from: Westbranch on January 18, 2013, 05:14:54 PM
Thanks tom, Hopefully this will keep the discussion germane, the topic seems to be split over several different threads.

The non-existing application I would like needs to run on a CPU that has VERY LOW! power consumption while monitoring the daily PV production and use.  I previously used a Vx Palm pilot to poll my XBM battery monitor every 1/2 hour, still operational but mothballed for now. Was powered direct off 12 v.

The main restriction is that we do not have any cell service, telephone line or sat internet and as the install will be 'unmanned' for long periods, I don't think I would want to leave an inverter and modem running and how would one power a cell phone and does it have the memory capacity to hold that many records??? 120 days x 6 hour x 2 samples / hr =1440 samples...

I hope  this discussion can come up with a solution that can operate on a few different platforms .... great.

so I will just sit here lurking and looking for a less 'cutting edge' solution.

Seems like a Raspberry Pi would fit the bill perfectly, ultra low power, can ethernet to your Classic. Works from a cell phone charger too.
To power it at via USB  I would use a cigar lighter USB plugin that you can get for 24V DC (for truck) and simply wire it (via a lighter socket?) to
your 24V distribution panel. The Pi uses a flash card with easily enough room for your logged data. Pi also has other inputs, USB and 12 header pins that can attach to other devices/sensors etc..
There are also a few Pi People here who would no doubt share code with you  8)
And of course extremely low cost  :)

dgd
Title: Re: Classic Software options discussion
Post by: TomW on January 18, 2013, 06:07:59 PM
Quote from: dgd on January 18, 2013, 05:53:13 PM

Seems like a Raspberry Pi would fit the bill perfectly, ultra low power, can ethernet to your Classic. Works from a cell phone charger too.
To power it at via USB  I would use a cigar lighter USB plugin that you can get for 24V DC (for truck) and simply wire it (via a lighter socket?) to
your 24V distribution panel. The Pi uses a flash card with easily enough room for your logged data. Pi also has other inputs, USB and 12 header pins that can attach to other devices/sensors etc..
And of course extremely low cost  :)

dgd

Yes, that is where I am headed, I hope. Been looking for an elegant logging / control system for years and have used Laptops, EEEPC's, Linksys Slugs, Guruplugs, CAI Webcontrol boards, etc all with varying levels of success and reliability. Pi is just the next step. So far I am just looking at new ways as they pop up. No reliable cell service here at the farm so I never tried phones and the like.

The Pi runs off a 5 VDC power supply to a microusb port, preferably over an amp output. I have the Pi Plate breakout board so I can sense input and control TTL signals operating relays or SSRs, etc. Plus the USB, Ethernet and HD and video out are built in.

But I need to get it working with modbus rather than using the serial register dump stream which limits me to logging & processing output and controlling other devices.

So here I am out in the wilderness of new devices and software hunting down a solution.

Tom

Title: Re: Classic Software options discussion
Post by: mtdoc on January 18, 2013, 06:32:18 PM
Quote from: TomW on January 18, 2013, 06:07:59 PM
I have the Pi Plate breakout board so I can sense input and control TTL signals operating relays or SSRs, etc. Plus the USB, Ethernet and HD and video out are built in.


Tom,

Does the Pi Plate have any A/D capability?

I've been thinking a Pi +  Arduino might make a nice low cost, low power combo for whole system monitoring and control....but other options..??
Title: Re: Classic Software options discussion
Post by: TomW on January 18, 2013, 06:42:23 PM
Quote from: mtdoc on January 18, 2013, 06:32:18 PM

Tom,

Does the Pi Plate have any A/D capability?

I've been thinking a Pi +  Arduino might make a nice low cost, low power combo for whole system monitoring and control....but other options..??

mtdoc;

Nope, its just TTL levels. Some outputs from the Pi can be run in an PWM mode, I think, but haven't dug that deep yet. The Pi Plate is just a breakout board, no active components but has a built in protoboard of sorts so you can build circuits on that.

The CAI Webcontrol has A/D capability as well as 1 wire temp sensor bus and a humidity sensor input, however it has proprietary firmware.

Time will tell where I end up.

Tom
Title: Re: Classic Software options discussion
Post by: mtdoc on January 18, 2013, 07:00:53 PM
Quote from: TomW on January 18, 2013, 06:42:23 PM
Quote from: mtdoc on January 18, 2013, 06:32:18 PM

Tom,

Does the Pi Plate have any A/D capability?

I've been thinking a Pi +  Arduino might make a nice low cost, low power combo for whole system monitoring and control....but other options..??

mtdoc;

Nope, its just TTL levels. Some outputs from the Pi can be run in an PWM mode, I think, but haven't dug that deep yet. The Pi Plate is just a breakout board, no active components but has a built in protoboard of sorts so you can build circuits on that.

The CAI Webcontrol has A/D capability as well as 1 wire temp sensor bus and a humidity sensor input, however it has proprietary firmware.


Ok. thanks.  I know the GertBoard for the Pi has lots of A/D capability but it's a bit overkill and not cheap.

What I like about the Arduino is it's A/D capability and flexibility (and low cost!).   People are combining Arduino's with Pi for all sorts of cool projects - I haven't yet  seen a RE monitor and control example yet..

Quote

Time will tell where I end up.

Tom


Yeah - me too.  But at the pace I'm going it may be a while.  Got another full time job - speaking of which I better get back to it now.... ::)
Title: Re: Classic Software options discussion
Post by: psyfy on January 18, 2013, 09:17:29 PM
Quote from: stephendv on January 18, 2013, 03:08:32 PM
Hehe, does "it's not exposed by the current API" count as an answer?   And just to double check with the midnite guys, would it be possible to implement boost externally through modbus?

Yep, answers my question, like a boomerang...

Thinking about it all from a dev's POV... Limited MCU resources? A MODBUS I/F? (or even I2C, 1wire etc.) Dude, it's cooking already!

So, design an expansion PCB with MCU (enough resources to futureproof, whatever that is.) and a MODBUS I/F on board. Code modularized functionality like the 'Boost feature', flash it to the expansion MCU. $29.95 - $49.95 for key functionality additions... Or, go USB (ext) to MODBUS (int) on plugin hardware modules. Buy the 'extensibility module' (say FTDI for example) then buy the 'Boost' module to suit (or other h/w widget), plug it in, config the system. Entry? One to get in, one to play the game.
Separate MCU, separate code, separate development chain. You get the picture.

I conceed though, would require a major topology rethink & code rewrite... but with direction (& ongoing revenue stream). The existing MCU becomes defined as the base functionality core and also the extensibility arbitrator. Spaghetti code always at the beginning has someone scratching something, somewhere.  ;) Been there, done that, could write a book on the subject.

Title: Re: Classic Software options discussion
Post by: stephendv on January 19, 2013, 03:18:02 AM
I'm very happy with Mango for the software side, the scripting ability means it can do everything I wanted it to do, without requiring too much coding effort on my part.  The Raspberry pi is also almost a perfect monitoring system because of it's low power and low cost. 

Below a screenshot of the variables I'm monitoring with Mango and a chart of the current.

I just received the relay and wireless modules I need to remotely turn on my water pump from the rpi: http://shop.ciseco.co.uk/xrf-wireless-rf-radio-uart-rs232-serial-data-module-xbee-shape-arduino-pic-etc/

That company has a bunch of other modules which might be of interest, like their RF board + arduino for about the same price as a normal arduino: http://shop.ciseco.co.uk/radio-arduino-compatible-starter-kit-lowest-cost-in-the-world/
And a GPIO expander for the raspberry pi for under 10 USD: http://shop.ciseco.co.uk/k002-slice-of-pi-o/
Title: Re: Classic Software options discussion
Post by: TomW on January 19, 2013, 11:38:49 AM
Stephen;

Now that is what I am talking aboout!

I see  you got mine to run.  ;D

I think there is a huge potential here and appreciate you bringing Mango up and helping me with mine.

Now for a savvy individual to sort out a stripped down version of Linux to run it with plenty of overhead on resources.

Thanks a bunch for the thread & help.

Tom
Title: Re: Classic Software options discussion
Post by: mtdoc on January 19, 2013, 02:44:36 PM
Quote from: stephendv on January 19, 2013, 03:18:02 AM
I'm very happy with Mango for the software side, the scripting ability means it can do everything I wanted it to do, without requiring too much coding effort on my part.  The Raspberry pi is also almost a perfect monitoring system because of it's low power and low cost. 

Below a screenshot of the variables I'm monitoring with Mango and a chart of the current.



Stephen - Awesome stuff!

A few questions.  Is all the data  coming into your rPI in serial form?    I agree that rPI seems ideal for a low power low cost monitoring system  but I'm interested in taking analog voltage data from various sensors (CTs, DC shunt, thermistor, etc) as well as serial data from the Classic and being able to log and display this sensor and classic data and I don't think the PI can do any A/D  (which is where an Arduino might be useful)  - but maybe I'm wrong. Is there an inexpensive add on A/D board for the rPI?

I'm just trying to get a handle on how best to accomplish what I'm after.   I can program in Labview and take raw sensor data (via Arduino A/D or other low cost DAQ board)  and serial data - log, display, control, etc  but LabView will not run on a rPI or any other super low power, low cost platform. (best I can do is run it on a small netbook).

A Mango Pi (!) may be a better solution.... :D

Also - I like the Mango graphs but what are those spikes down? Some look like loads but others look very brief. Maybe it's just the time frame. Are some of those artifact or is your current really doing that?

Thanks for all your help - you seem to have developed some great tools very quickly!
Title: Re: Classic Software options discussion
Post by: stephendv on January 20, 2013, 02:56:25 AM
Quote from: mtdoc on January 19, 2013, 02:44:36 PM
Is all the data  coming into your rPI in serial form?    I agree that rPI seems ideal for a low power low cost monitoring system  but I'm interested in taking analog voltage data from various sensors (CTs, DC shunt, thermistor, etc) as well as serial data from the Classic and being able to log and display this sensor and classic data and I don't think the PI can do any A/D  (which is where an Arduino might be useful)  - but maybe I'm wrong. Is there an inexpensive add on A/D board for the rPI?

The data from the classic comes into the pi via the ethernet cable, and the sunny island data comes in directly from an sql database which get there through another program, but I won't get into that.  AFAIK, the GPIOs on the rpi don't have an ADC so you're probably on the right track with an attached arduino to talk to sensors.  Another option might be the phidgets system: www.phidgets.com, but the boards and sensors tend to be quite a bit more expensive than an arduino. 
If you had a serial connection between the rpi and arduino, then you could run a modbus slave on the arduino and talk to it from the rpi through mango, for example.  There seem to be a view modbus libraries for arduino, but you'd still have to write the software using these libraries to read data from your sensors and present them over modbus.

Quote from: mtdoc on January 19, 2013, 02:44:36 PM
Also - I like the Mango graphs but what are those spikes down? Some look like loads but others look very brief. Maybe it's just the time frame. Are some of those artifact or is your current really doing that?
Thanks for all your help - you seem to have developed some great tools very quickly!

The spikes in the graph are real, we've had some terrible weather these days.  Getting going quickly is thanks to using someone else's software, ie. Mango  ;)
The only bits of code I've had to write are the python script to send commands to the classic, like force float and force EQ which I now control from the rpi, and the short pieces of JavaScript used by the "scripting" module in mango.  Attached is my end amps script which forces float on the classic based on the charging current read by the Sunny Island's shunt.

If you just want to trigger events based directly on a single value, then you don't need a script, another example attached which sends me an email if the battery soc is below 50%.


Title: Re: Classic Software options discussion
Post by: mtdoc on January 20, 2013, 03:17:36 PM
Thanks for all the info Stephen.  I think I'm getting a handle on my options.

The first thing I need to get going is reading sensor data.  Then I need to do some learning about modbus -so I can handle the Classic interface..

Ultimately I may end up on a rPI but I'll probably start on my windoze box since I'm running some other monitoring stuff that requires it (Wattplot for my Outback stuff and Cumuius for my weather station).  Once I get to the point that I can handle the serial data from my Outback Mate I could move a Linux system.

For now I'm actually pretty happy with what I can monitor and control with the Local Ap, Wattplot and Cumulus and using VNC for remote access,  but there's so much potential to do more as you are proving.   It's really all just hobby fun for me - and I'm in no hurry.

Thanks again.