It turns out that not all the pwm pins is actually pwm pin, some are timer pins. So I figured out why it dosen't work if you set the register. Thank you all for the advice and interest, Just seemed that due would have been a more capable kind of guy. Guess I'll just modify the pcb for maple and role on that. Think I just need more sun and panels to catch it. Now in the fall it is only doing 3 kwh on a good day Jul and Aug it was giving 8 to 9. It only runs at the frequency of the power co. The maple pins out a little different but the IDE can call a register by name timer_suchandsuch = timer_suchandsuch & 0xshit=0 | 0xnewvalue and presto pwm is set, Real similar to the old mega2650.Ĭould be that I just was not supposed to be building my own inverters, but my homemade grid tie worked hard all summer long and saved me $200 or so. Already have working code for that, just wanted to make my new pcb compatible with avr and sam3. Tried several other things like above mentioned and the compiler wont complie, guess the due was just a waste of money I will continue the project with a leaf labs maple. It would seem that I should be able to do a simple bitWrite(0x40094000, 0x13, 0), However it seems that I have to define a long =x and use the x as the IDE thinks that it is a stinking 16 bit joe he is talking to. This means that WPSWS0 and WPHWS0 are bot set to write protect off. I seem to be able to use bitRead to read the bits in 0x400940E8 bit 0 and bit 8 are both already set to 0. It appears that the register is not write protected at the software level. bitRead seems to work just fine for me and returns the results that I would expect. Like I say I am not a programer by any count. Narrowed it down I think to one bit, 0x40094000, bit #19 needs to go to 0 not 1. The DUE should from the tests have no problem delivering That which I need in terms of speed, I just need a little help modifying the PWM frequency. Until I got greedy and tried a sketch that only played 30 samples then the pulses became too long and the inductive kick of the motor blew one of my igbt transistors. The mega is no problem to get ~4000 Hz, just is not fast enough to do the math and analog writes for more than 19 Hz. I want to play at least 60 samples of sine at a minimum top speed of 60 Hz This means that will be 3600 samples per second. To make this work I need to change the PWM frequency of the due to at least 4000 Hz. The problem is that 1 I am not a great c programer. The project can be viewed at One has to go back several pages to get to the video of the truck actually running with the mega pulling the strings, but it did run for 100 or so miles. The mega 2560 ha served me well as a proof of concept, however is incapable of doing the math and operations per second that this job is going to ultimately going to require. I am building my electric vehicle around a 3 phase hex inverter an an ac induction motor. Finally I have my DUE in hand and wow is he fast and wonderful, so is a leaf labs maple.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |