since hcai is down:( i got the bot to fallback to gemini api. obvislouy i forgot to restart so it failed the first time
since hcai is down:( i got the bot to fallback to gemini api. obvislouy i forgot to restart so it failed the first time
Made a schematic for my robot
I started by importing the library of symbols and footprints i used last year. Then i got a HAT+ template, so i know all dimenions correct. after that i placed all the symbols, wired sda and scl to all 4 tof sensors and bno086. oh and i made the bno086 symbol as i used bno055 last year. then i wired in the motor driver, this year i connected both channels together as the faster motor eats more current(yummy). then i got claude and its kicad mcp to review the erc. the hat+ templete used heirhcal sheet lables or something which kicad dint like as i removed the nested sheet so that solved many erros. also it had a genric 40 pin header for the pi which was pin type passive, for 3v3 too which gave erros so i fixed it by adding PWR_FLAG.
Today i ported the parking function from the old robot over to the new one. the new robot is alot faster so before anything i had to write a function to drive at a specific rpm instead of just slamming a fixed pwm duty like before. first try was a plain P controller off the encoder feedback but that failed, at low rpm the motor just sits there and stalls because it needs a bigger push to break free. so i added an I term, basically if the encoder says the wheel isnt moving the integral keeps winding up the duty till it hits the cap and that shoves the robot forward, then once its actually rolling the controller eases the power back down to hold the target rpm. after i got it moving (slowly at first) i swapped all the old set_speed() calls in parking for start_rpm_control() and stop_rpm_control() so the rpm loop runs in the background while the main code does the steering.then because the camera sits at a diffrent angle on this robot i had to retune the wall following distances too. last year doing wall follow off the distance sensor dint work well so this time im doing it from the camera, which means the numbers from before were all off.debugging wise there was a couple of annoying ones. one time i forgot to start the motor in reverse and it drove forward instead of back, took me ages to find because the encoder was reading distance as a absolute value so going the wrong way still looked like “progress” to the controller. there was also a issue when i hit ctrl c, the thread that runs the rpm loop wasnt closing cleanly so it kept re commanding the motor and the robot would keep going for like 2-3 sec after i killed it, fixed that by stopping the thread first before the gpio gets torn down.lastly once the whole thing actually worked end to end i went back and tuned the stop distances so it parks cleanly and doesnt clip the walls. robot finally parked.
Fixed readme and demo url
Added /ai-status command so that anyone can see how usefull the bot is
I set it up on nest and made it so that you can mention the bot in a thread and it will reply based on the question and it is grounded to the workspace messages