Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:56 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PWM DC motor speed control

Author Message
roleyrev
Newbie

Joined: 13/10/2011
Location: New Zealand
Posts: 8
Posted: 07:26pm 13 Oct 2011
Copy link to clipboard 
Print this post

Hi all,

I'm loving the Maximite! It’s taken me back to my young days and my first computer which happened to be a ZX81 (I’m not quite old enough for a Tandy). The ZX81 lead to a string of Amstrad computers so on etc so on....Anyway....
I’m planning to use the Maximite to auto control my solar water heater (home made) and like the idea of using PWM to control the speed of the circulating pump. I was thinking of buying a motor speed controller kit from Jaycar, discarding the PWM IC and using Maximite’s sound output to drive the rest of the PWM circuit. Does this sound feasible? The motor is 12 volt 3 amp rated.
In addition to this I’ve used LM335Z temperature sensors to measure the various temperatures around the system (very much like fridge.jpg in the program libarary). I have padded the outputs by half to be able to measure higher temperatures than would be able by just by connecting the sensors straight to Maximite.
One of the best features is the ability to report back to my home automation system via the USB connection to my home server. This uses a program called Eventghost to do logic and act on events (serial, IR, USB Bitwacker ETC) and a program called Command Fusion to display the information wirelessly to my iPAD. Eventghost uses a programming language called python.
Effectively I will have made Maximite into its own solar water controller that is stand alone (battery backed and run off a solar panel) with integration to my home automation - very cool.


Cheers

John Reveley
Christchurch
New Zealand
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 226
Posted: 06:45am 14 Oct 2011
Copy link to clipboard 
Print this post

Hi John

I think then maximite is an overkill for controlling a pump motor for a solar heater.
where a picaxe 08m would provide a simple PWM control with a temperatur sensor.
I have built a controller for a 24v 300w (only used a 12 volt supply for the motor) using the 08m with a power MOSFET to drive the motor and a ds18b20 temperare sensor.

additional information can be obtained from




In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 226
Posted: 06:48am 14 Oct 2011
Copy link to clipboard 
Print this post

oops missed the link

www.picaxe.co.uk
In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
roleyrev
Newbie

Joined: 13/10/2011
Location: New Zealand
Posts: 8
Posted: 10:20am 15 Oct 2011
Copy link to clipboard 
Print this post

Hi Bill,

thanks for that - I have used the PWM part of the circuit. I will be using the maximite to log to an excell file, keeping daily, weekly and monthly trends and work out projected energy savings. It reports back to the rest of my automation system so I can keep an eye on it from my iPad. I have it measuring solar panel temperature, inlet and out temperature, tank temperature and ambient temperature.
EventGhost running on my automation PC even sets the date and time when the Maximite first starts up.

Cheers

John
 
Vikingboy
Regular Member

Joined: 23/09/2011
Location: Australia
Posts: 82
Posted: 11:28am 15 Oct 2011
Copy link to clipboard 
Print this post

Quote:
EventGhost running on my automation PC even sets the date and time when the Maximite first starts up.


Hi,

would you mind giving a short description of how you accomplisfed this ?

thanks,

Andrew
 
roleyrev
Newbie

Joined: 13/10/2011
Location: New Zealand
Posts: 8
Posted: 12:30am 16 Oct 2011
Copy link to clipboard 
Print this post

Hi Andrew,

Are you familiar with eventghost? :

http://www.eventghost.org/

Its a free program that you run on a pc. What is does is monitor events that happen on serial ports or infrared devices (and many more ways: TCP/IP,UDP and on screen). In it most simplist form you can monitor for an event and send a pre made reply. As it would happen Maximite turns up as a serial port so configure the eventghost session on the PC you are using to monitor the serial port in the Autostart folder on the config tree. See below.




Ok so as you can see I have made the event prefix Solar and the terminator \r\n (newline and carrage return)

now anything that Maximte generates come into event ghost as Solar.




using Solar. plus a wildcard "*" you can make eventghost look at the information comming form the Maximite program




Now as you can see I have some eventghost python script. This is to allow access to python variables and "pull apart" the Maximite solar messages.




Finally the date and time, Maximite asks the time question with a time. event, this turns up in eventghost as Solar.Time. This in turn triggers an event (written in python) to send back the current PC time







the date portion of the reply is similar but uses eg.plugins.Serial.Write(time.strftime("%d-%m-%Y\r")) to output day - month - year (the \r is carrage return)

I am using a program called command fusion (this also has an eventghost plugin) to view the temps on my iPod touch. You can use command fusion for free on a single page loyout.




Each if the 0 figures with a small number beside it is a serial joint, this allows Eventghost to send real numbers to the layout on the iPod with the real temperatures and Motor PWM




You can see here the serial join Number is one and this represents the plate temperature. The variable eg.globals.plate is defined in the autostart part of eventghost and gets it value from the parsed output from the Maximite

let me know if this helps

Cheers

John
 
roleyrev
Newbie

Joined: 13/10/2011
Location: New Zealand
Posts: 8
Posted: 10:21am 16 Oct 2011
Copy link to clipboard 
Print this post

Hi again -

Code listing for Maximite looks like this -


10 '*******Solar Controller with PWM and EG interaction********'
20 '*******John Reveley 2011************************************'
30 DIM i(6)
40 kbrd$ = ""
50 pumpstat = 0
60 pumppwm = 0
70 OPEN "SOLAR.XLS" FOR OUTPUT AS #1
80 PRINT #1, "Date" , "Time" , "Plate" , "Inlet" , "Outlet" , "Tank" , "PWM" , "AMB"
90 CLOSE #1
100 FOR loop = 1 TO 6
110 SETPIN loop,1
120 NEXT
130 PRINT "Time.";CHR$(13);CHR$(10);
140 INPUT "",kbrd$
150 TIME$ = kbrd$
160 PRINT "Date.";CHR$(13);CHR$(10);
170 INPUT "",kbrd$
180 DATE$ = kbrd$
190 SETTICK 60000,500
200 '*****Loop Under Here*****
210 DO
220 kbrd$ = INKEY$
230 IF kbrd$= "f" THEN GOSUB 500
240 IF kbrd$ = "e" THEN END
250 IF kbrd$ = "q" THEN GOSUB 900
260 LOOP
500 '********Get Temperatures and Set Pump PWM********'
510 OPEN "SOLAR.XLS" FOR APPEND AS #1
520 PRINT #1, DATE$, TIME$,;
530 FOR loop = 1 TO 6
540 i(loop) = PIN(loop)
550 IF loop = 5 THEN i(loop) = (pumppwm+273.15) / 200
560 PRINT " , ";
570 PRINT FORMAT$((i(loop)*200)-273.15,"%4.1f");
580 PRINT #1,FORMAT$((i(loop)*200)-273.15,"%4.1f"),;
590 NEXT
600 PRINT #1,""
610 CLOSE #1
620 IF i(1) > i(4) THEN
630 IF pumppwm = 0 THEN GOSUB 800
640 pumppwm = (i(1) - i(4)) * 4
650 IF pumppwm > 100 THEN pumppwm = 100
660 IF pumppwm < 40 THEN pumppwm = 50
670 SOUND 4000,60050,pumppwm
680 ELSE
690 pumpstat = 0
700 pumppwm = 0
710 ENDIF
720 PRINT ""
730 IF kbrd$ = "f" THEN RETURN
740 IRETURN
800 '*********KickStart Pump******'
810 SOUND 4000,1000,100
820 pumpstat = 1
830 RETURN
900 '********Report Temps to EventGhost********'
910 PRINT "Plate:";FORMAT$((i(1)*200)-273.15,"%4.1f"),
920 PRINT "Outlet:";FORMAT$((i(2)*200)-273.15,"%4.1f"),
930 PRINT "Inlet:";FORMAT$((i(3)*200)-273.15,"%4.1f"),
940 PRINT "Tank:";FORMAT$((i(4)*200)-273.15,"%4.1f"),
950 PRINT "PWM:";FORMAT$((i(5)*200)-273.15,"%4.1f"),
960 RETURN


Note line 130 is the Maximite request for time - terminated in CR and NL (this is the termination string for events in eventghost)
and 160 is the Maximite request for date.

Cheers

John
 
Vikingboy
Regular Member

Joined: 23/09/2011
Location: Australia
Posts: 82
Posted: 11:38am 16 Oct 2011
Copy link to clipboard 
Print this post

Roley,
Thanks allot for your help, took a bit of fiddling and trial and error, for some reason it wouldn't take the trigger as written, but just grabbing it from the log window with a bunch of extra strange characters etc, and it works fine now.

Got it all working now, strange I couldn't read it from the other apps, could be I just need to add the carriage return and newline to the print statement as you have, will experiment more another day.

But event ghost looks very powerful, so I guess it may have allot of other uses, and learning Python will always be useful.

thanks,

Andrew
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024