Hi folks,
(Posting now again after a long break, so I'm very rusty)
I've got some new kit & strapped it to an el-cheapo car I bought from a thrift store, and test some basics OK.
I decided to work on a little more advanced basic robotics project with my little one & dug out my old Tamiya RC car.
I've managed to get the basics down OK - steering min & max, setting the ESC full fwd & back (still need to do some work there), so I know that the mechanics should still be functional.
(leaving the BT & sensors out of the equation for now)
What I'm having trouble with is controlling this in an elegant manner.
I try to incrementally set values for the steering & ESC, but it's very jerky.
I suspect this was to do with delay times, i.e. the outbound signal sent to the servo's needs to be picked up & actioned on, so I need to wait for it to complete. If I send the next value too quickly, it's as if a buffer or stack gets flooded with control signals.
Not exactly smooth.
My code is pretty cobbled together form examples I've found (like I said, I'm rusty), but I can't find a better way. (i.e. I should probably reference the servo/ESC in a function via a pointer, rather than sending the whole Servo object instance, but like I said, I'm a little rusty, so a little list here too)
Something else that occurred to me was I could probably try to make use of some sort of (X,Y)-coordinates object to set values & handle them in a nested loop.
What I'm trying to do at this stage is to essentially emulate the analogue RC signal controller it came with, but I'm not sure hot to do this.
Can someone please help me with some samples or references I can look at to figure this out?
(will post my dodgy code later)
edit: I should probably add that I did hook up a simple pot & simply fed that input as a value source for the ESC/servo & worked as desired, thereby testing/validating some assumptions.