Motorworks2 (#141)

* fixing polarity

* allocate motor on motorUsed only

* perform sub-step integration step for better precision
This commit is contained in:
Peli de Halleux
2017-12-28 09:07:57 -08:00
committed by GitHub
parent a9a9a89811
commit 01f7fe633c
5 changed files with 55 additions and 19 deletions

View File

@ -19,8 +19,8 @@ namespace pxsim {
// console.log("motor before read");
for (let port = 0; port < DAL.NUM_OUTPUTS; ++port) {
const output = outputs[port];
const speed = output ? Math.round(outputs[port].getSpeed()) : 0;
const angle = output ? Math.round(outputs[port].getAngle()) : 0;
const speed = output ? outputs[port].getSpeed() : 0;
const angle = output ? outputs[port].getAngle() : 0;
const tci = MotorDataOff.TachoCounts + port * MotorDataOff.Size;
const tsi = MotorDataOff.TachoSensor + port * MotorDataOff.Size;
data[tci] = data[tci + 1] = data[tci + 2] = data[tci + 3] = 0; // Tacho count