Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] AMK Motors (the car will move soon) #137

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

ColexDev
Copy link
Member

@ColexDev ColexDev commented Oct 12, 2024

I am working on setting up all motor can message (Free CAN) and getting the init and deinit state machine setup. Then will move on calling motors functions in car.c.

Seth is working on getting CAN2 working with our current CAN setup (different branch)

@ColexDev ColexDev requested a review from a team as a code owner October 12, 2024 00:56
@ColexDev ColexDev marked this pull request as draft October 30, 2024 17:48
…it works but its all there, atleast the stuff I know that needs to be there :) Except for wheel speeds
…I have here is good enough? Or can I just set them to max values and just set torque setpoint normally from there?
@ColexDev ColexDev self-assigned this Nov 17, 2024
CMakeLists.txt Outdated Show resolved Hide resolved
uint16_t AMK_bError : 1;
uint16_t AMK_bWarn : 1;
uint16_t AMK_bQuitDcOn : 1;
uint16_t AMK_bDcOn : 1; /* Same as QUE ?? */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you verified this yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still looking into this. I am unsure if this is even necessary. We can charge the caps and monitor the DC bus voltage ourselves, correct? Or I would think once the precharging on our side is complete, we should be good to go. But that is a Finn question I would think.

common/amk/amk.h Outdated Show resolved Hide resolved
common/amk/amk.h Outdated Show resolved Hide resolved
SEND_AMK_TESTING(motor->states.init_stage, motor->control.bits, motor->status.bits, *motor->pchg_complete);
}

/* TODO: Determine period of this. Should be pretty often of course. The control
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you explored this more? Talk to Demetrius if you need to

motor->torque_limit_positive = 0;
} else {
/* FIXME: Was told 9.8Nm is nominal, and to set to limit to 17Nm for now,
* but in the mean time I am going to go less than 100% as I am unsure */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any resolutions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as of now, I have talked with Demetrius and he still isn't fully sure. I am working on figuring this out though. I think we are going to keep the limits fairly low to start just to make sure all is good

motor->torque_limit_positive = 500;

/* FIXME: Should this actually be negative? */
/* NOTE: For some reason it cannot be 0, so do -0.1% (according to UIUC's team) */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add units to these variables? like torque_limit_positive_nm or something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can, they are % of nominal torque though, the variable names will probably get fairly long.

common/amk/amk.c Outdated Show resolved Hide resolved
case MOTOR_DEINIT_PRECHARGE:
/* 7. Discharge DC caps; QUE should be reset (is this just DcOn?) */

/* FIXME: Will this work? Not sure if this goes low when discharged */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talk to Finn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants