40X2, 2 different PWM - at same time?

Tobias Simonsen

New Member
Hi,

Does anybody knows if it is possible to have two different PWM signals out of the 40X2, at the same time?

I would like to make an upgrade on my lawn mower robot, and for that I would like to control the drive motors independent of each other. Eg. run the left motor on 45% PWM and the right motor on 77%, at same time.
Is that possible, and how could the code look like?

Br. Tobias
 

BeanieBots

Moderator
Yes, you can but there are certain caveats some of which depend on which firmware you have.
I can't recall the latest but I'm sure someone will be along soon with a complete answer.
Meanwhile, have a good read about the command in manual 2.
 

Tobias Simonsen

New Member
Yes, I can see that on page 86 in manual 2, it is described how the HPWM is working. As I can read, I must use it in the single mode and set the setting to %1111. But what shall the polarity be? HHHH? Am I on right track, or have I misunderstood something?
 

hippy

Ex-Staff (retired)
@Tobias : The HPWM command is mainly for control of a single motor. What you want is to use are PWMOUT commands, one for each motor.
 

hippy

Ex-Staff (retired)
The 20X2 has only a single PWMOUT channel so that will not be suitable, but a 28X2 or 40X2 has multiple PWMOUT channels.
 
Top