https://www.beyondlogic.org/review-huawei-r4850g2-power-supply-53-5vdc-3kw/ https://github.com/craigpeacock/Huawei_R4850G2_CAN
- adjust CAN.setClockFrequency() to match the crystal on the MCP2515 Board
- put a termination jumper on J1, didn't work without for me (AZDelivery MCP2515 board)
- be careful with any Serial.print statements in the onReceive handler. This will lead to lost CAN frames.
- no regular status request CAN frames are being sent while the menu is active, so the rectifier will fall back to offline values at some point (menu will hence timeout after 10s by default)
- this has been tested with an Arduino Mega 2560 and a Nano
- libraries used:
- Adafruit can library (forked from sandeepmistry/arduino-CAN): https://github.com/adafruit/arduino-CAN
- ArduinoMenu (for Sketch
R4850G2_Menu.ino
, not required forR4850G2_V2.ino
) - SSD1306Ascii (for Sketch
R4850G2_Menu.ino
, not required forR4850G2_V2.ino
) - ClickEncoder (for Sketch
R4850G2_Menu.ino
, not required forR4850G2_V2.ino
)
Pressing the rotary button opens the menu. Voltage and current can be set with the rotary encoder. The "Apply" menu item sets the power supply to the chosen values. Using the "Persist" menu item (scroll down below "Apply") will permanently store the settings in the power supply. Those will then be the default startup values. The power supply will also fall back to those values when the CAN commuication is interrupted.
@Roturbo has provided a nice pinout for a nano: