Typically these loco's draw around 300mA - 600mA ( a quick test showed mine drawing 380mA with no coaches at full throttle )
The schematic as it stands is attchaed
Typically these loco's draw around 300mA - 600mA ( a quick test showed mine drawing 380mA with no coaches at full throttle )
The schematic as it stands is attchaed
Saw the video.
I've seen snails move faster than that, when it's raining.
Cool.
Hope someone can figure out the Growl.
DT
Hi, Malc,
R3 is no use at all here ... short it !!!
... but a 1N 540x cathode at the + 12v, anode on the V+ output could be rather useful ...
Alain
PS ... for Growling, may be you could try to " unsharpen" the PWM to somewhat with increased rise and fall time ... by inserting a filtering coil in series in the output line ( a LITTLE smoothing capacitor too ??? )
Last edited by Acetronics2; - 16th February 2007 at 09:56.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi,
Don't have that Diode suggested, have plenty of 1N4148's or 1N4001 to hand, would they do ?
The 4001 will be a bit too weak ... for serious use.
try to find a 3A rated model ... or use a PNP Darlington with diode Built in !!! like BD678/680
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
OK I thought, lets move this on and use a PIC capable of providing all 4 seperate PWM outputs. So after consultation via a few PMs with Steve and Darrel I've opted for a 16F676.
I've used a 20Mhz xtal, with 22pf caps between pins 2 and 3, wiper from 10K pot goes to pin 13 and PWM output on pin 8.
I've modified the code used for the 12F675, and compiled - no errors or warning, and loaded it into the PIC.
I then tested the code / hardware and I don't get the same performance as I did with the 12F. There is no responce from the loco until the pot is at mid point, at this stage the armature sings with a high pitch noise. Advancing the pot increases the speed, but I don't get anywhere like the slow crawl speeds I got with the 12F. I can also assume that the armature is warming as it smelt a little (carbon smell) after a short run.Code:@ __CONFIG _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_OFF ANSEL=%00110001 CMCON=7 TRISA=%11111111 'set PORTA as all input TRISC=%00000001 'set PORTC as all output apart from RC0 DEFINE OSC 20 CLEAR DEFINE ADC_BITS 8 ' Set number of bits in result DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3) DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds INCLUDE "DT_INTS-14.bas" ; Base Interrupt System INCLUDE "SPWM_INT.bas" ; Software PWM module DEFINE SPWM_FREQ 100 ; SPWM Frequency DEFINE SPWM_RES 255 ; SPWM Resolution DutyVars VAR BYTE[3] ; DutyCycle Variables DutyVar1 VAR DutyVars[0] ; group them in an array for easy access DutyVar2 VAR DutyVars[1] ; with FOR loops etc. DutyVar3 VAR DutyVars[2] DutyVar4 VAR DutyVars[3] ASM SPWM_LIST macro ; Define Pin's to use for SPWM SPWM_PIN PORTC, 2, _DutyVar1 ; and the associated DutyCycle variables SPWM_PIN PORTC, 3, _DutyVar2 ; Notice the underscore before variables SPWM_PIN PORTC, 4, _DutyVar3 SPWM_PIN PORTC, 5, _DutyVar4 endm SPWM_INIT SPWM_LIST ; Initialize the Pins ENDASM ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler TMR1_INT, SPWMhandler, ASM, yes endm INT_CREATE ; Creates the interrupt processor ENDASM @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts ;_____________________________________________________________________________ Main: ADCIN 0, DUTYVAR1 ADCIN 1, DUTYVAR2 ADCIN 2, DUTYVAR3 ADCIN 3, DUTYVAR4 GOTO Main
I think its probably down to my poor understanding of Ansel etc.. so an constructive comments would be welcome.
Oh and I've not changed the driver stage yet as Alain suggested.
EDIT:: EDIT::
Changed the Xtal for a 4Mhz and the frequency of the noise has dropped.. but its still there and not the low growl that was produced by the 12F.. so it it a timing issue ??
Last edited by malc-c; - 16th February 2007 at 13:06.
I've also tried the other channels, and get the same performance and noise from each one. (I've also reduced the frequency down to 100 to make sure I get 4 channels) - and I'm using the int osc to compare it against the 12F
I've noticed that the growling from the armature has a second resonating sound that I can only describe as the sound you get with a multi-engine prop plane when the engine is slightly out of sync. I can only assume this is due to the PIC having to work hard outputing to 4 channels rather than the 1 on the 12F.
If all else fails, I'll use a 12F675's to drive each of the 4 controllers... overkill I know, but the performance I was getting with the 12F was just what I was after.
I'm hoping the issue with the 16F676 is due to a conflict of configuring the ports to the correct analogue / a2d / digital combination, and with your help, will work as good as the 12F !
There's something bad in the schematic indeed. R3 have it's use... but not at the good place. Should be in serie with the transistor base. If you short it, you'll burn the transistor...
I'm curious.. i'll try to find some 12V motor (1A or more) 'round here today, and test the whole thing. Sure it's possible.
I'll dig in the transistor datasheet... sure there's something bad in their HFe mathe here....
Anyways, i'll be back!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks