Page 1 of 1

Range of command 12 (Drive Forward or Backward)

Posted: Sun Jan 13, 2019 4:37 am
by Hidaka
Hello.

I am using Arduino Library of RoboClaw.
About Function bool ForwardBackwardM1(uint8_t address, uint8_t speed),
According to the document, a value of 0 = full backward, 64 = stop and 127 = full forward.
But actually, a value of 0 = half backward, 64 = stop and 127 = half forward.
Can I get full speed with this function?
Thanks.

Re: Range of command 12 (Drive Forward or Backward)

Posted: Mon Jan 14, 2019 9:19 am
by Basicmicro Support
What firmware version are you using?

I recommend using the duty commands instead of the compatibility commands. Commands 32(Duty M1), 33(Duty M2) or 34(Duty M1 and M2). These commands also have higher resolution. They take a signed 16bit value to specify power %.

Re: Range of command 12 (Drive Forward or Backward)

Posted: Thu Jan 17, 2019 4:07 am
by Hidaka
Firmware version I using is 4.1.27.

I used those commands, it was able to output full speed.
I will not use command 12.

Re: Range of command 12 (Drive Forward or Backward)

Posted: Thu Jan 17, 2019 9:25 am
by Basicmicro Support
Also your firmware is out of date. Please install Basicmicro Motion Studio(replaces Ion Studio) and update the firmware. Thanks.

Re: Range of command 12 (Drive Forward or Backward)

Posted: Fri Jan 18, 2019 3:09 am
by Hidaka
I was just updating my roboclaws to firmware 4.1.29.

The range of values received with command 48 has changed.
In the previous version +/- 32767, but in this version +/- 2960.
Is this range specification of the current version?

Re: Range of command 12 (Drive Forward or Backward)

Posted: Fri Jan 18, 2019 10:09 am
by Basicmicro Support
This appears to be an unintentional side effect of a recent update to the PWM system. In earlier releases all calculations were handled in scaled values until the PWM was being sent to the hardware at which point the scaling was converted. This inserted a multiply and divide into an interrupt handler which caused excessive processor load. The newer firmwares(4.1.27+) converted the internal calculations to hardware range before entering the interrupt. Since GetPWMs(Command 48) just sends out the current calculated PWM values being used by the interrupt handler, previously it was properly scaled and now it is not.

I've added the scaling to the output command itself(Command 48) so the next release will have the proper +-32767 scaling range again. If you would like a pre-release for this please email support@basicmicro.com.