#$%@$#@ <--- (insert favorite swearword here), IT WORKS !!!!

Electric Motors and Controllers

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby salty9 » Sat Feb 04, 2012 4:14 am

Lebowski wrote:
20661 bytes filled using assembly :shock:

.


And how many megabytes if you had coded in C? :D
salty9
1 kW
1 kW
 
Posts: 484
Joined: Fri Aug 14, 2009 10:14 pm
Location: 42.6°N 122.71°W

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Alan B » Sat Feb 04, 2012 7:27 am

And how much work to port it to the ARM CPU?
-- Alan W6AKB Cromotored FS GreyBorg, Novara MTB 9C, eBikeE Bent BMC, myEbikeWeb and Thanks to Justin at ebikes.ca for rescuing this forum!
User avatar
Alan B
1.21 GW
1.21 GW
 
Posts: 3878
Joined: Sat Sep 11, 2010 7:43 am
Location: San Francisco Bay Area, USA

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Lebowski » Sat Feb 04, 2012 9:06 am

Alan B wrote:And how much work to port it to the ARM CPU?


I would actually like to port it to ARM, I would like to learn ARM assembly.
Problem is that I have a soldering station from the 1960's and cannot
deal with SMD's or very small chips. Maybe an SOIC would work
in combination with a breakout board but that's the absolute limit.
I should look for a new soldering station maybe.

A 32 bit ARM would be nice (as some stuff is calculated with 32 bit precision)
especially as ARM has lot's of conditional instructions... At the
moment the 30F is capable of making ADC measurements, doing 32 bit computations
and writing fresh output to the PWM at a rate of 100kHz. Can you imagine how
fast an ARM would be :D

First lets see what the beta testers have to say :D
User avatar
Lebowski
100 kW
100 kW
 
Posts: 1472
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Alan B » Sat Feb 04, 2012 10:08 am

Lots of small boards with ARMs aready mounted that will piggyback onto your board for the rest of the logic. Techniques are available to solder fine pitch SMTs with 1960's soldering equipment. Adequate soldering equipment is also available for less than the cost of a moderate Lipo battery. :)
-- Alan W6AKB Cromotored FS GreyBorg, Novara MTB 9C, eBikeE Bent BMC, myEbikeWeb and Thanks to Justin at ebikes.ca for rescuing this forum!
User avatar
Alan B
1.21 GW
1.21 GW
 
Posts: 3878
Joined: Sat Sep 11, 2010 7:43 am
Location: San Francisco Bay Area, USA

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby ctirad » Sat Feb 04, 2012 2:15 pm

Lebowski wrote:I would actually like to port it to ARM, I would like to learn ARM assembly.


You should consider to write in C. It will make the code much more transparent and portable. The speed loss is minimal and you allways can inline assebly routines for better speed when needed.

BTW, I'm not sure, the ARM is generally better option than dsPIC or another MCU/DSP dedicated for motor controll tasks. However, If you want to try ARM, look at STM32 line of chips.

Problem is that I have a soldering station from the 1960's and cannot
deal with SMD's or very small chips.


Don't worry, SMD is easy to handle even with a plain micro soldering iron. I commonly use mine even for FPGAs, bigger MCUs and so. The real problem is BGA.
Erider VK2008 4kW electric scooter
Guewer Classic 2kW electric scooter (modded)
User avatar
ctirad
10 W
10 W
 
Posts: 65
Joined: Wed May 04, 2011 4:50 pm
Location: Prague, Czech Republic

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Arlo1 » Sat Feb 04, 2012 3:11 pm

ctirad wrote:
Lebowski wrote:I would actually like to port it to ARM, I would like to learn ARM assembly.


You should consider to write in C. It will make the code much more transparent and portable. The speed loss is minimal and you allways can inline assebly routines for better speed when needed.

BTW, I'm not sure, the ARM is generally better option than dsPIC or another MCU/DSP dedicated for motor controll tasks. However, If you want to try ARM, look at STM32 line of chips.

Problem is that I have a soldering station from the 1960's and cannot
deal with SMD's or very small chips.


Don't worry, SMD is easy to handle even with a plain micro soldering iron. I commonly use mine even for FPGAs, bigger MCUs and so. The real problem is BGA.

We have been bugging lebowski to write in C for months and he is to stubborn lol. Im learning it its not easy but it does seem better in the long run!
Thanks Justin of http://www.ebikes.ca/
Also a thanks to Methy at http://www.methtek.com/ :)
And Dave who has some good deals on STUF
RC lipo and most other types of Lithium batteries you MUST know your individual cell voltages while charging and discharging.
Batteries of all kinds need respect they can burn your house down, so don't sleep with them under your bed or any other were you cant afford smoke or fire!
[color=#FF0000][b][size=150]Never above 4.2v never below 2.7v EVER!!!
User avatar
Arlo1
100 GW
100 GW
 
Posts: 5227
Joined: Sun Apr 26, 2009 10:36 pm
Location: Nanaimo BC Canada

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Kingfish » Sat Feb 04, 2012 10:42 pm

Arlo1 wrote:We have been bugging lebowski to write in C for months and he is to stubborn lol. Im learning it its not easy but it does seem better in the long run!

I wished it was written in .NET - then I could be of some actual use... instead of useless :wink:
Great work, KF
* My 2WD Garden Wall
* Current ride: 2WD Disc EBikeKit (9C 2806-equivalent) / Dual Lyen 12FET / 15S6P LiPo when commuting.
* Going to California: 2011: Trip completed 8)
* Club Member: 40-mph & 101. 10k-Club: 9653 miles-to-date, 4163 as 2WD.

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed.
The hands acquire shakes, the shakes become a warning.
It is by caffeine alone I set my mind in motion.
User avatar
Kingfish
1.21 GW
1.21 GW
 
