-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top speed / BLDC Control optimization #10
Comments
looks like weakl and weakr are already there; we'd just need the code to set them.... |
Pull requests are very welcome 😋
… Am 11.05.2019 um 10:46 schrieb btsimonh ***@***.***>:
looks like weakl and weakr are already there; we'd just need the code to set them....
Then I guess you could use a sensor angle as an accelerator pedal!
Testing would be an issue; the three of us are 'low speed' applications. With a suitable build, it could be 'road tested' unmanned and wifi controlled, but would exceed the speed limit on my road :).
PRs welcome.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
What if I told you I can help convert all your wheels into 10inch. I can write a tutorial and you can do balance at high speed :) |
What if I told you I can help convert all your wheels into 10inch. I can write a tutorial and you can do balance at high speed :) |
haha! I did think about if we could put something around the wheels - or fit 'snow chains' for operation on grass :). |
This widens the base and the stability increases substantially |
I can see why you want to go faster that your standard hoverboard; with standard hoverboard control :). May need to upgrade the way the wheels are attached, and check the bearings occasionally. But also I guess that your weight is not necessarily directly over the wheels, so the bearings may be under a slightly lighter load. |
you are in hoverboard mode?
To my knowledge, I am the only person who has run this with sensor boards (so they have only been tested with my GD32 based YST board setup). good luck! |
My main board is a real ST32 and the sensors are GD32. I will scope it and read the serial port. Right now it is just stuck always on doing nothing. |
first time i programmed mine from the new repo, my flash played up; never got to the bottom of it, but now seems ok. if Hoverboard mode is disabled in flash, then it will not do hoverboard functions. |
Abusing the power off pin I tracked it down to init flash. I haven't had a chance to test but I am suspecting that you are not really saving a flash area. It is not defined in the linker or the flash area.c. Also I don't understand how you got 0x8000000+62*2048 in flash access but you want 0x800c000 (but not declared) in flash area. |
the flash was my imaginative from scratch implementation, just stole some code from elsewhere. :).
the referenced: but.... you are right, in flash_access.c: ... so we don't use the 'inimage' variable.... and we rely on 0x08000000 + 62*2048 being beyond the end of our code. s |
I found the issues and cleaned up the section defines + rearranged inits until I got the code working. I am now stuck with both "power" led's being red but at least it is not crashing. The hoverboard is turning off via button now. |
power leds mean you have coms to sensor boards (i believe). |
Serial is the correct baud. But I suspect there is a bug there sensor board uart died because I can't see any serial from the main board to the sensors when it should be constantly sending light info |
you have software serial for diags? |
After the power on message nothing else pops up |
did you send unlockASCII? - but it should tell you to do this on the serial..... |
while i have found a few quirks and optimizations i think the issue is that the type of sensor boards i have are sending the data immediately one after another and the mainboard code that i have is unable to find the SOF and the bit alignment is wrong. the 9 bit serial i am sending to the led is working |
check the new 'combined' branches... I believe the 0x1xx is the first thing received in each message. |
i already moved colour to the front in sensorcomms.h |
i finally got my hoverboard working but it seems to go into some emergency stop mode once i hit 3km/h any thoughts? edit: hmm maybe i need to charge my batt |
yes, you are right; I have 10 byte frames from the sensor board. Better not implement anything important based on Roll or acceleration! A thought on baud rate: ref stop mode. Does it bleep? |
Hey guys, I saw this comment on the "NiklasFauth" thread for Sinusoidal control of PMSM; "@lalalandrusVector control like FOC, indeed would be nice, however I think we will reach the STM32F1 Series computational limitations, since we need to run the algorithm at 100 kHz and plus some additional code for balancing controller or other calculations. STM32F4 series are much more capable but they are not in the hoverboard." I just ordered this hoverboard control board, and it comes with an F4 by GigaDevices. It also includes Mosfet drivers rather than a custom discrete implementation with BJT's for the motor drives. Looking on Ebay I see a lot of these boards around, so if you need more processing power it might be worth developing for this board. I could help out with the base firmware (ADC's, PWM outputs etc.), but I don't know much about FOC. I do have an updated schematic of the board. |
it's probably the same as my YST board.... GD32 based, double the CPU power (not sure what clock I'm running with the firmware though). |
Yes, it is an YST board, but I think the next generation, as it features a GD32F403 instead of 103. I will be using this board in the coming weeks for a project, and was planning to port the NiklasFauth firmware for it. Of course it would be even better if FOC would also be possible. |
No, I used default, so 10 words as I see. |
it would work regardless, just may be better to know the number. I thought you had acceleration but not roll? or was that someone else? or was it just what your were sending,not necessarily what you actually saw from the sensor boards? (i'll change the comment to 10, but if you find different, you can always issue a PR :) ). |
Ok. I don't know exactly the number of words since I do not have a logic analyzer. I just saw in other places, tried it and it worked. |
ok. It is always good to start from something :) Link? |
new measurements: 1 line change: (pushed to https://github.com/bipropellant/bipropellant-hoverboard-firmware/tree/newbldc-btsimonh) |
https://github.com/lalalandrus/hoverboard-firmware according to @btsimonh it works more or less as is on the GD uC (motor directions reversed) |
@btsimonh I just tried with SENSOR_WORDS 6, 8, and 10. They all work. I confirm. |
Those are END bytes. Fairly ussual for communication protocols. You have Start bytes and End bytes . That is how you can detect a packet. |
haha... @lalalandrus and I just moved to using them as start bytes ! it make little difference on receipt as the data is very regular and constant. On send, I just send twice, avoiding issues. |
UART comms like this x100 is start byte and 82 could be an end byte but no needed in our case. as a someone who makes fiber optic switches i would say start bytes are almost always present and endbytes are only sometimes present |
Well for moving it is best for all packets to be correct. Health is at risk. |
it seems your GD32F403 is M4 @ 168M with zero wait flash execution which would be much much faster than our STM32F104 M3 @ 72M with a one instruction wait state
the packet decoding error is not due to the packets being decoded wrong, the bytes themselves are wrong. this leads me to believe maybe the baud rate is wrong, there is a bad interrupt, or the signal is being corrupted in someway |
:) ref the 0x100, it's definately 0x1xx - the msg SENT to the sensor board uses the low 8 bits for colour.... in the msg received, I've never seen anything but 00 in the lower 8 bits of the word with the 9th bit set.... @EmanuelFeru - what variable was it you said controlled the expected interval? & what should I set it to for 16khz? |
@btsimonh According to my measurements, I was running the sinusoidal BLDC control at 16 kHz without problems and down to 8 kHz. So in this range 8kHz - 16 kHz should be fine. I did not test on higher frequencies than 16 kHz. |
@lalalandrus - "the hall effect only gives you roughly 40 degree resolution which is pretty poor."
|
lol order of magnitide off 4 degrees vs 40 my math is bad |
@EmanuelFeru - so your position estimation does not depend on a time interval, as long as we're within a range? quick 'fag packet' calculation - |
but your butt will feel it travel up your spine into your ear.... :D |
That should be still ok. Not as smooth and quiet as for 16kHz but still better than Commutation method.
My position estimation does not depend on time interval. I mean, I do not measure the time. I use previous counter to estimate the next interval between Hall changes. When you have some repo to share, I would like to try to see how motors are behaving... but you have a GD32 board.. hmm |
@EmanuelFeru if we cant get the STM32F103 to work we can migrate to STM32F405/415 |
@lalalandrus yes, that can be. I have now much better skills in desoldering these types of SMD components :) The only issue is for other people that want to use the code and cannot desolder, not having the micro-controller, etc. |
@ 8khz on GD32: I think 8khz should be good with STM32F1, it's not far off where we were. @EmanuelFeru - fantastic work! @lalalandrus - thanks for the first integration (well, the one i chose...). I do want to think about how we can drive the sinusoidal waveforms statically at an angle and power for very slow speed use & slow start. It hurts my brain, so suggestion welcome. (I'd like to be able to specify posn (hall count from hall interrupts) fractional posn, and 'power', and for the system to set the wheels to this posn, maintaining the specified power (current) into the coils to keep it there.) @lalalandrus - this repo must have options to work on the lowest power devices; basically you should be able to take any HB and use the firmware. Not saying we can't have extra features that depend on a more powerful platform.... :) |
@EmanuelFeru - "When you have some repo to share, I would like to try to see how motors are behaving... but you have a GD32 board.. hmm" would be good to see your output from the main timing diags.... |
excited to test. it is amazing what we have accomplished in just over 2 weeks |
@btsimonh Thank you as well for your effort! One remark, you mentioned some ticks, Do you use any sort of filter in your control algorithm before sending the commands to motor control? I will take a brake now, let's resume it soon. Nice Work! |
hmm.. you should be able to get there by just selecting the branch dropdown from the main repo... |
The code works and I hit 30km exactly under load. A couple things I observed were sounds from the motor when under load and when it starts phase advance. When underload it almost seems like it is skipping steps. It almost seems like phase advance is happening based on PWML and PWMR rather than speed of the wheel. I notice that the grinding noise happens when pwm is over a certain value or if the wheel hits a disturbance and loses a lot of speed. Could this be a side effect of moving the loop to 8Khz? |
it's very easy to reproduce close to or at zero velocity, but this is not unexpected. P.s. we should move to a new issue - else we'll break github by quantity of comments! |
Is it possible to include the field weakening code from https://github.com/larsmm/hoverboard-firmware-hack-bbcar to increase the top speed of the hoverboard.
Because this projects re-integrates the sensors, it can be used in conjunction with the hoverboard carts and achieve a high top speed.
The text was updated successfully, but these errors were encountered: