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

Update to support per PWM output rate, vector servo update, and DSHOT… #426

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

avtoku
Copy link
Contributor

@avtoku avtoku commented Jul 1, 2024

Per PWM output rate
Single call to update all PWM's
DSHOT frequencies (and protocol)
Also fixed a missing check for 'M' servo type.
Increased number of possible mixer servos from 8 to 10

@bsutherland333
Copy link
Contributor

I don't quite understand everything you're doing, could you explain your changes more?

@avtoku
Copy link
Contributor Author

avtoku commented Jul 1, 2024

Servo Frequency Update:
The previous version of PWM and MIXER:

  1. Did not support DSHOT-type servo/motor channels
  2. Specified a single period for all pwm whether they were motors operating at 490Hz or Servos at 50Hz.
  3. Updated the channel PWM's in independent calls to the board.
  4. Channels in the mixer were updated from 8 to 10 because Varmint has 10 PWM outputs.
    The new version
  5. Supports DSHOT protocol
  6. Allows specification of different frequencies for each servo/motor channel (hardware permitting*). If the rate is specified in the range 150000 to 1200000 (bps), it is a DSHOT channel, and 50 to 490 (Hz)_ if it is a PWM channel.
  7. In DSHOT mode, all the channels within a group must be updated simultaneously if very high update update rates are to be achieved.

*On our processors, up to 4 PWM/DSHOT output channels can be assigned to a Timer. All 4 channels must be of the same rate. On the Varmint, PWM Timer groups are 1-4, 5-8, & 9-10, on PixRacer Pro they are 1-4, 5-6, & 7-8.

@bsutherland333
Copy link
Contributor

For now, I set all fixedwing motors to 50hz pwm and multirotor motors to 490hz, with all servos at 50hz. Eventually we will want to revamp the mixing system to make it easy to specify which motors to use dshot and which to use PWM. For now, using DSHOT will require modifying the source code.

@bsutherland333 bsutherland333 merged commit cebf593 into main Jul 3, 2024
2 checks passed
@bsutherland333 bsutherland333 deleted the PTT/PWM branch July 3, 2024 19:10
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

Successfully merging this pull request may close these issues.

2 participants