5 ms·
I suspect there can be much improvement in his rudimentary "control" algorithm. A simple PID controller could react much faster and zero in on the right throttl
by matt-attack 3y ago
I suspect there can be much improvement in his rudimentary "control" algorithm. A simple PID controller could react much faster and zero in on the right throttle position in response to a varying load.
It was a bit painful watching that controller creep along.
- kortex 3y agoYep. Also the main loop should cycle as fast as possible, and only execute the control loop as needed. Or really use a timer interrupt.
- deepspace 3y agoAlso, look into controlling the ECU directly instead of futzing around with mechanically controlling the cruise control (yuk). And this really, really needs a proper RTOS and "software written by someone more professional than someone who tinkers with Arduinos", since malfunctioning software can destroy the engine and/or burn your house down. For the same reason, it requires a proper PCB, not some yanky box of protoboard and wires.
- ska 3y agoYou don't really need an RTOS to do something like this safely, but agree you need more firmware knowledge than "tinkers with Arduinos" to stay clear of possible unfortunate failure modes. You definitely need to build in some interlocks and/or other sanity checking. Similar with the PCB's, many of the better dev boards are pretty decent, the problem comes with poor connections designed for easy access, etc. This can be resolved without spinning a new board though, or perhaps designing a simple extender.
- savrajsingh 3y agoArduino is single threaded on bare metal — you don’t need RTOS in this case, afaict
- jensenbox 3y agoThe entire time I was watching this I was thinking that a PID controller is exactly what is needed here. Any idea why he did not opt for that? Heck, he could have hacked the cruise controller itself to set the "speed" to 60 Hz.
- js2 3y agoComment on the video asked the same. Reply: > That did occur to me and I think it's a good idea. I'll likely circle back to this project as my coding skills improve, I left a USB cable connected to the Arduino so updating the code will be super easy!