Power current SPIN STAMP versus PROP
Hello,
I have make a servo mixer for my submarine, started with the SPIN STAMP.· The total power current is about 26ma, power voltage·7 volt·is used on pin 24 of the SPIN STAMP. When I use the PROP in the same situation and·the same program,·with 5 volt power en 3,3 V·for the PROP, the total current is about 60ma! (see·pdf).·Program downloaded on the Proto Board give also 60ma!.
Setting for the SPIN STAMP:
· ·_CLKMODE = XTAL1 + PLL8X
·· _XINFREQ = 10_000_000
Setting for the PROP:
· ·_CLKMODE = XTAL1 + PLL16X
·· _XINFREQ = 5_000_00
Can someone explain this?
Rob.
{{
***************************
* ServoMixer v1.0······················ *
* Author: Rob van den Berg··········*
* date: 18 juni 2008··················· *
***************************
}}
CON
· ' PROP
·· _CLKMODE = XTAL1 + PLL16X········ 'Note Clock Speed for your setup!!
·· _XINFREQ = 5_000_000
·· '//Spin stamp pin assignments
·'ADC LTC1298 pins 2=CS, 3=CLK, 4=DOUT/DIN
· ADCpin· = 2 ' 2,3 en 4·······································································
· 'Channels receiver 1 and 2
· PIN_Ch1 = 0
· PIN_Ch2 = 1
· 'Servo's
·
· Servo_1 = 12··
· Servo_2 = 13
· Servo_3 = 14
· Servo_4 = 15
· 'Mintrim
· Trim_neg = 16
· Trim_pos = 17
· Trim_3·· = 18
· Trim_4·· = 19
· Gain_1·· = 20
· Gain_0·· = 21
·'//Proller pin assignments
· propTX = 30 'programming output
· propRX = 31 'programming input·
· CR = 13 'carriage return
· LF = 10 'line feed···
· Setp_inclino = 2200 'horizon value
· MidRange = 122
·······
VAR
· long Puls_Ch1
· long Puls_Ch2
· long PWM_1
· long PWM_2
· long ADCVal
· long Error
· long Kp
· long p
· byte zero_3
· byte zero_4
· byte oldval_pos,newval_pos
· byte oldval_neg,newval_neg
· byte pb
···
OBJ
· SERVO : "Servo32v3"
· ADC·· : "CD_LTC1298"
· BS2·· : "BS2_Functions"······ 'create BS2 Object
PUB ServoMixer | temp
· BS2.start (31,30) 'geeft geen debug!
· Zero_3 := Midrange
· Zero_4 := Midrange
· zero_3 := BS2.read(0,1) 'adres 0
· zero_4 := BS2.read(1,1) 'adres 1
· if zero_3 == 0 and Zero_4 == 0
··· BS2.Write(0,Midrange,1)
··· BS2.Write(1,Midrange,1)
· ADC.start(ADCpin)················· 'Initialize ADC chip
'· init servo's··
· SERVO.Set(Servo_1,1400)
· SERVO.Set(Servo_2,1450)
· SERVO.Set(Servo_3,1500)
· SERVO.Set(Servo_4,1500)···
· SERVO.Start·················· 'Start Servo handler, na set init.
· oldVal_pos := 0
· oldVal_neg := 0
·
· repeat
··· Kp := 7 + (!INA[noparse][[/noparse]Gain_0]*1) + (!INA[noparse][[/noparse]Gain_1]*2) 'gain 1 tot 4
'·· BS2.PulsOut(9,100)' alleen voor test cyclustime? 9x binnen 20 msec
··· newVal_pos := ina[noparse][[/noparse]Trim_pos]
··· if oldVal_pos == 0 and newVal_pos == 1
····· if INA[noparse][[/noparse]Trim_3] == 0
······· zero_3 := (zero_3 + 2)
······· BS2.Write(0,zero_3,1)
····· else
······· if INA[noparse][[/noparse]Trim_4] == 0
········· zero_4 := zero_4 + 2
········· BS2.Write(1,zero_4,1)
··· oldVal_pos := newVal_pos
··· newVal_neg := ina[noparse][[/noparse]Trim_neg]
··· if oldVal_neg == 0 and newVal_neg == 1
····· if INA[noparse][[/noparse]Trim_3] == 0·····
······· zero_3 := (zero_3 - 2)
······· BS2.Write(0,zero_3,1)
····· else
······· if INA[noparse][[/noparse]Trim_4] == 0
········· zero_4 := zero_4 - 2
········· BS2.Write(1,zero_4,1)
··· oldVal_neg := newVal_neg
··· 'Puls_Ch1 := BS2.PULSIN_uS (PIN_Ch1, 1) 'niet verder bij geen puls
··· 'Puls_Ch2 := BS2.PULSIN_uS (PIN_Ch2, 1) 'niet verder bij geen puls
··· ADCval := ADC.GetADC(0)
··· Error := (Setp_inclino - ADCval)/3··············
··· p := (Kp * Error)
··· PWM_1 := Puls_Ch1 + p
··· PWM_2 := Puls_Ch2 - p
···
··· SERVO.Set(Servo_1,PWM_1-150)'aangepast aan servo
··· SERVO.Set(Servo_2,PWM_2+25)
··· SERVO.Set(Servo_3,2950-PWM_1 + zero_3)
··· SERVO.Set(Servo_4,2850-PWM_2 + zero_4)
··· '.debug_str(string("ADCval: "))
··· 'BS2.debug_dec(ADCval)
··· 'BS2.debug_str(string(" error: "))
··· 'BS2.debug_dec(error)
··· 'BS2.debug_str(string(" p: "))
··· 'BS2.debug_dec(p)
··· 'BS2.debug_str(string(" PWM_1: "))
··· 'BS2.debug_dec(PWM_1)
··· 'BS2.debug_str(string(13))············
··· 'BS2.debug_str(string(10))···
I have make a servo mixer for my submarine, started with the SPIN STAMP.· The total power current is about 26ma, power voltage·7 volt·is used on pin 24 of the SPIN STAMP. When I use the PROP in the same situation and·the same program,·with 5 volt power en 3,3 V·for the PROP, the total current is about 60ma! (see·pdf).·Program downloaded on the Proto Board give also 60ma!.
Setting for the SPIN STAMP:
· ·_CLKMODE = XTAL1 + PLL8X
·· _XINFREQ = 10_000_000
Setting for the PROP:
· ·_CLKMODE = XTAL1 + PLL16X
·· _XINFREQ = 5_000_00
Can someone explain this?
Rob.
{{
***************************
* ServoMixer v1.0······················ *
* Author: Rob van den Berg··········*
* date: 18 juni 2008··················· *
***************************
}}
CON
· ' PROP
·· _CLKMODE = XTAL1 + PLL16X········ 'Note Clock Speed for your setup!!
·· _XINFREQ = 5_000_000
·· '//Spin stamp pin assignments
·'ADC LTC1298 pins 2=CS, 3=CLK, 4=DOUT/DIN
· ADCpin· = 2 ' 2,3 en 4·······································································
· 'Channels receiver 1 and 2
· PIN_Ch1 = 0
· PIN_Ch2 = 1
· 'Servo's
·
· Servo_1 = 12··
· Servo_2 = 13
· Servo_3 = 14
· Servo_4 = 15
· 'Mintrim
· Trim_neg = 16
· Trim_pos = 17
· Trim_3·· = 18
· Trim_4·· = 19
· Gain_1·· = 20
· Gain_0·· = 21
·'//Proller pin assignments
· propTX = 30 'programming output
· propRX = 31 'programming input·
· CR = 13 'carriage return
· LF = 10 'line feed···
· Setp_inclino = 2200 'horizon value
· MidRange = 122
·······
VAR
· long Puls_Ch1
· long Puls_Ch2
· long PWM_1
· long PWM_2
· long ADCVal
· long Error
· long Kp
· long p
· byte zero_3
· byte zero_4
· byte oldval_pos,newval_pos
· byte oldval_neg,newval_neg
· byte pb
···
OBJ
· SERVO : "Servo32v3"
· ADC·· : "CD_LTC1298"
· BS2·· : "BS2_Functions"······ 'create BS2 Object
PUB ServoMixer | temp
· BS2.start (31,30) 'geeft geen debug!
· Zero_3 := Midrange
· Zero_4 := Midrange
· zero_3 := BS2.read(0,1) 'adres 0
· zero_4 := BS2.read(1,1) 'adres 1
· if zero_3 == 0 and Zero_4 == 0
··· BS2.Write(0,Midrange,1)
··· BS2.Write(1,Midrange,1)
· ADC.start(ADCpin)················· 'Initialize ADC chip
'· init servo's··
· SERVO.Set(Servo_1,1400)
· SERVO.Set(Servo_2,1450)
· SERVO.Set(Servo_3,1500)
· SERVO.Set(Servo_4,1500)···
· SERVO.Start·················· 'Start Servo handler, na set init.
· oldVal_pos := 0
· oldVal_neg := 0
·
· repeat
··· Kp := 7 + (!INA[noparse][[/noparse]Gain_0]*1) + (!INA[noparse][[/noparse]Gain_1]*2) 'gain 1 tot 4
'·· BS2.PulsOut(9,100)' alleen voor test cyclustime? 9x binnen 20 msec
··· newVal_pos := ina[noparse][[/noparse]Trim_pos]
··· if oldVal_pos == 0 and newVal_pos == 1
····· if INA[noparse][[/noparse]Trim_3] == 0
······· zero_3 := (zero_3 + 2)
······· BS2.Write(0,zero_3,1)
····· else
······· if INA[noparse][[/noparse]Trim_4] == 0
········· zero_4 := zero_4 + 2
········· BS2.Write(1,zero_4,1)
··· oldVal_pos := newVal_pos
··· newVal_neg := ina[noparse][[/noparse]Trim_neg]
··· if oldVal_neg == 0 and newVal_neg == 1
····· if INA[noparse][[/noparse]Trim_3] == 0·····
······· zero_3 := (zero_3 - 2)
······· BS2.Write(0,zero_3,1)
····· else
······· if INA[noparse][[/noparse]Trim_4] == 0
········· zero_4 := zero_4 - 2
········· BS2.Write(1,zero_4,1)
··· oldVal_neg := newVal_neg
··· 'Puls_Ch1 := BS2.PULSIN_uS (PIN_Ch1, 1) 'niet verder bij geen puls
··· 'Puls_Ch2 := BS2.PULSIN_uS (PIN_Ch2, 1) 'niet verder bij geen puls
··· ADCval := ADC.GetADC(0)
··· Error := (Setp_inclino - ADCval)/3··············
··· p := (Kp * Error)
··· PWM_1 := Puls_Ch1 + p
··· PWM_2 := Puls_Ch2 - p
···
··· SERVO.Set(Servo_1,PWM_1-150)'aangepast aan servo
··· SERVO.Set(Servo_2,PWM_2+25)
··· SERVO.Set(Servo_3,2950-PWM_1 + zero_3)
··· SERVO.Set(Servo_4,2850-PWM_2 + zero_4)
··· '.debug_str(string("ADCval: "))
··· 'BS2.debug_dec(ADCval)
··· 'BS2.debug_str(string(" error: "))
··· 'BS2.debug_dec(error)
··· 'BS2.debug_str(string(" p: "))
··· 'BS2.debug_dec(p)
··· 'BS2.debug_str(string(" PWM_1: "))
··· 'BS2.debug_dec(PWM_1)
··· 'BS2.debug_str(string(13))············
··· 'BS2.debug_str(string(10))···
pdf
![](/plugins/FileUpload/images/file.png)
664K
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
He's talking about the Propeller-based Stamp module
Rob,
You're talking about a difference of 60-26 = 24mA. There should be very little (less than 1mA) difference between the Spin Stamp's processor operating current and the Protoboard's. The processor's clock circuitry and the PLL are operating twice as fast in the Spin Stamp, but the processor itself is operating at the same frequency and the clock circuitry and the PLL are a very small portion of the chip. The Spin Stamp and the Protoboard use different regulators. The Protoboard has a power LED (5mA drain) and the Spin Stamp does not. It's not clear what circuits you're comparing. Unless you absolutely have the same circuitry attached to the I/O pins, I'd look there for the additional current use.
I thought the current seemed rather high for an ordinary Stamp. I should have noticed the reference to the Propeller and the code. 8-(
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Correct, the circuits are not 100% the same.·To have a·good compare between,·i have connect·the prop of the Proto Board·with 3,3 volt (no regulators used)·so only the Q44+EERPOM·gets power. The current with a simple program (1 cog) is only 14 ma.· ServoMixer software gets 26ma (3 cogs).
With only·the SPIN STAMP powered with 7 volt on·Vin (pin 24), simple·program >> 18ma, and with the ServoMixer >> 31ma. The difference is·the regulators.
The regulators (and led)·on the Proto Board used more current then·i expected (30ma)
thanks.
Rob.