Smartlynx stepper motor code (SPI)

Started by Rx7man, July 16, 2015, 09:06:04 AM

hakcenter

contact manufacturer at that point... lame

thou if i remember reading through, you need to reset the device after setting configs to it ?
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

Damn this is frustrating.. dealing with this thing for a week now and it's still not right... If you pull the reset pin low it's pretty much like a cold boot.. it loses it's brains when you do that, and then you have to reinitialize it. 

I think there might be something screwy in the output bridges of the chip, but how am I going to be able to tell.. it seems to work kinda right up to 100pps, and then it basically just hums.. it's still got nowhere near the torque it should have, because with 86 oz-in it ought to be impossible to stall it by pinching that smooth shaft.
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

Hum' maybe it was the MCP chip... lol

What's that adjustment screw near the cap do ?
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

it is a voltage divider for the 3.3V 5 bit ADC
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

OK, I have a little bit better performance out of it now, but still can't get the RPM I ought to be able to get... it starts to lose serious power around 300 pps, and by 600 pps it doesn't turn at all.. I have a bunch of code work to clean up and I'll see if I spot the problem... I really don't like they way Phi Robotics set up their names, it was WAY too easy to confuse register addresses with the values that were supposed to be in them, and that caused a lot of errors in logic.. fixing that now so that

what used to be SMARTLYNX_ACC is now SMARTLYNX_REG_ACC for the register address and SMARTLYNX_VAL_ACC for the value in it
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

punisher454

 The motor in the servo is a brushless DC motor (BLDC), NOT a  Stepper. I'm surprised that a stepper driver tricked it into turning at all.

There are 3 hall sensors and they are are for electronic commutation. The hall sensor position sequence can be re-used by the control software to track shaft position sort of like a low resolution shaft encoder.  In the commutation sequence there are six valid hall sensor combinations.
  There are two methods of controlling a BLDC, hall sensors and back EMF. The hall sensor method is the one to use for a servo motor since the back-emf sensing method is for continuous rotation applications, and sucks for fine positioning.

  I developed a PCB a few years ago that would replace the original and only contained the traces to connect the motor leads and hall sensors, plus an extra hall sensor under one of the gears for indexing. I was in the process of designing a stand alone controller and had gotten control of the servo motor, but didnt get much farther at the time.   

Hope that helps. I was just checking to see if anybody had developed a controller yet recently and stumbled across this site. It looks like this community is making some real nice progress, and nice to see its open source. I'll try to find a way to share what I figured out about driving the motor, the motor commutation code was real simple. It was the GLCD touchscreen menu system that took up most of my code space on an Atmega88 AVR (before the Arduino boards were so popular and inexpensive).

I'm currently building a twin turbo 454 for my 54GMC hot rod pickup, and have a couple HE351VE's I plan to use. Plus I'm working on my fathers Corvair with a transverse mounted 3800SC that we are planning to remove the Eaton supercharger and run an HE351VE ( I need to get that one done in a few months).  I'm really glad I found this group, I was about to start digging through my old code, but you guys are way farther ahead than I ever was (other than direct motor control, which is where I started).

Hope that helps, and I'll try to find my old actuator board schematic and post it soon.
Marvin 

Rx7man

What I'm working on IS a stepper motor, and the smartlynx controller is designed for it... it's my own offshoot of the LILBB project.

a TT 454 ought to be pretty impressive!
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

punisher454

#22
 Oh cool, I've been reading these threads for the last few days but must have missed the part about using a stepper in place of the stock BLDC.
  My own effort towards VGT control bypassed the CAN interface totally and connected the motor and hall sensors directly to my own controller. I achieved motor control but didnt get much farther due to family life and school (2 year cnc machinist program). Now things have settled down and I decided to re-explore VGT control again, and have been pleasantly surprised to find this group.

The 454 twin turbo project is a little stalled right now, I have an LQ4 build and retrofit for my 99 suburban project going on right now thats been taking up a lot of my spare time. Also I am doing a CNC conversion on a milling machine that I need functional really soon, its a big project which I hope to have done before the holiday season. After those two then its on to the 54 and VGT's.
 
  I sold the 454 for the pickup to my brother last month for his 67 firebird and he immediately put a Weiand blower on it. Crazy fast, but it would have been much better with the turbo's. I have two more 454 blocks left and will start building one for the Twin VGT's, probably sometime next spring. The truck is a '54 built from a combination of Chevy and GMC parts I had left over from other projects. Its riding on a 2wd S-10 frame with a 9" and 4-link setup. Induction is 2 HE351VE's into a modified Weiand Tunnel-Ram that has 16 injectors (2 per port). I plan to add an air-to-water intercooler setup, but I dont have that yet.

  I expect that the LILBB running on a gas engine will require several changes, but it looks like this controller is a good starting point to work from.  I think I'll set up a test unit on my work bench and get up to speed real soon. Has anyone run this controller on a gas engine yet? 

I've been programming AVR uC's for a decade using Bascom (which has worked very well for me) but just a few months ago I started acquiring some Arduino's and have started studying Arduino flavored C, seems kinda weird but there's a gigantic knowledge base and people tend to share a lot. Makes learning and troubleshooting so much easier. I've avoided C for years, but now I guess I need to just buckle down and learn it.

Cant wait to get started.
Marvin

hakcenter

Guy running it on his 4g63 turbo dsm. Didn't want full rpm from the turbo for whatever reason. Working out pretty good from the thread.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

My project with the stepper motor is unrelated to the turbo control..

I am going to try and get my buddy to put a HE351 in his bridgeported '93 Rx7.. He's making about 550 rwhp right now, and if he could get more oomph off the line that would probably do more for his ET's than more top end power.

I want it in my truck with a 6 speed tranny for towing... I would also like to see if I can stuff a 64mm wheel onto it
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

Well, if I can help it, I am going to avoid any STmicro products.. ZERO tech support.. it's been 2 months since I started a ticket with them, I've updated it a couple times, and still nothing.  it's pissing me off in a big way.

'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles