Skip to content
Dan Royer edited this page Oct 3, 2023 · 6 revisions

Daisy Driver 2.0

Firmware for the Daisy Driver 2.0, a controller for a robotic actuator.

App Layout

  • daisyDriver.ino - start() and loop()
  • client.* - All boards implement CANBus client behavior.
  • CANBus.* - CANBus hardware layer wrapper.
  • CANParser.h - Tool for reading/writing valid CAN packets.
  • config.h - Main configuration file
  • led.* - LED light wrapper.
  • memory.* - EEPROM wrapper.
  • motor.h - TMC2130 stepper driver wrapper.
  • pins.h - Hardware definition from Daisy Driver.
  • sensor.h - IPS2200 wrapper.
  • serial.h - USB wrapper.
  • server.* - Custom behavior for device with CANbus ID 0.

Main application

  • send/receive USB messages in GCODE.
  • control at least 6 actuators through a GCODE serial interface.
  • each stepper motor uses TIM8 timer interrupt for step timing.

LED wrapper

The LED wrapper remembers the last color set and uses analogWrite() to set the PWM of the RGB components of the LED.

TODOs

  • An interrupt on the CANBus receive event could quickly move messages to a larger queue. Currently the interrupt hangs when it exits. I'm told this is a bug in a core library.
  • Field-oriented-control (FOC) might be one way to get behaviors like push-to-teach, dial detente, etc.

Other notes

CANbus messages to everyone + the very small inbox

The CAN receive inbox is three messages long. Therefor reading it has to be super fast. One way would be an interrupt when messages arrive.

Currently the interrupt causes the board to hang. (https://community.st.com/t5/stm32-mcus-products/stm32f405-can-rx-interrupt-halts/m-p/592491) In the mean time I put in a delay every time a client receives a message "to all". (10ms * client node id) seems to work pretty well.