Solar car races

Post and discuss your VESC projects here.
Thor
Posts: 16
Joined: 22 Jan 2017, 11:32

Re: Solar car races

Postby Thor » 26 Mar 2017, 15:46

I think it is now time to make my design public. You will find it here: https://github.com/Thor368/HSWR_V2


WTFWTFWTFWTFWTFWTFWTFWTFWTFWTFWTF??
OK, I just flipped the table. I was using the up/down arrow keys from the start for bench testing as this feels quit natural to do. I just now tried using the "Set Current" control input in the gui and the motor spinns absoloutly flawlessly. WTF? You know, the text box where you can enter a target current and just hit the button to set it. This starts looking like some kind of communication problem with the µC. I need to dig up the coms code and check how set current and arrow keys differ in control input. I had a look over it some time ago and noticed strage things going on there.

lizardmech wrote:Can you take some screen shots of current graphs while it's running slowly?

The shot already shows quit low eRPM. When a sync loss strikes currents spike and the graph gets realy difficult to read. I attached some shots to show some different situations. Quit remarkable: Even though the current waveforms are garbage the motor still runs fine. I noticed a quite severe offset in phase currents in the high speed run. Still it does run fine. I can not say much about the efficiency at this point. I will start testing drive performance tomorrow. Hopefully.

Thor
Attachments
low speed.png
flawless low speed run in duty cycle mode (D=0.1)
low speed.png (159.87 KiB) Viewed 2120 times
sync loss.png
arrow keys multiple sync losses
sync loss.png (183.17 KiB) Viewed 2120 times
high speed.png
flawless high speed run (D=1)
high speed.png (178.28 KiB) Viewed 2120 times

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: Solar car races

Postby lizardmech » 27 Mar 2017, 03:46

Why are there resistors and capacitors between the ina240 and the shunt, datasheet says not to do that I think. Also why are the drivers going into relatively weak BJTs? Is your board 4 layers throughout? It's easy to fix it if so.

Thor
Posts: 16
Joined: 22 Jan 2017, 11:32

Re: Solar car races

Postby Thor » 27 Mar 2017, 09:26

lizardmech wrote:Why are there resistors and capacitors between the ina240 and the shunt, datasheet says not to do that I think.

Datasheet says if you need input filtering do it that way. I removed the filter and things did not get worse. Maybe a bit better so I will leave it that way for now.

lizardmech wrote:Also why are the drivers going into relatively weak BJTs?

Well relative is relative^^. Peak pulse current is 5A on these things. Dynamic resistance is also quit low. I could optimise the turnoff delay caused by the saturation of the bases. But as switching is already too fast inducing ringing I tuned the swichting speed to around 100ns.

Is your board 4 layers throughout? It's easy to fix it if so.

Ahm yes, it is?

I noticed something strange. The switching frequency is half of what it should be. I set 20kHz as f_sw but my scope (and ears) measure 10kHz. That's fishy. The crystal is running, tho. I need to debug into this thing and take a look at the RCC.

Thor

pf26
Posts: 293
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: Solar car races

Postby pf26 » 27 Mar 2017, 13:46

With center-aligned 3 phase switching, your scope (and ears) see 10kHz while the windings switch at 20kHz since they are subject to 2 commutations per cycle. http://www.nxp.com/support/training-events/motor-tutorial/pulse-width-modulation:WBT_MOTORPWMTUT_WP

Can you scope your current waveform, to see if there is a current measurement issue in your VESC, or if the current shape is really that funny.

lizardmech
Posts: 171
Joined: 19 Jan 2016, 10:54
Location: Australia

Re: Solar car races

Postby lizardmech » 27 Mar 2017, 15:48

One thing I forgot, my ina240 board appears to prefer deadtime compensation of 0 rather than the default 0.08 us. I think the trace traveling over split ground planes and being long with various vias is no good. I always make the analogue current sensing circuits the highest priority when laying it out.

rew
Posts: 937
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Solar car races

