You should plan to try some things out yourself once you have all of your components as you will learn more that way.
I have all the stuff I need with me and I have been trying some stuff with my servos and it's all working with my code which is awesome! But I am having trouble with the ESC as the PWM frequency it needs to be communicated on is 1000Hz (which is the maximum for the HAT) which is fine I just can't find the Tmin, Tmid and Tmax values.
As an exercise, if you change the PWM frequency to 100Hz, what will be the corresponding values for TickMin, TickMid,TIckMax and what is the range of steps from TickMin to TickMax? Which PWM frequency will give you smoother control with an increased number of steps?
Instead of the 100Hz you suggested, I went for my ESC Frequency of 1000Hz, so I understand the working out now that I can see the change in values from milliseconds to microseconds in the calculating of one tick phase, it's just that if I use the "standard" ESC values of 1000us to 2000us for turning, it will not work and I'll show my working as to why it will not:
PWM Frequency = 1KHz = 1000Hz
Cycle Period = 1/Frequency
=1/1000
=0.001sec
=1ms
Tick = cycle period / counts
= 1/4096
= 0.000244ms
=0.244usec
Tmin = 1000usec
Tmid = 1500usec
Tmax = 2000usec
Therefore:
TickMin = Tmin/Tick
=1000/0.244
= 4096
So TickMin is fine but the other two not so much...
TickMid = Tmid/Tick
=1500/0.244
=6144
TickMax = Tmax/Tick
= 2000/0.244
= 8192
So the minimum tick value (TickMin) for the ESC is 4096 which is the maximum that the PWM HAT can output and the TickMid and TickMax exceed the limit that the PWM HAT can handle. So either the PWM HAT just can't communicate with the ESC or the ESC Tmin, Tmid and Tmax are different to that of standard ESC's. Is there a way to find out what my Tmin, Tmid and Tmax values are, or do I just have to experiment? Also will it harm the ESC if I send it other values that it cannot go to or will it just not recognise them and therefore do nothing with them? I know that some servos will strip their gearing if given the wrong values in frequency as they try to turn but cannot physically do it so the gears just slip and strip themselves. Is this the case with ESC's as (from what I know) I don't presume they have gearing systems?
Also, on my previous question:
What capacitors will I need? I have very limited room for any components so I would like to just use the one battery for my vehicle.
Is there a need for a capacitor to be used if I am only using 2 servos and an ESC through the PWM HAT? Or would they create too much noise and do some bad stuff to my Pi?
I also just want to say thanks so all the help so far, it's really appreciated what you do for all of us asking questions on these forums!
