SlushEngine Error Alarm


#1

First of all, I am just start to learn Python and C++. There may be some thing simple or obvious that I may be missing, please be kind and point it out if that the case.

Setting up Slushengine is not as simple as it look especially when one try to optimize for torque and speed. I like the how ST SPINFamily Evaluation software that make everything more straight forward. The interface make it really nice and easy to learn and find the best setup for a stepper motor. I am working on writing and interface with TKinter to get the similar interface for Slushengine.

As i mention earlier, i am new to python and kind of force my way thru the code right now. First of all, I would like to post the drive/motor status to the interface (HiZ, UVLO, OCD, Thermal Status, Stall A, Stall B, and etc).
Look like all the command set is there already in the Motor.py and L6470Registers.py. The X.getStatus() will only output a 5 digit integer and it will need more breakdown to make it user friendly. In L6470Registes.py, there are already a complete user error messages list, but don’t look like it is implemented in the slush library.

Wonder if anyone out there can give some pointer on how I can do what I describe above.

Thanks!


Hardstop with goUntilPress()
#2

Hi Skyice,

I was in the same position as you were not so long ago. I suggest you learn the basics of Python 2 or 3, then try and understand the SlushEngine coding – mainly Board.py (initialising the GPIO pins and SPI) and Motor.py (L6470 methods). It’s also highly worth reading L6470 Datasheet too.

Using Tkinter to design a similar UI to ST SPINFamily Evaluation software will be cumbersome. A better UI tool, I think, is Qt Designer (PyQt). Here’s what my UI looks like using Qt,

As an example, in file Motor.py method initPeripherals(), we call getParam(CONFIG) and we check to see it if equals to 0x2E88. The hexadecimal is the default IC configuration, its decimal value is 11912 and its binary value is 0010111010001000 (16 bits). Referring to the L6470 Datasheet, and the binary value, you can work out which flags are set for CONFIG registry i.e. internal oscillator, 2Mhz, OSCOUT clock, supply voltage compensation disabled, overcurrent shutdown enabled etc.

Hopefully, the above information should get you started