Posts: 3517
Joined: Wed Feb 03, 2010 11:23 am
Location: Redmond, WA-USA, Earth, Sol, Orion–Cygnus Arm, Milky Way. Age: > yesterday < tomorrow

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Alan B » Sat Feb 04, 2012 11:35 pm

Lebowski has chosen assembler, it is too late for a change here.

But for other realtime projects C is the most supported portable embedded language that gets to the performance of the hardware.

Dot Net is for another application space. Software engineering requires more than one language. Some are more suited than others for a purpose. Dot Net is well suited for Microsoft's purpose.

I've used many languages over the years. C was a mainstay many years ago, but for most purposes we have moved on. But, for getting close to the hardware and coaxing the maximum performance from a chip, C still reigns supreme if you can manipulate the force. Many old languages we would never use again, but C is the one that keeps on keepin on. Some of the bolted on plusplus features awake the behemoth and warp into bloatspace, but the efficient functional machine is still inside there and it will do amazing things in small time and code space if you avoid waking the wrong objects. :)
-- Alan W6AKB Cromotored FS GreyBorg, Novara MTB 9C, eBikeE Bent BMC, myEbikeWeb and Thanks to Justin at ebikes.ca for rescuing this forum!
User avatar
Alan B
1.21 GW
1.21 GW
 
Posts: 3878
Joined: Sat Sep 11, 2010 7:43 am
Location: San Francisco Bay Area, USA

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Lebowski » Sun Feb 05, 2012 4:39 am

My preference for assembly comes from it's simplicity, there's only a handful of simple instructions and that's it.
I dislike C because I still remember, back in the day I tried to write programs for the Commodore Amiga
90% of the program lines were procedure and function definitions and only 10% of the program did something useful.

I don't know about C being so portable... Let's say I want to port the whole thing to a 33F device (+30 % speed, jay :D ),
the main problem I see is figuring out how to operate all the peripherals. Rewriting the algorithm is easy and not
that much work, but figuring out how to access the 33F's ADC's and PWM outputs, that's where I see the main task...
And this would not be any different for C.

And yes, it's too late to change now :D I just programmed the devices to send around, going in the mail tomorrow.
User avatar
Lebowski
100 kW
100 kW
 
Posts: 1472
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Alan B » Sun Feb 05, 2012 9:24 am

You are right about hardware related software not being portable, but that is language independent.

Some of the new processors have hundreds of assembler instructions to learn, and very complicated behavior. Especially the reduced instruction set architectures with delayed branching and overlapping execution and multiple execution units.

PIC assembler has a very low instruction count. AVR and ARM are much larger.

It takes some time to learn C. But when you move to the next CPU you still know C. You have to learn its hardware. If you use ASM you also have to relearn that. If you move from PDP8 to 8080 to 6800 to 8086 to PDP11 to Sparc to PowerPC to PIC to AVR to ARM you will not want to use ASM anymore.
-- Alan W6AKB Cromotored FS GreyBorg, Novara MTB 9C, eBikeE Bent BMC, myEbikeWeb and Thanks to Justin at ebikes.ca for rescuing this forum!
User avatar
Alan B
1.21 GW
1.21 GW
 
Posts: 3878
Joined: Sat Sep 11, 2010 7:43 am
Location: San Francisco Bay Area, USA

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby pelle242 » Sun Feb 05, 2012 10:37 am

The portabilty of Lebowskis code i mostly academic for now. What are your intentions for it? Keep it your personal baby or open source it and let others contribute? Just curious...
pelle242
100 W
100 W
 
Posts: 180
Joined: Fri Oct 22, 2010 3:41 am
Location: Stockholm, Sweden

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Lebowski » Sun Feb 05, 2012 11:04 am

pelle242 wrote:The portabilty of Lebowskis code i mostly academic for now. What are your intentions for it? Keep it your personal baby or open source it and let others contribute? Just curious...


Well, it runs a unique sensorless algorithm with
automatic timing advance which I invented
myself. To get to where it is now took me about
500 hours of designing and programming.

So, I don't really just want to give all this work
away, I'm hoping to start selling controller chips.
User avatar
Lebowski
100 kW
100 kW
 
Posts: 1472
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby Lebowski » Tue Feb 07, 2012 5:55 am

I posted the schematic and setup manual in a new thread:

viewtopic.php?f=30&t=36602

The setup manual gives an idea of the options my controller IC has...
User avatar
Lebowski
100 kW
100 kW
 
Posts: 1472
Joined: Tue Jun 28, 2011 1:38 am
Location: beautiful Zurich, Switzerland

Re: #$%@$#@ <--- (insert favorite swearword here), IT WORKS

Postby deVries » Mon Apr 23, 2012 12:22 am

Lebowski wrote:And yes, it's too late to change now :D I just programmed the devices to send around, going in the mail tomorrow.

About how many beta testers do you have now? How many have got it working so far? Is there a thread for beta testers & feedback? :?:

Ahhh, I see you linked the beta test thread in the post just above. :twisted:

Thanks! :mrgreen:
deVries
1 MW
1 MW
 
Posts: 1652
Joined: Thu Jul 10, 2008 11:29 pm
Location: Solar Powered 3000w Austin Texas

PreviousNext

Return to Motor Technology

Who is online

Users browsing this forum: No registered users and 5 guests