lego-ble-wireless-protocol-docs
lego-ble-wireless-protocol-docs copied to clipboard
acceleration and deceleration
Hi, I would love to slowly accelerate and deceleration the motor to a precise angle. I get it to to accelerate, but I cant figure out how to slow down the motor at the end of the command. I can only call another degree command and the motor will transition from one to the other speed.
I can find the following in your documentation* but its unlcear what the meaning is:
0x0000000? | Acc.- profile 0x000000?0 | Decc.- profile
*3.27.9. Output Sub Command - StartSpeedForDegrees(Degrees, Speed, MaxPower, EndState, UseProfile) [0x0B]
Here is the command I send:
0x0D, 0x00, 0x81, port, 0x11, 0x0B, motorbytes[0],motorbytes[1],motorbytes[2],motorbytes[3], speed, 100, 127, 0x00000021]);
I was playing around with the last byte wondering if I can figure out what the meaning of the two question marks are.
I believe the profile is a byte where bit flags are used for profiles.
As such, the following would apply:
- 0b00000000 No profile
- 0b00000001 Accelerate
- 0b00000010 Decelerate
- 0b00000011 Both
Also, make sure you have configured the profiles for:
- Acceleration: https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-setacctime-time-profileno-0x05
- Deceleration: https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-setdectime-time-profileno-0x06
I have set both profiles separately and I also applied the flags to set the motor moving. One thing thats confusing with setting the profiles is ProfileNo [Int8]: [0..MAX_PROFILES]
If I change ProfileNo to anything else than 0x01 for acceleration, the motor behaves unexpected. The deceleration profile seems to have absolutely no impact. I tried changing all kinds of values for an hour or so. I think I tried all possible combinations. Something important is missing from the documentation or the boost firmware has a bug.
anymore hints? Acceleration is working, deceleration is not working. I there anyone else who got this working?
Have you tried 0b00000010 for the Profile # when setting Deceleration?
I suspect the internal function being used is the same for both acceleration and deceleration. More of a generic, set time for profile where profile # is the flag of the profile to configure.
Best,
John
On Mon, Apr 27, 2020, 09:59 valentinptc [email protected] wrote:
anymore hints? Acceleration is working, deceleration is not working. I there anyone else who got this working?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LEGO/lego-ble-wireless-protocol-docs/issues/23#issuecomment-620004624, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLBOTF23M7AJNTDSI44D3ROWFUVANCNFSM4MPUR2RQ .
I did, yes. Actually I tried every possible combination. The documentation could win a lot if there could be one or two more paragraphs to explain the exact relationship between the bitmask and the profiles. At this point however I believe there is a bug in the firmware.
When I have more time I will set up a motor on my C# SDK and experiment with the profiles myself. I suspect there is something missing from the docs but will let you know if I uncover anything.
On Mon, Apr 27, 2020, 10:10 valentinptc [email protected] wrote:
I did, yes. Actually I tried every possible combination. The documentation could win a lot if there could be one or two more paragraphs to explain the exact relationship between the bitmask and the profiles. At this point however I believe there is a bug in the firmware.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LEGO/lego-ble-wireless-protocol-docs/issues/23#issuecomment-620012180, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKLBORZFAZV2RVOPU3ZDITROWG6PANCNFSM4MPUR2RQ .
Thank you! When do you expect to have more time?
For me it worked:
I called SetAccTime
and SetDecTime
for profile 0, note that the millis is a 16 bit value where the first byte is the low byte (little-endian), then I called StartSpeedForTime
with profile = 3 (0b0011
).
I used accTime = 1000, decTime = 1000 and a time > 2000 for StartSpeedForTime
.
Trying to set the profile value for SetAccTime
different than 0 caused the connection to abort.