Originally Posted by MiB
(Post 1300398)
Why is it so hard to use the factory system?
|
If anyone's curious, here's my program; or at least what I have so far. I'm sure the values will have to be changed once installed. Servo position 150 in stopped. 100 is max reverse. 200 is max forward.
setfreq m8 servo 2,150 servopos 2,132 pause 1000 servopos 2,150 pause 50 readadc 0,b5 servopos 2,168 pause 1000 servopos 2,150 pause 50 readadc 0,b6 readadc 2,b1 main: readadc 0,b0 readadc 2,b1 if b1 > 71 then gosub pos1 if b1 > 74 then gosub pos2 if b1 > 77 then gosub pos3 if b1 > 80 then gosub pos4 if b1 > 83 then gosub pos5 if b1 > 86 then gosub pos6 if b1 > 89 then gosub pos7 if b1 > 92 then gosub pos8 if b1 > 95 then gosub pos9 if b1 > 98 then gosub pos10 if b1 > 101 then gosub pos11 if b1 > 104 then gosub pos12 if b1 > 107 then gosub pos13 if b1 > 110 then gosub pos14 if b1 > 113 then gosub pos15 if b1 > 116 then gosub pos16 if b1 > 119 then gosub pos17 if b1 > 122 then gosub pos18 if b1 > 125 then gosub pos19 if b1 > 128 then gosub pos20 if b1 > 130 then gosub pos21 if b0 < b2 then goto open if b0 > b3 then goto close servopos 2,150 pause 50 readadc 0,b0 readadc 2,b1 let b4 = b0 - b2 + 100 goto main open: readadc 0,b0 readadc 2,b1 let b4 = b0 - b2 + 100 if b4 > 60 then goto fineopen servopos 2,168 goto main close: readadc 0,b0 readadc 2,b1 let b4 = b0 - b2 + 100 if b4 < 140 then goto fineclose servopos 2,132 goto main fineopen: servopos 2,160 goto main fineclose: servopos 2,140 goto main pos1: let b2 = 40 let b3 = b2 + 4 return pos2: let b2 = 50 let b3 = b2 + 4 return pos3: let b2 = 60 let b3 = b2 + 4 return pos4: let b2 = 70 let b3 = b2 + 4 return pos5: let b2 = 80 let b3 = b2 + 4 return pos6: let b2 = 90 let b3 = b2 + 4 return pos7: let b2 = 100 let b3 = b2 + 4 return pos8: let b2 = 110 let b3 = b2 + 4 return pos9: let b2 = 120 let b3 = b2 + 4 return pos10: let b2 = 130 let b3 = b2 + 4 return pos11: let b2 = 140 let b3 = b2 + 4 return pos12: let b2 = 150 let b3 = b2 + 4 return pos13: let b2 = 160 let b3 = b2 + 4 pos14: let b2 = 170 let b3 = b2 + 4 return pos15: let b2 = 180 let b3 = b2 + 4 return pos16: let b2 = 190 let b3 = b2 + 4 return pos17: let b2 = 200 let b3 = b2 + 4 return pos18: let b2 = 210 let b3 = b2 + 4 return pos19: let b2 = 220 let b3 = b2 + 4 return pos20: let b2 = 230 let b3 = b2 + 4 return pos21: let b2 = 240 let b3 = b2 + 4 return |
Cheers CivicTsi. Can you rename some things to make it easier to read or just format it with tabs and blank lines? and what is b3?
|
Here's my real simple bit of code, it's not all there, just the algorithm to control the servo.
sweeptime = 100 '100ms Pulsout outpin, sweeptime 'move servo to one side start: ADCIN 2, psi 'check boost level on adc channel2 and save to psi if psi>target then 'compare target to current boost level sweeptime = sweeptime + 5 'increase servo opening position adds 5ms to sweeptime pulsout outpin, sweeptime 'output position to servo pause 15 'pause for servo's sake goto start 'start all over else pulsout outpin, 100 'if boost's below target shut VGT endif pause 15 'pause for servo's sake goto start 'start all over Shutting the VGT might be a bit to quick and I might need to gradually shut it the same way it opens. I'm thinking with a servo, it won't need continuous self correction/position monitoring in the code because servos should go to their position and hold it. I know some servos hold and some don't and if the servo I have doesn't hold, it gets updated quickly enough (50-60 times a sec) to hopefully not make a difference. I haven't written it yet but I know I need to cap sweeptime to 200 so the servo don't try to break itself. |
Sure, I can go through with an explanation. I will a little later today when I have more time. As for the variables:
b0=Pot position b1=Map sensor b2=The position desired b3= The position desired plus a little more, giving it an acceptable range to be in. b4=The difference between b0 and b2 b5=The Pot position when vane is fully closed after initital startup. b6=The Pot position when vane is fully open after initital startup. More to come later.. |
Originally Posted by Skylar
(Post 1300403)
Here's my real simple bit of code, it's not all there, just the algorithm to control the servo.
sweeptime = 100 '100ms Pulsout outpin, sweeptime 'move servo to one side start: ADCIN 2, psi 'check boost level on adc channel2 and save to psi if psi>target then 'compare target to current boost level sweeptime = sweeptime + 5 'increase servo opening position adds 5ms to sweeptime pulsout outpin, sweeptime 'output position to servo pause 15 'pause for servo's sake goto start 'start all over else pulsout outpin, 100 'if boost's below target shut VGT endif pause 15 'pause for servo's sake goto start 'start all over Shutting the VGT might be a bit to quick and I might need to gradually shut it the same way it opens. I'm thinking with a servo, it won't need continuous self correction/position monitoring in the code because servos should go to their position and hold it. I know some servos hold and some don't and if the servo I have doesn't hold, it gets updated quickly enough (50-60 times a sec) to hopefully not make a difference. I haven't written it yet but I know I need to cap sweeptime to 200 so the servo don't try to break itself. |
setfreq m8 'Set PIC frequency to 8Mhz
servo 2,150 'Activate servo control servopos 2,132 'Close Vane pause 1000 servopos 2,150 'Stop Vane pause 50 readadc 0,b5 'Take position reading and save to memory block b5 servopos 2,168 'Open Vane pause 1000 servopos 2,150 'Stop Vane pause 50 readadc 0,b6 'Take position reading and save to memory block b6 readadc 2,b1 'Take MAP sensor reading and save to memory block b1 main: readadc 0,b0 'Take position reading and save to memory block b0 readadc 2,b1 'Take MAP sensor reading and save to memory block b1 if b1 > 71 then gosub pos1 'If MAP sensor is greater than 71 then temporarily goto pos1, etc. if b1 > 74 then gosub pos2 if b1 > 77 then gosub pos3 if b1 > 80 then gosub pos4 if b1 > 83 then gosub pos5 if b1 > 86 then gosub pos6 if b1 > 89 then gosub pos7 if b1 > 92 then gosub pos8 if b1 > 95 then gosub pos9 if b1 > 98 then gosub pos10 if b1 > 101 then gosub pos11 if b1 > 104 then gosub pos12 if b1 > 107 then gosub pos13 if b1 > 110 then gosub pos14 if b1 > 113 then gosub pos15 if b1 > 116 then gosub pos16 if b1 > 119 then gosub pos17 if b1 > 122 then gosub pos18 if b1 > 125 then gosub pos19 if b1 > 128 then gosub pos20 if b1 > 130 then gosub pos21 if b0 < b2 then goto open 'If actual position is less than desired position, open vane. if b0 > b3 then goto close 'If actual position is more then desired position plus 4, than close vane servopos 2,150 'stop vane pause 50 readadc 0,b0 'Take position reading and save to memory block b0 readadc 2,b1 'Take MAP sensor reading and save to memory block b1 let b4 = b0 - b2 + 100 'make b4 show the difference between actual and desired position plus 100 to prevent overflow goto main open: readadc 0,b0 'Take position reading and save to memory block b0 readadc 2,b1 'Take MAP sensor reading and save to memory block b1 let b4 = b0 - b2 + 100 'make b4 show the difference between actual and desired position plus 100 to prevent overflow if b4 > 60 then goto fineopen 'if within 40 of desired position, open at slower speed. servopos 2,168 'open vane goto main close: readadc 0,b0 'Take position reading and save to memory block b0 readadc 2,b1 'Take MAP sensor reading and save to memory block b1 let b4 = b0 - b2 + 100 'make b4 show the difference between actual and desired position plus 100 to prevent overflow if b4 < 140 then goto fineclose ''if within 40 of desired position, close at slower speed. servopos 2,132 'close vane goto main fineopen: servopos 2,160 goto main fineclose: servopos 2,140 goto main pos1: let b2 = 40 'Make desired positon 40, etc let b3 = b2 + 4 'Make the desired position plus 4 the highest acceptable tolerance for position return pos2: let b2 = 50 let b3 = b2 + 4 return pos3: let b2 = 60 let b3 = b2 + 4 return pos4: let b2 = 70 let b3 = b2 + 4 return pos5: let b2 = 80 let b3 = b2 + 4 return pos6: let b2 = 90 let b3 = b2 + 4 return pos7: let b2 = 100 let b3 = b2 + 4 return pos8: let b2 = 110 let b3 = b2 + 4 return pos9: let b2 = 120 let b3 = b2 + 4 return pos10: let b2 = 130 let b3 = b2 + 4 return pos11: let b2 = 140 let b3 = b2 + 4 return pos12: let b2 = 150 let b3 = b2 + 4 return pos13: let b2 = 160 let b3 = b2 + 4 pos14: let b2 = 170 let b3 = b2 + 4 return pos15: let b2 = 180 let b3 = b2 + 4 return pos16: let b2 = 190 let b3 = b2 + 4 return pos17: let b2 = 200 let b3 = b2 + 4 return pos18: let b2 = 210 let b3 = b2 + 4 return pos19: let b2 = 220 let b3 = b2 + 4 return pos20: let b2 = 230 let b3 = b2 + 4 return pos21: let b2 = 240 let b3 = b2 + 4 return |
How about using a linear actuator attached to the compressor housing and linked to the VGT arm? They have amazing push/pull forces... I don't think they are that sensitive to high temps as servos seem to be... and if getting the vgt from position "x" to position "y" in less than a second is not really critical... then they could help... couldn't they? (they are on the slow side in terms of actuation speed but compensate with strength)
Those things can lift tens, hundreds and even thousands of times their own weight and would somehow prevent rack seizure by applying generous amounts of force to move the whole thing back and forth... are they overly expensive? Are they readily available in the RC/hobby/DIY robotics world? Do they generate position feedback? I'm only thinking aloud here... forgive my noob status with these things... I wish I knew how to tinker with microcontrollers myself... damn!... I better get started now... Skylar... I'll take you on that offer to point me in the right direction... from the little stuff I've read, there seems to be a hot debate over which PIC is better for what: Picaxe: Great as an educational tool and easy to program, Arduino: Great variety of "shields" (pre-assembled boards with functions like FM trasreceiver, GPS, bluetooth, etc) and generic PICs: Which from what I understand are tougher to program cause they run on assembler code... honestly, I dont even know if what I've just writen here will make any sense... Can you mention a few books to get me started on microcontrollers? I bet there's a "Microcontrollers for dummies" ... lol... |
Originally Posted by Turboedmav
(Post 1300414)
How about using a linear actuator attached to the compressor housing and linked to the VGT arm? They have amazing push/pull forces... I don't think they are that sensitive to high temps as servos seem to be... and if getting the vgt from position "x" to position "y" in less than a second is not really critical... then they could help... couldn't they? (they are on the slow side in terms of actuation speed but compensate with strength)
Those things can lift tens, hundreds and even thousands of times their own weight and would somehow prevent rack seizure by applying generous amounts of force to move the whole thing back and forth... are they overly expensive? Are they readily available in the RC/hobby/DIY robotics world? Do they generate position feedback? I'm only thinking aloud here... forgive my noob status with these things... I wish I knew how to tinker with microcontrollers myself... damn!... I better get started now... Skylar... I'll take you on that offer to point me in the right direction... from the little stuff I've read, there seems to be a hot debate over which PIC is better for what: Picaxe: Great as an educational tool and easy to program, Arduino: Great variety of "shields" (pre-assembled boards with functions like FM trasreceiver, GPS, bluetooth, etc) and generic PICs: Which from what I understand are tougher to program cause they run on assembler code... honestly, I dont even know if what I've just writen here will make any sense... Can you mention a few books to get me started on microcontrollers? I bet there's a "Microcontrollers for dummies" ... lol... As for learning how to program a PIC, it's not that hard. 6 months ago I couldn't even tell you what a PIC was. Do what I did and read the manual. Using the program examples in the manual helped a lot. As for Arduino vs. Picaxe, I have no idea which one is better or easier. I think they will both do what you want them to do though. |
I'm still working on the PWM route to control the factory electronics. No success yet. I'm doubting more and more that this thing is preprogrammed to additionally accept PWM. I'll give it a few more tries at varying pins and frequencies then I'm just going to concentrate on installing and tuning the system I made. As for boost control, it seems that other people who've put this turbo on gasoline engines have had to install an additional wastegate. I wonder if this is really needed. Perhaps people didn't have the vanes open the whole way in order to decrease boost. Anyone have personal experience with this?
|
All times are GMT -5. The time now is 05:41 PM. |
© 2024 MH Sub I, LLC dba Internet Brands