Skip to content
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

Manual Speed #65

Open
reed-dan opened this issue Feb 18, 2024 · 12 comments
Open

Manual Speed #65

reed-dan opened this issue Feb 18, 2024 · 12 comments

Comments

@reed-dan
Copy link

reed-dan commented Feb 18, 2024

@RoboDurden just wanted to let you know I started creating a manual speed esp32 script based off of your speedtest

https://github.com/reed-dan/hoverboard_hack_esp32_manualspeed

Currently it allows for control via serial with commands like
hover|all|500|1
hover|right|500|1
hover|left|500|1
hover|1|500|1
stop

@RoboDurden
Copy link
Owner

Nice to see that you want to build a more useful Arduino software.
Maybe you want to add a wiki page that lists all Arduino examples with your new repo added.

But I do understand the purpose of this script language.
Waypoints to drive to ? Or runtime configuration of input method ??

Thank you anyway for staying committed to gen2 hoverboards :-)

@reed-dan
Copy link
Author

@RoboDurden I think I implement the delays that were in the autospeed incorrectly. Seems I am transmitting the packets to quickly and it is not giving time for the responses from the mcu to be received/processed. Can you explain the logic of how the delays in autospeed work?

@AILIFE4798
Copy link

as you get better you will understand you should not use delay
nodelay aka millis should be used

actually on esp32 you can use delay because there is rtos on esp it can do multitask but it complicates things

as of now you are still sending commands to 2 slave without delay in between so they reply together and croupt the signal

@RoboDurden
Copy link
Owner

RoboDurden commented Feb 21, 2024

Autospeed ?
@AILIFE4798 has a constant speed feature in his firmware.

There are no delay() in my testspeed.ino

If you have problems with
iNext = iNow + SEND_MILLIS;
this delay must be great enough to ensure complete receipt of the answer when uartBus is is used.

@AILIFE4798 see that remoteUart is simpler to use for most scenarios. If board has a second uart :-/

@AILIFE4798
Copy link

in latest update v129 constant speed work much better now

@AILIFE4798
Copy link

If you have problems with iNext = iNow + SEND_MILLIS; this delay must be great enough to ensure complete receipt of the answer when uartBus is is used.

he send to all slaves without delay, only delay between sends, so slave reply together

@AILIFE4798 see that remoteUart is simpler to use for most scenarios. If board has a second uart :-/

no remote uart cannot spin 2 wheel at different speed as of now so totaly useless for most project but i know it can be easily implemented
but the thing is you can only use 1 uart at a time anyways as grow said so if you used uart2 you still need uartbus

@reed-dan
Copy link
Author

Is there a way to force the esp32 to wait for response and if no response is received after X then send the next packet? Or can i use 1 UART serial on the esp32 to receive and use the other one to transmit aka serial 1 and serial 2?

@RoboDurden
Copy link
Owner

Only with UartBus do you need to wait for response..
Of course you can
if (bAnswer) iTimeNoResonse = millis() + x;

and do whatever you want

if millis() > iTimeNoResonse

@reed-dan
Copy link
Author

@RoboDurden Are you say that uartbus is not necessary? Is uart bus only necessary when multiple masters are desired, but because there is only 1 esp32 we don't need uartbus?

@RoboDurden
Copy link
Owner

RemoteUart needs a dedicated Uart for the one master (who controls a slave) or one single.
With RemoteUartBus there can be many masters and singles on the same Uart "bus".
But then you should wait for the answer of each master/single so the answers do not overwrite each other.

@reed-dan
Copy link
Author

RemoteUart needs a dedicated Uart for the one master (who controls a slave) or one single. With RemoteUartBus there can be many masters and singles on the same Uart "bus". But then you should wait for the answer of each master/single so the answers do not overwrite each other.

What is the advantage to controller (esp32)->master->slave in comparison to just controlling everything with the controller?

@RoboDurden
Copy link
Owner

UartBus is my "invention" and came longer after the Masters-Slave code.
Maste-Slave makes use of the original cable.
UartBus is more complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants