[riot-notifications] [RIOT-OS/RIOT] drivers/motor_driver: driver for analogic H-bridge driving DC motors (#10290)

Gilles DOFFE notifications at github.com
Mon Feb 18 16:15:36 CET 2019


> A couple of minor nits in the code. In particular, I don't like the `#ifdef MOTOR_DRIVER_NUMOF`.
> 
> I run the tests, and I get a bunch of output in the terminal. I'm not sure how to interpret that, but I guess it is working.

Yes you should see something like this:
```
$ bin/native/tests_driver_motor_driver.elf 
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2019.04-devel-167-g81714-motor_driver)
Brake motors !!!
Duty cycle = 500   Direction = CW
MOTOR-DRIVER=0    MOTOR_ID = 0    PWM_VALUE = 500    QDEC_ID = 0    QDEC_VALUE = 500
MOTOR-DRIVER=0    MOTOR_ID = 1    PWM_VALUE = 500    QDEC_ID = 1    QDEC_VALUE = 500
Duty cycle = 1000   Direction = CW
MOTOR-DRIVER=0    MOTOR_ID = 0    PWM_VALUE = 1000    QDEC_ID = 0    QDEC_VALUE = 1000
MOTOR-DRIVER=0    MOTOR_ID = 1    PWM_VALUE = 1000    QDEC_ID = 1    QDEC_VALUE = 1000
Brake motors !!!
Duty cycle = -500   Direction = CCW
MOTOR-DRIVER=0    MOTOR_ID = 0    PWM_VALUE = -500    QDEC_ID = 0    QDEC_VALUE = -500
MOTOR-DRIVER=0    MOTOR_ID = 1    PWM_VALUE = -500    QDEC_ID = 1    QDEC_VALUE = -500
Duty cycle = -1000   Direction = CCW
MOTOR-DRIVER=0    MOTOR_ID = 0    PWM_VALUE = -1000    QDEC_ID = 0    QDEC_VALUE = -1000
MOTOR-DRIVER=0    MOTOR_ID = 1    PWM_VALUE = -1000    QDEC_ID = 1    QDEC_VALUE = -1000
Brake motors !!!
Duty cycle = 500   Direction = CW
MOTOR-DRIVER=0    MOTOR_ID = 0    PWM_VALUE = 500    QDEC_ID = 0    QDEC_VALUE = 500
MOTOR-DRIVER=0    MOTOR_ID = 1    PWM_VALUE = 500    QDEC_ID = 1    QDEC_VALUE = 500
Duty cycle = 1000   Direction = CW
MOTOR-DRIVER=0    MOTOR_ID = 0    PWM_VALUE = 1000    QDEC_ID = 0    QDEC_VALUE = 1000
MOTOR-DRIVER=0    MOTOR_ID = 1    PWM_VALUE = 1000    QDEC_ID = 1    QDEC_VALUE = 1000
Brake motors !!!
```
The callback from native board directly set the QDEC value to the PWM value.
More complex callbacks could be developped to simulate a realistic link between PWM and QDEC measure, according to the needs.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10290#issuecomment-464769595
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190218/9d720b03/attachment.html>


More information about the notifications mailing list