Repository navigation
DC motors and their drivers: dc_motor, Pololu's 50:1 gearmotor, h_bridge, the DRV8833 and the TB6612FNG - #117
Merged
Merged
Conversation
…otor M7's robot begins with its motors. dc_motor (core/analog/motor.c) is a brushed DC motor in the analog engine: the winding's resistance and inductance in series with the back EMF ke w, the rotor's inertia driven by kt i against friction and a load torque through a gearbox's ratio and efficiency, the current and the speed two extra unknowns integrated by the island's method with their truncation errors in its step control. At the operating point the rotor is at rest, so a motor powered at t = 0 starts at its stall current and spins up. emblink/pololu_3073_gearmotor takes its constants from Pololu's specifications at 6 V (650 rpm and 0.15 A unloaded, 1.5 A and 0.74 kg cm stalled; the best-efficiency point they give lands within 6 % of Pololu's); its four fixtures check no load, the start, a stall and reverse.
One bridge of an integrated motor driver solved with the circuit (core/analog/hbridge.c, SPEC-004): FETs from VM and to the sense return as on-resistances that follow VM, their body diodes, logic inputs read as voltages through Schmitt thresholds and pulldowns, the DRV8833, TB6612FNG and L293D truth tables, deglitch, propagation delay, dead time, nSLEEP and its wake, undervoltage lockout, slow-decay current chopping and overcurrent shutdown with an open-drain fault. emblink/h_bridge is the primitive as a part; emblink/drv8833 is two bridges with the datasheet's values (SLVSAR1E), with fixtures for the drive, timing, UVLO, a gearmotor, chopping, overcurrent, sleep and awake currents. An analog device takes up to 16 terminals, and a composite's pin declared nc needs no port.
The primitive takes a logic supply on VCC (vcc_ref): input thresholds as fractions of it, the lockout on it and the quiescent current from it; a separate low-to-high dead time; boolean parameters are read as such. emblink/tb6612fng is the TB6612FNG on it, with the datasheet's control table, 0.5 ohm outputs, 1 V diodes, 50/230 ns dead times, 200 kohm pulldowns, the 1.9/2.2 V VCC lockout and 1 uA standby, and four fixtures.
… into claude/dreamy-archimedes-v28ly5 # Conflicts: # docs/STATUS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first part of M7's robot on the floor: its motors and the drivers that power them from a battery.
What it adds
The motor
dc_motor, an analog primitive (core/analog/motor.c, SPEC-004): a brushed DC motor solved with the circuit.emblink/pololu_3073_gearmotor: Pololu's 50:1 Micro Metal Gearmotor HPCB 6V (extended shaft), its constants from Pololu's specifications at 6 V. Inductance and inertia are estimates, declared in the fidelity.The drivers
h_bridge, an analog primitive (core/analog/hbridge.c, SPEC-004): one bridge of an integrated motor driver.VCC(vcc_ref).emblink/h_bridge: the primitive as a part.emblink/drv8833: TI's DRV8833, with the values of datasheet SLVSAR1E.emblink/tb6612fng: Toshiba's TB6612FNG.ncneeds no port.Evidence
no-load,start,stall,reverse. The constants give a best-efficiency point within 6 % of Pololu's.h_bridgefixtures:forward: 4.83 V across 10 Ωtiming: 1.1 µs propagation, a 300 ns pulse lost to the deglitch, the dead timeuvlomotor: 640 rpm at 6 Vchopping: 0.38 to 0.40 A with 0.5 Ω on AISENovercurrent: nFAULT low, then the 1.35 ms retrysleep: 1.6 µAawake: 1.7 mAdrive: the gearmotor at about 640 rpm, with channel B brakingpwm_brakestandby: under 1 µAvcc_thresholds: 2.0 V is low at VCC = 5 V; the 1.9 V lockouttest_analog,test_catalog,test_engine,catalog_fr,tools_unittestsand the 16 motor and driver fixtures pass on dev, ci-clang, ci-tcc (clean build) and asan.validate.py --all,catalog_text check,check_docsandcheck_bannedare clean.Not yet