Postby rew » 27 Mar 2017, 16:20

The current signal is tricky to view on a scope: There is a lot of switching noise on the signal, and the CPU tries to sample close to the optimal place, away from the switching noise. If you insert a current sense resistor in the phase and try to measure that differentially I still think you'll be swamped in switching noise....

Thor
Posts: 16
Joined: 22 Jan 2017, 11:32

Re: Solar car races

Postby Thor » 30 Mar 2017, 23:48

Well, I got some realy good news to report. I started setting up the lab for benchmarking the controller yesterday and got my first results today.

Staring small with 12V in the intermediate circuit und 1A motor current limit delivered these results:
https://youtu.be/v2nc7Fdntmc
Note: The motor is controlled completely sensorless as the included sensors are incompatible to the standard VESC. Therefore the little nudge to get it running. The only load in the video is the freewheeling load simulator and inherent inertia. The spin up is very smooth.

Some testing later I can say that the controller runs this motor quit well up to 60V and 10A. The power stage gets unexpectedly warm for that load but this is most probably related to my overreaction relaxing the switch and dead times. I also hit a wall in the gui as I was not allowed to rise the max battery voltage above 60V. Hopefully the gui is the only thing that prevents higher voltages from being used. We will see after I patched the gui.

I also took another look at the current waveforms and was pleased to see nicely sin shaped currents. I guess the small low inductance inrunner I started with was not the best choice... :roll:

At the end there is still a fly in the ointment. I got a hard time to measure the lambda at higher input voltages. BLDC mode in neither integral nor delay mode seems to be working. This is most likely related as the FOC uses a delay mode run to determine lambda. Is there something I miss? Any tips?

Thor
Attachments
Benchmark.png
Benchmark.png (177.58 KiB) Viewed 2063 times

rew
Posts: 937
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: Solar car races

Postby rew » 01 Apr 2017, 12:45

If you increase decimation to "2" in that plot, I'll tell you howmany poles your motor has.

edwardcolins
Posts: 1
Joined: 15 May 2017, 17:58
Location: Los Angeles

Re: Solar car races

Postby edwardcolins » 15 May 2017, 18:13

lizardmech wrote:How is your board setup? Mine is 4 layers, the ina240s have the highest routing priority, the furthest one is 4cm from the MCU, traces are all on the top layer with a ground plane below them, the ground Top Residential Solar Panels and ground for the high powered side are split with only a small connection away from electronics.

Can you take some screen shots of current graphs while it's running slowly?


Hello,
Could you tell me? what should be the value of the resistance or capacitor between ina240s??

Thor
Posts: 16
Joined: 22 Jan 2017, 11:32

Re: Solar car races

Postby Thor » 15 May 2017, 19:07

At the moment both are 0 but you can try for yourself.

Let's write a little update if I am already at it:
I got the motor running pretty reliable now. A few issues are still unsolved. First up the voltage dividers are a bit finicky. I am running higher input voltages which requires a higher division factor. Unfortunately the BEMF sensing does not work properly with higher division factors. This is also the cause of the lambda sensing and BLDC mode running so poorly. I worked around this by using the old factors on the phase sensing and higher factors for the busvoltage sensing. The code for the duty cycle estimation while freewheeling needed a patch to cope with the unequal factors but this seems to work quit well. It seems like the resolution is just to low when selecting higher factors for phase sensing but maybe I just overlooked something in the code.

My best runs so far where 30A motor current at 120V bus. Temperature went up to 60°C. Most of the powerloss comes from the poor little IRFP260. I had a little - uhm - accident. ;) One half bridge of IXYS fets had a plasma eruption and needed replacment. The only replacments I had at hand where these IRs. I am pretty sure 60A phase current are possible with better fets. Next problem will be getting a bigger power supply. :)

A endurance run at 120V 5A for those who are interessted in spinning motors^^
https://www.youtube.com/watch?v=04ekDW2AEq0

Thor


Return to “VESC Projects”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest